@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.
Constructor and Description |
---|
ImageSource(java.lang.String id,
LatLngQuad coordinates,
android.graphics.Bitmap bitmap)
Create an ImageSource from coordinates and a bitmap image
|
ImageSource(java.lang.String id,
LatLngQuad coordinates,
int resourceId)
Create an ImageSource from coordinates and a bitmap image resource
|
ImageSource(java.lang.String id,
LatLngQuad coordinates,
java.net.URL url)
Create an ImageSource from coordinates and an image URL
|
Modifier and Type | Method and Description |
---|---|
protected void |
finalize() |
java.lang.String |
getUrl() |
protected void |
initialize(java.lang.String layerId,
LatLngQuad payload) |
protected java.lang.String |
nativeGetUrl() |
protected void |
nativeSetCoordinates(LatLngQuad latLngQuad) |
protected void |
nativeSetImage(android.graphics.Bitmap bitmap) |
protected void |
nativeSetUrl(java.lang.String url) |
void |
setCoordinates(LatLngQuad latLngQuad)
Updates the latitude and longitude of the four corners of the image
|
void |
setImage(android.graphics.Bitmap bitmap)
Updates the source image to a bitmap
|
void |
setImage(int resourceId)
Updates the source image to a bitmap image resource
|
void |
setUrl(java.lang.String url)
Updates the source image url
|
void |
setUrl(java.net.URL url)
Updates the source image url
|
checkThread, getAttribution, getId, getNativePtr, nativeGetAttribution, nativeGetId
public ImageSource(java.lang.String id, LatLngQuad coordinates, @NonNull java.net.URL url)
id
- The source idcoordinates
- The Latitude and Longitude of the four corners of the imageurl
- remote json filepublic ImageSource(java.lang.String id, LatLngQuad coordinates, @NonNull android.graphics.Bitmap bitmap)
id
- The source idcoordinates
- The Latitude and Longitude of the four corners of the imagebitmap
- A Bitmap imagepublic ImageSource(java.lang.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(@NonNull java.net.URL url)
url
- An Image urlpublic void setUrl(java.lang.String url)
url
- An image urlpublic void setImage(@NonNull android.graphics.Bitmap bitmap)
bitmap
- A Bitmap imagepublic void setImage(@DrawableRes int resourceId) throws java.lang.IllegalArgumentException
resourceId
- The resource ID of a Bitmap imagejava.lang.IllegalArgumentException
@Nullable public java.lang.String getUrl()
public void setCoordinates(LatLngQuad latLngQuad)
latLngQuad
- latitude and longitude of the four corners of the imageprotected void initialize(java.lang.String layerId, LatLngQuad payload)
protected void nativeSetUrl(java.lang.String url)
@NonNull protected java.lang.String nativeGetUrl()
protected void nativeSetImage(android.graphics.Bitmap bitmap)
protected void nativeSetCoordinates(LatLngQuad latLngQuad)
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable