@UiThread public class ImageSource extends Source
The georeferenced image scales and rotates as the user zooms and rotates the map. The geographic location of the raster image content, supplied with `LatLngQuad`, can be non-axis aligned.
* @see the style specificationConstructor and Description |
---|
ImageSource(long nativePtr)
Internal use
|
ImageSource(String id,
LatLngQuad coordinates,
Bitmap bitmap)
Create an ImageSource from coordinates and a bitmap image
|
ImageSource(String id,
LatLngQuad coordinates,
int resourceId)
Create an ImageSource from coordinates and a bitmap image resource
|
ImageSource(String id,
LatLngQuad coordinates,
URL url)
Create an ImageSource from coordinates and an image URL
|
Modifier and Type | Method and Description |
---|---|
protected void |
finalize() |
String |
getUrl() |
protected void |
initialize(String layerId,
LatLngQuad payload) |
protected String |
nativeGetUrl() |
protected void |
nativeSetImage(Bitmap bitmap) |
protected void |
nativeSetUrl(String url) |
void |
setImage(Bitmap bitmap)
Updates the source image to a bitmap
|
void |
setImage(int resourceId)
Updates the source image to a bitmap image resource
|
void |
setUrl(String url)
Updates the source image url
|
void |
setUrl(URL url)
Updates the source image url
|
getAttribution, getId, getNativePtr, nativeGetAttribution, nativeGetId
public ImageSource(long nativePtr)
nativePtr
- - pointer to native peerpublic ImageSource(String id, LatLngQuad coordinates, URL url)
id
- The source idcoordinates
- The Latitude and Longitude of the four corners of the imageurl
- remote json filepublic ImageSource(String id, LatLngQuad coordinates, @NonNull Bitmap bitmap)
id
- The source idcoordinates
- The Latitude and Longitude of the four corners of the imagebitmap
- A Bitmap imagepublic ImageSource(String id, LatLngQuad coordinates, @DrawableRes int resourceId)
id
- The source idcoordinates
- The Latitude and Longitude of the four corners of the imageresourceId
- The resource ID of a Bitmap imagepublic void setUrl(URL url)
url
- An Image urlpublic void setUrl(String url)
url
- An image urlpublic void setImage(@NonNull Bitmap bitmap)
bitmap
- A Bitmap imagepublic void setImage(@DrawableRes int resourceId) throws IllegalArgumentException
resourceId
- The resource ID of a Bitmap imageIllegalArgumentException
protected void initialize(String layerId, LatLngQuad payload)
protected void nativeSetUrl(String url)
protected String nativeGetUrl()
protected void nativeSetImage(Bitmap bitmap)
© 2015–2017 Mapbox. All rights reserved.