public class GroundOverlayOptions
用于定义GroundOverlay的属性的类。
无
| Construction Method |
| GroundOverlayOptions() |
| Return type | Method name |
| GroundOverlayOptions | anchor(float u, float v) |
| GroundOverlayOptions | bearing(float bearing) |
| GroundOverlayOptions | clickable(boolean clickable) |
| float | getAnchorU() |
| float | getAnchorV() |
| float | getBearing() |
| LatLngBounds | getBounds() |
| float | getHeight() |
| BitmapDescriptor | getImage() |
| LatLng | getLocation() |
| float | getTransparency() |
| float | getWidth() |
| float | getZIndex() |
| GroundOverlayOptions | image(BitmapDescriptor imageDescriptor) |
| boolean | isClickable() |
| boolean | isVisible() |
| GroundOverlayOptions | position(LatLng location, float width) |
| GroundOverlayOptions | position(LatLng location, float width, float height) |
| GroundOverlayOptions | positionFromBounds(LatLngBounds bounds) |
| GroundOverlayOptions | transparency(float transparency) |
| GroundOverlayOptions | visible(boolean visible) |
| GroundOverlayOptions | zIndex(float zIndex) |
| Method |
| public GroundOverlayOptions anchor(float u, float v) |
开发者调用此API可以设置覆盖物图片的对齐方式,即指定锚点的位置。(0, 0)是左上角,(1, 0)是右上角,(0, 1)是左下角,(1, 1)是右下角 。如果不设置,默认为(0.5, 0.5)图片的中心点。例如,在覆盖物X(0.5, 0.3)处的锚点坐标如下:
|
Parameters:
| Parameter name | Parameter desc |
| u | 锚点的水平坐标,以图像宽度的比例,在[0,1]范围内。 |
| v | 锚点的垂直坐标,以图像高度的比例,在[0,1]范围内。 |
Return:
| Return type | Parameter desc |
| GroundOverlayOptions | 设置新的对齐方式后的GroundOverlayOptions对象。 |
| Method |
| public GroundOverlayOptions bearing(float bearing) |
| 开发者调用此API可以设置覆盖物从正北顺时针的角度。 |
Parameters:
| Parameter name | Parameter desc |
| bearing | 覆盖物从正北顺时针的角度,范围为[0,360)。 |
Return:
| Return type | Parameter desc |
| GroundOverlayOptions | 设置新的角度后的GroundOverlayOptions对象。 |
| Method |
| public GroundOverlayOptions clickable(boolean clickable) |
| 开发者调用此API可以设置覆盖物的可点击性。 |
Parameters:
| Parameter name | Parameter desc |
| clickable | 可点击性。 |
Return:
| Return type | Parameter desc |
| GroundOverlayOptions | 设置新的可点击性后的GroundOverlayOptions对象。 |
| Method |
| public float getAnchorU() |
| 开发者调用此API可以获取覆盖物锚点的水平位置的值。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| float | 锚点水平方向的值,范围为[0,1]。 |
| Method |
| public float getAnchorV() |
| 开发者调用此API可以获取覆盖物锚点的垂直位置的值。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| float | 锚点垂直方向的值,范围为[0,1]。 |
| Method |
| public float getBearing() |
| 开发者调用此API可以获取覆盖物的角度。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| float | 覆盖物的角度,范围为 [0, 360) 。 |
| Method |
| public LatLngBounds getBounds() |
| 开发者调用此API可以获取覆盖物的矩形区域。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| LatLngBounds | 覆盖物的矩形区域。 |
| Method |
| public float getHeight() |
| 开发者调用此API可以获取覆盖物的高度。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| float | 覆盖物的高度,以米为单位。 |
| Method |
| public BitmapDescriptor getImage() |
| 开发者调用此API可以获取覆盖物的图片信息。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| BitmapDescriptor | 覆盖物图片。 |
| Method |
| public LatLng getLocation() |
| 开发者调用此API可以获取覆盖物的位置。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| LatLng | 覆盖物的经纬度。 |
| Method |
| public float getTransparency() |
| 开发者调用此API可以获取覆盖物的透明度。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| float | 覆盖物的透明度,范围为[0,1],0为不透明,1为全透明。 |
| Method |
| public float getWidth() |
| 开发者调用此API可以获取覆盖物的宽度。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| float | 覆盖物的宽度。 |
| Method |
| public float getZIndex() |
| 开发者调用此API可以获取覆盖物的z指数。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| float | z指数,即覆盖物的叠加顺序。 |
| Method |
| public GroundOverlayOptions image(BitmapDescriptor imageDescriptor) |
| 开发者调用此API可以设置覆盖物的图片信息。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| GroundOverlayOptions | 设置新的图片信息后的GroundOverlayOptions对象。 |
| Method |
| public boolean isClickable() |
| 开发者调用此API可以获取覆盖物的可点击性。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| boolean | 覆盖物的可点击性,true为可点击,false为不可点击。 |
| Method |
| public boolean isVisible() |
| 开发者调用此API可以获取覆盖物的可见性。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| boolean | 覆盖物的可见性,true为可见,false为不可见。 |
| Method |
| public GroundOverlayOptions position(LatLng location, float width) |
| 根据位置和宽设置覆盖物。在显示时,图片高度根据图片的比例自动匹配。 |
Parameters:
| Parameter name | Parameter desc |
| location | 锚点的位置。 |
| width | 覆盖物的宽。 |
Return:
| Return type | Parameter desc |
| GroundOverlayOptions | 设置新的位置和宽度后的GroundOverlayOptions对象。 |
Exception:
| Exception type | Scenario |
| IllegalArgumentException | 锚点为空或者传入的width为负数时。 |
| IllegalStateException | 如果已使用positionFromBounds(LatLngBounds)设置了位置。 |
| Method |
| public GroundOverlayOptions position(LatLng location, float width, float height) |
| 根据位置和宽高设置覆盖物。在显示时,图片会被缩放来适应指定的尺寸。 |
Parameters:
| Parameter name | Parameter desc |
| location | 锚点的位置。 |
| width | 覆盖物的宽。 |
| height | 覆盖物的高。 |
Return:
| Return type | Parameter desc |
| GroundOverlayOptions | 设置新的位置和宽高后的GroundOverlayOptions对象。 |
Exception:
| Exception type | Scenario |
| IllegalArgumentException | 锚点为空或者传入的width/height为负数时。 |
| IllegalStateException | 如果已使用positionFromBounds(LatLngBounds)设置了位置。 |
| Method |
| public GroundOverlayOptions positionFromBounds(LatLngBounds bounds) |
| 开发者调用此API可以根据矩形区域设置覆盖物的位置。 |
Parameters:
| Parameter name | Parameter desc |
| bounds | 矩形区域。 |
Return:
| Return type | Parameter desc |
| GroundOverlayOptions | 设置新的矩形区域位置后的GroundOverlayOptions对象。 |
Exception:
| Exception type | Scenario |
| IllegalStateException | 锚如果已使用position(LatLng,float)或者position(LatLng,float,float)设置了位置。 |
| Method |
| public GroundOverlayOptions transparency(float transparency) |
| 设置覆盖物的透明度,范围为[0,1],0为不透明,1为全透明。 |
Parameters:
| Parameter name | Parameter desc |
| transparency | 覆盖物的透明度。 |
Return:
| Return type | Parameter desc |
| GroundOverlayOptions | 设置新的透明度后的GroundOverlayOptions对象。 |
| Method |
| public GroundOverlayOptions visible(boolean visible) |
| 开发者调用此API可以设置覆盖物的可见性,如果覆盖物不可见,则不会绘制,其他所有状态均保留。 |
Parameters:
| Parameter name | Parameter desc |
| visible | 覆盖物的可见性。 |
Return:
| Return type | Parameter desc |
| GroundOverlayOptions | 设置新的可见性后的GroundOverlayOptions对象。 |
| Method |
| public GroundOverlayOptions zIndex(float zIndex) |
| 用于设置覆盖物的z指数。z指数指的是覆盖物的叠加顺序,具有较大z指数的覆盖物会绘制在具有较小z指数的覆盖物上,具有相同z指数的叠加顺序是任意的。默认的z指数是0。 |
Parameters:
| Parameter name | Parameter desc |
| zIndex | z指数,即覆盖物的叠加顺序。 |
Return:
| Return type | Parameter desc |
| GroundOverlayOptions | 设置新的z指数后的GroundOverlayOptions对象。 |