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(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,
URI uri)
Create an ImageSource from coordinates and an image URI
|
ImageSource(String id,
LatLngQuad coordinates,
URL url)
Deprecated.
use
ImageSource(String, LatLngQuad, URI) instead |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize() |
String |
getUri()
Get the source URI.
|
String |
getUrl()
Deprecated.
use
getUri() instead |
protected void |
initialize(String layerId,
LatLngQuad payload) |
protected String |
nativeGetUrl() |
protected void |
nativeSetCoordinates(LatLngQuad latLngQuad) |
protected void |
nativeSetImage(Bitmap bitmap) |
protected void |
nativeSetUrl(String url) |
void |
setCoordinates(LatLngQuad latLngQuad)
Updates the latitude and longitude of the four corners of the image
|
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 |
setUri(String uri)
Updates the source image URI.
|
void |
setUri(URI uri)
Updates the source image URI.
|
void |
setUrl(String url)
Deprecated.
use
setUri(String) instead |
void |
setUrl(URL url)
Deprecated.
use
setUri(URI) instead |
checkThread, getAttribution, getId, getNativePtr, nativeGetAttribution, nativeGetId, setDetached
@Deprecated public ImageSource(String id, LatLngQuad coordinates, 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(String id, LatLngQuad coordinates, 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(String id, LatLngQuad coordinates, 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, 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(URL url)
setUri(URI)
insteadurl
- An Image url@Deprecated public void setUrl(String url)
setUri(String)
insteadurl
- An image urlpublic void setUri(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(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(Bitmap bitmap)
bitmap
- A Bitmap imagepublic void setImage(int resourceId) throws IllegalArgumentException
resourceId
- The resource ID of a Bitmap imageIllegalArgumentException
@Deprecated public String getUrl()
getUri()
insteadpublic String getUri()
public void setCoordinates(LatLngQuad latLngQuad)
latLngQuad
- latitude and longitude of the four corners of the imageprotected void initialize(String layerId, LatLngQuad payload)
protected void nativeSetUrl(String url)
protected String nativeGetUrl()
protected void nativeSetImage(Bitmap bitmap)
protected void nativeSetCoordinates(LatLngQuad latLngQuad)
© 2015–2019 Mapbox. All rights reserved.