目录

public class GroundOverlayOptions

用于定义GroundOverlay的属性的类。

Public Fields

无

Constructor

Construction Method
GroundOverlayOptions()

Public Method Summary

Return typeMethod name
GroundOverlayOptionsanchor(float u, float v)
GroundOverlayOptionsbearing(float bearing)
GroundOverlayOptionsclickable(boolean clickable)
floatgetAnchorU()
floatgetAnchorV()
floatgetBearing()
LatLngBoundsgetBounds()
floatgetHeight()
BitmapDescriptorgetImage()
LatLnggetLocation()
floatgetTransparency()
floatgetWidth()
floatgetZIndex()
GroundOverlayOptionsimage(BitmapDescriptor imageDescriptor)
booleanisClickable()
booleanisVisible()
GroundOverlayOptionsposition(LatLng location, float width)
GroundOverlayOptionsposition(LatLng location, float width, float height)
GroundOverlayOptionspositionFromBounds(LatLngBounds bounds)
GroundOverlayOptionstransparency(float transparency)
GroundOverlayOptionsvisible(boolean visible)
GroundOverlayOptionszIndex(float zIndex)

Public Methods

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 nameParameter desc
u锚点的水平坐标,以图像宽度的比例,在[0,1]范围内。
v锚点的垂直坐标,以图像高度的比例,在[0,1]范围内。


Return:

Return typeParameter desc
GroundOverlayOptions设置新的对齐方式后的GroundOverlayOptions对象。
Method
public GroundOverlayOptions bearing(float bearing)
开发者调用此API可以设置覆盖物从正北顺时针的角度。


Parameters:

Parameter nameParameter desc
bearing覆盖物从正北顺时针的角度,范围为[0,360)。


Return:

Return typeParameter desc
GroundOverlayOptions设置新的角度后的GroundOverlayOptions对象。
Method
public GroundOverlayOptions clickable(boolean clickable)
开发者调用此API可以设置覆盖物的可点击性。


Parameters:

Parameter nameParameter desc
clickable可点击性。


Return:

Return typeParameter desc
GroundOverlayOptions设置新的可点击性后的GroundOverlayOptions对象。
Method
public float getAnchorU()
开发者调用此API可以获取覆盖物锚点的水平位置的值。


Parameters:
无
Return:

Return typeParameter desc
float锚点水平方向的值,范围为[0,1]。
Method
public float getAnchorV()
开发者调用此API可以获取覆盖物锚点的垂直位置的值。


Parameters:
无
Return:

Return typeParameter desc
float锚点垂直方向的值,范围为[0,1]。
Method
public float getBearing()
开发者调用此API可以获取覆盖物的角度。


Parameters:
无
Return:

Return typeParameter desc
float覆盖物的角度,范围为 [0, 360) 。
Method
public LatLngBounds getBounds()
开发者调用此API可以获取覆盖物的矩形区域。


Parameters:
无
Return:

Return typeParameter desc
LatLngBounds覆盖物的矩形区域。
Method
public float getHeight()
开发者调用此API可以获取覆盖物的高度。


Parameters:
无
Return:

Return typeParameter desc
float覆盖物的高度,以米为单位。
Method
public BitmapDescriptor getImage()
开发者调用此API可以获取覆盖物的图片信息。


Parameters:
无
Return:

Return typeParameter desc
BitmapDescriptor覆盖物图片。
Method
public LatLng getLocation()
开发者调用此API可以获取覆盖物的位置。


Parameters:
无
Return:

Return typeParameter desc
LatLng覆盖物的经纬度。
Method
public float getTransparency()
开发者调用此API可以获取覆盖物的透明度。


Parameters:
无
Return:

Return typeParameter desc
float覆盖物的透明度,范围为[0,1],0为不透明,1为全透明。
Method
public float getWidth()
开发者调用此API可以获取覆盖物的宽度。


Parameters:
无
Return:

Return typeParameter desc
float覆盖物的宽度。
Method
public float getZIndex()
开发者调用此API可以获取覆盖物的z指数。


Parameters:
无
Return:

Return typeParameter desc
floatz指数,即覆盖物的叠加顺序。
Method
public GroundOverlayOptions image(BitmapDescriptor imageDescriptor)
开发者调用此API可以设置覆盖物的图片信息。


Parameters:
无
Return:

Return typeParameter desc
GroundOverlayOptions设置新的图片信息后的GroundOverlayOptions对象。
Method
public boolean isClickable()
开发者调用此API可以获取覆盖物的可点击性。


Parameters:
无
Return:

Return typeParameter desc
boolean覆盖物的可点击性,true为可点击,false为不可点击。
Method
public boolean isVisible()
开发者调用此API可以获取覆盖物的可见性。


Parameters:
无
Return:

Return typeParameter desc
boolean覆盖物的可见性,true为可见,false为不可见。
Method
public GroundOverlayOptions position(LatLng location, float width)
根据位置和宽设置覆盖物。在显示时,图片高度根据图片的比例自动匹配。


Parameters:

Parameter nameParameter desc
location锚点的位置。
width覆盖物的宽。


Return:

Return typeParameter desc
GroundOverlayOptions设置新的位置和宽度后的GroundOverlayOptions对象。


Exception:

Exception typeScenario
IllegalArgumentException锚点为空或者传入的width为负数时。
IllegalStateException如果已使用positionFromBounds(LatLngBounds)设置了位置。
Method
public GroundOverlayOptions position(LatLng location, float width, float height)
根据位置和宽高设置覆盖物。在显示时,图片会被缩放来适应指定的尺寸。


Parameters:

Parameter nameParameter desc
location锚点的位置。
width覆盖物的宽。
height覆盖物的高。


Return:

Return typeParameter desc
GroundOverlayOptions设置新的位置和宽高后的GroundOverlayOptions对象。


Exception:

Exception typeScenario
IllegalArgumentException锚点为空或者传入的width/height为负数时。
IllegalStateException如果已使用positionFromBounds(LatLngBounds)设置了位置。
Method
public GroundOverlayOptions positionFromBounds(LatLngBounds bounds)
开发者调用此API可以根据矩形区域设置覆盖物的位置。


Parameters:

Parameter nameParameter desc
bounds矩形区域。


Return:

Return typeParameter desc
GroundOverlayOptions设置新的矩形区域位置后的GroundOverlayOptions对象。


Exception:

Exception typeScenario
IllegalStateException锚如果已使用position(LatLng,float)或者position(LatLng,float,float)设置了位置。
Method
public GroundOverlayOptions transparency(float transparency)
设置覆盖物的透明度,范围为[0,1],0为不透明,1为全透明。


Parameters:

Parameter nameParameter desc
transparency覆盖物的透明度。


Return:

Return typeParameter desc
GroundOverlayOptions设置新的透明度后的GroundOverlayOptions对象。
Method
public GroundOverlayOptions visible(boolean visible)
开发者调用此API可以设置覆盖物的可见性,如果覆盖物不可见,则不会绘制,其他所有状态均保留。


Parameters:

Parameter nameParameter desc
visible覆盖物的可见性。


Return:

Return typeParameter desc
GroundOverlayOptions设置新的可见性后的GroundOverlayOptions对象。
Method
public GroundOverlayOptions zIndex(float zIndex)
用于设置覆盖物的z指数。z指数指的是覆盖物的叠加顺序,具有较大z指数的覆盖物会绘制在具有较小z指数的覆盖物上,具有相同z指数的叠加顺序是任意的。默认的z指数是0。


Parameters:

Parameter nameParameter desc
zIndexz指数,即覆盖物的叠加顺序。


Return:

Return typeParameter desc
GroundOverlayOptions设置新的z指数后的GroundOverlayOptions对象。