CircleMarker 最后更新时间: 2026年07月02日
AMap.CircleMarker
Construct a circular marker object, specify the circular marker style through CircleMarkerOptions
new AMap.CircleMarker(opts: CircleMarkerOptions)Parameter
opts (CircleMarkerOptions): Circular marker parameters
Demo
var circleMarker = new AMap.CircleMarker({
center: new AMap.LngLat(100.473569, 13.838336),
radius: 10, //Unit:px
strokeColor: "white",
});
//Add the circular CircleMarker object to the Map
map.add(circleMarker);Method
contains(point)
Determine if the specified point coordinates are inside the circle
Parameter: point (LngLatLike) Specified point coordinates
return value: (boolean) true (coordinates inside the circle), false (coordinates outside the circle)
Demo:
circleMarker.contains(new AMap.LngLat(116.433322, 39.900255));hide()
Hide the dot
Demo:
circleMarker.hide();setRadius(radius)
Set the radius of the dot
Parameter: radius (number) Radius of the dot
Demo:
circleMarker.setRadius(10);getCenter()
Get the center of the dot
return value: (LngLat) Latitude and longitude information of the center point of the circle
Demo:
circleMarker.getCenter();getRadius()
Get the radius of the dot
return value: (number) Radius of the dot
Demo:
circleMarker.getRadius();show()
Show the dot
Demo:
circleMarker.show();setOptions(optsArg)
Properties of the dot (including style, outline, fill color, etc.), the center position of the dot cannot be modified
Parameter: optsArg (CircleMarkerOptions) Properties of the dot
Demo:
circleMarker.setOptions({
fillColor: "rgba(0,0,255,1)",
});getOptions()
Get the properties of the dot
return value: (CircleMarkerOptions) Properties of the circle marker
Demo:
circleMarker.getOptions();getExtData()
Get user-defined properties
return value: (Object) The value set by the extData property, returns an empty object if not set
Demo:
circleMarker.getExtData();getCurAltitude()
Get the absolute height of the current CircleMarker
return value: (number) Absolute height of CircleMarker
Demo:
circleMarker.getCurAltitude();setExtData(extData)
Set user-defined properties, supports any data type in JavaScript API
Parameter: extData (Object) User-defined Data
Demo:
circleMarker.setExtData({id:1});destroy()
Destroy Memory - CircleMarker
Demo:
circleMarker.destroy();Event
For event object property descriptions, go to:MapsEvent
