EllipseEditor
AMap.EllipseEditor
Construct an ellipse editing plugin object
new AMap.EllipseEditor(map: Map, ellipse: Ellipse?, opts: Object?)Parameter
map (Map) Instance of AMap.Ellipse
ellipse (Ellipse?) Instance of AMap.Map
opts (Object?) Set parameters
Demo
//Introduce oval editor plugin
map.plugin(["AMap.EllipseEditor"], function () {
//Instantiate the Ellipse Editor, passing in the map instance and the ellipse instance to be edited
var ellipseEditor = new AMap.EllipseEditor(map, ellipse);
//Enable Edit Mode
ellipseEditor.open();
});Method
setTarget(overlay?)
Set Edit Object
Parameter: overlay (Ellipse?) Edit Object
Demo:
//Ellipse Instance
var ellipse = new AMap.Ellipse({
center: new AMap.LngLat(116.433322, 39.900255),
radius: [2000, 1000],
});
map.add(ellipse);
//Instantiate the oval editor, passing in the map instance and the oval instance to be edited
var ellipseEditor = new AMap.EllipseEditor(map);
//Set ellipse as the oval instance to be edited
ellipseEditor.setTarget(ellipse);
ellipseEditor.open();getTarget()
Get editing object
return value: (Ellipse | undefined) Current editing object
Demo:
ellipseEditor.getTarget();open()
Start editing object
Demo:
ellipseEditor.open();close()
Stop editing the object
Demo:
ellipseEditor.close();Event
For event object property descriptions, go to:MapsEvent