@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 | Description |
---|---|
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,
android.graphics.Bitmap bitmap) |
Create an ImageSource from coordinates and a bitmap image
|
ImageSource(java.lang.String id,
LatLngQuad coordinates,
java.net.URI uri) |
Create an ImageSource from coordinates and an image URI
|
ImageSource(java.lang.String id,
LatLngQuad coordinates,
java.net.URL url) |
Deprecated.
use
ImageSource(String, LatLngQuad, URI) instead |
Modifier and Type | Method | Description |
---|---|---|
protected void |
finalize() |
|
java.lang.String |
getUri() |
Get the source URI.
|
java.lang.String |
getUrl() |
Deprecated.
use
getUri() instead |
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(int resourceId) |
Updates the source image to a bitmap image resource
|
void |
setImage(android.graphics.Bitmap bitmap) |
Updates the source image to a bitmap
|
void |
setUri(java.lang.String uri) |
Updates the source image URI.
|
void |
setUri(java.net.URI uri) |
Updates the source image URI.
|
void |
setUrl(java.lang.String url) |
Deprecated.
use
setUri(String) instead |
void |
setUrl(java.net.URL url) |
Deprecated.
use
setUri(URI) instead |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkThread, getAttribution, getId, getMaxOverscaleFactorForParentTiles, getMinimumTileUpdateInterval, getNativePtr, getPrefetchZoomDelta, isVolatile, nativeGetAttribution, nativeGetId, nativeGetMaxOverscaleFactorForParentTiles, nativeGetMinimumTileUpdateInterval, nativeGetPrefetchZoomDelta, nativeIsVolatile, nativeSetMaxOverscaleFactorForParentTiles, nativeSetMinimumTileUpdateInterval, nativeSetPrefetchZoomDelta, nativeSetVolatile, setDetached, setMaxOverscaleFactorForParentTiles, setMinimumTileUpdateInterval, setPrefetchZoomDelta, setVolatile
@Deprecated public ImageSource(java.lang.String id, LatLngQuad coordinates, @NonNull java.net.URL url)
ImageSource(String, LatLngQuad, URI)
insteadid
- 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 java.net.URI uri)
An URI is a combination of a protocol and a resource path. The following URI protocol schemes are supported:
id
- The source idcoordinates
- The Latitude and Longitude of the four corners of the imageuri
- json file uripublic 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 image@Deprecated public void setUrl(@NonNull java.net.URL url)
setUri(URI)
insteadurl
- An Image url@Deprecated public void setUrl(java.lang.String url)
setUri(String)
insteadurl
- An image urlpublic void setUri(@NonNull java.net.URI uri)
An URI is a combination of a protocol and a resource path. The following URI protocol schemes are supported:
uri
- An Image uripublic void setUri(java.lang.String uri)
An URI is a combination of a protocol and a resource path. The following URI protocol schemes are supported:
uri
- An image uripublic 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
@Deprecated @Nullable public java.lang.String getUrl()
getUri()
instead@Nullable public java.lang.String getUri()
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