The CircleMeasure control moves the circle with a drag of the center. Resize the circle with a drag of pivot handler. Create a new control with the ALKMaps.Control.CircleMeasure constructor.
ALKMaps. | The CircleMeasure control moves the circle with a drag of the center. |
Properties | |
layer | {ALKMaps.Layer.Vector} |
circleLayer | {ALKMaps.Layer.Vector} |
center in map units | {ALKMaps.LonLat} |
radius in map units | {Number} |
centerIcon | {ALKMaps.Icon} The center icon of the circle |
pivotIcon | {ALKMaps.Icon} The pivot icon of the circle |
minRadius | |
maxRadius | |
sketchStyle | |
finishStyle | |
Constructor | |
ALKMaps. | Create a new control to drag circle and other features. |
Functions | |
drawCenter | |
drawPivot | |
drawCircle | |
getRadius | Gets circle radius in map units. |
moveFeature | Called when the drag handler detects a mouse-move. |
adjustMapAndCircle | Center the map and the circle. |
{ALKMaps.Icon} The center icon of the circle
{ALKMaps.Icon} The pivot icon of the circle
Create a new control to drag circle and other features.
options | {Object} Optional object whose properties will be set on the control. Center and radius are optional. If not supplied, the circle will not be drawn after adding the control to the map. minRadius and maxRadius are optional. If not supplied, the circle radius will not have limit. |
center | {ALKMaps.LonLat} |
radius | {Number} |
centerIcon | {ALKMaps.Icon} |
pivotIcon | {ALKMaps.Icon} |
minRadius | {Number} |
maxRadius | {Number} |
sketchStyle | {Object} such as { fillColor: “#080808”, fillOpacity: 0.4, strokeColor: “#080808”, strokeOpacity: 1, strokeWidth: 2 } |
finishStyle | {Object} such as { fillColor: “#FFFFFF”, fillOpacity: 0.4, strokeColor: “#0000FF”, strokeOpacity: 1, strokeWidth: 2 } |
var cm = new ALKMaps.Control.CircleMeasure({center:center, radius:1000}) // For Spherical Mecator, meters are expected. map.addControls([cm]); var radius = cm.getRadius(); var center = cm.center;
moveFeature: function( pixel )
Called when the drag handler detects a mouse-move.
pixel | {ALKMaps.Pixel} Location of the mouse event. |
adjustMapAndCircle: function ( center )
Center the map and the circle. Adjust map zoom level and make sure the circle is within maxRadius and minRadius.
center | {ALKMaps.LonLat} |
drawCenter: function()
drawPivot: function()
drawCircle: function( limitRadius, style )
Gets circle radius in map units.
getRadius: function()
Called when the drag handler detects a mouse-move.
moveFeature: function( pixel )
Center the map and the circle.
adjustMapAndCircle: function ( center )