ALKMaps.Control.CircleMeasure

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.

Inherits From

Summary
ALKMaps.Control.CircleMeasureThe 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.Control.CircleMeasureCreate a new control to drag circle and other features.
Functions
drawCenter
drawPivot
drawCircle
getRadiusGets circle radius in map units.
moveFeatureCalled when the drag handler detects a mouse-move.
adjustMapAndCircleCenter the map and the circle.

Properties

center in map units

radius in map units

{Number}

centerIcon

{ALKMaps.Icon} The center icon of the circle

pivotIcon

{ALKMaps.Icon} The pivot icon of the circle

minRadius

{Number}min circle radius

maxRadius

{Number}max circle radius

sketchStyle

{Object}custom style for drawing the circle while dragging the mouse.

finishStyle

{Object}custom style for drawing the circle when mouse dragging is done.

Constructor

ALKMaps.Control.CircleMeasure

Create a new control to drag circle and other features.

Parameters

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.

valid options include

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;

Functions

drawCenter

drawCenter: function()

drawPivot

drawPivot: function()

drawCircle

drawCircle: function(limitRadius,
style)

getRadius

getRadius: function()

Gets circle radius in map units.  In meters for Spherical Mercator.

moveFeature

moveFeature: function(pixel)

Called when the drag handler detects a mouse-move.

Parameters

pixel{ALKMaps.Pixel} Location of the mouse event.

adjustMapAndCircle

adjustMapAndCircle: function (center)

Center the map and the circle.  Adjust map zoom level and make sure the circle is within maxRadius and minRadius.

Parameters

center{ALKMaps.LonLat}
Instances of ALKMaps.Layer.Vector are used to render vector data from a variety of sources.
This class represents a longitude and latitude pair
The icon represents a graphical icon on the screen.
drawCenter: function()
drawPivot: function()
drawCircle: function(limitRadius,
style)
getRadius: function()
Gets circle radius in map units.
moveFeature: function(pixel)
Called when the drag handler detects a mouse-move.
adjustMapAndCircle: function (center)
Center the map and the circle.
Create a new control to drag circle and other features.
The DragFeature control moves a feature with a drag of the mouse.
This class represents a screen coordinate, in x and y coordinates
Close