public final class TileOverlay extends BaseOverlay
瓦片提供者:
提供者提供在瓦片图层上使用的图像。您必须在瓦片添加到地图上之前指定提供者。一旦瓦片添加到地图之后,提供者将不能更改。如果瓦片提供者发生变化,您必须使用 TileOverlay.clearTileCache() 方法确保以前的瓦片图不再出现。
Z轴值:
Z轴是控制瓦片图层重复区域的绘制顺序的值。Z轴较大的瓦片图层会在绘制在Z轴较小的瓦片图层上面。如果两个瓦片图层的Z轴数值相同,则覆盖情况将随机出现。
可见性:
瓦片图层是否可见,只是表示是否画在地图上。设置不可见的瓦片图层,将不被画在地图上,但会保留它的其他属性。默认瓦片图层是可见的。
调用这个类的方法必须在主线程使用,操作失败将会抛出IllegalStateException异常。
Tile provider:
The provider provides the images used on the tile layer. You must specify the provider before adding the tiles to the map. Once the tiles are added to the map, the provider cannot be changed. If the tile provider changes, you must use the TileOverlay.clearTileCache() method to ensure that the previous tile images no longer appear.
Z-axis value:
The Z-axis is the value that controls the drawing order of the overlapping areas of the tile layers. Tile layers with a larger Z-axis will be drawn above those with a smaller Z-axis. If two tile layers have the same Z-axis value, the overlap will occur randomly.
Visibility:
Whether the tile layer is visible only indicates whether it is drawn on the map. Setting an invisible tile layer will not be drawn on the map, but its other attributes will be retained. By default, tile layers are visible.
Methods of this class must be called on the main thread, and failure to do so will throw an IllegalStateException exception.
| 限定符和类型 | 字段和说明 |
|---|---|
protected java.lang.ref.WeakReference<com.amap.api.maps.interfaces.IGlOverlayLayer> |
glOverlayLayerRef |
protected TileOverlayOptions |
options |
Field1, Field2, overlayName| 构造器和说明 |
|---|
TileOverlay(com.amap.api.maps.interfaces.IGlOverlayLayer glOverlayLayer,
TileOverlayOptions tileOverlayOptions,
java.lang.String overlayName) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected java.lang.Object |
callNativeFunction(java.lang.String functionName,
java.lang.Object[] args) |
void |
clearTileCache()
清空瓦片图层的缓存
Clear the cache of the tile layer |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getId()
获取瓦片图层的Id
Get the Id of the tile layer |
float |
getZIndex()
获取瓦片图层的Z轴值
Get the Z-axis value of the tile layer |
int |
hashCode() |
boolean |
isVisible()
获取瓦片图层是否可见。
|
void |
remove()
从地图上删除瓦片图层
Remove tile layer from the map |
void |
setVisible(boolean visible)
设置瓦片图层可见属性
Set the visibility attribute of the tile layer |
void |
setZIndex(float zIndex)
设置瓦片图层的Z轴值
Set the Z-axis value of the tile layer |
protected void |
updateOption() |
method1, method2protected TileOverlayOptions options
protected java.lang.ref.WeakReference<com.amap.api.maps.interfaces.IGlOverlayLayer> glOverlayLayerRef
public TileOverlay(com.amap.api.maps.interfaces.IGlOverlayLayer glOverlayLayer,
TileOverlayOptions tileOverlayOptions,
java.lang.String overlayName)
public void remove()
public void clearTileCache()
public java.lang.String getId()
public void setZIndex(float zIndex)
zIndex - Z轴值
public float getZIndex()
public void setVisible(boolean visible)
visible - true: 可见;false: 不可见
public boolean isVisible()
public boolean equals(java.lang.Object o)
equals 在类中 java.lang.Objectpublic int hashCode()
hashCode 在类中 java.lang.Objectprotected java.lang.Object callNativeFunction(java.lang.String functionName,
java.lang.Object[] args)
protected void updateOption()