RadiusMap

Extends upon a leaflet map allowing the user to draw a circle.

The class implements the following behaviour - the creation of the circle, editing of the circle after it has been created, as well as supplying a callback with the circle's geometric details (e.g., radius, latitude, and longitude) on circle update.

Only one circle will be drawn on the map at any one time.

new RadiusMap(map: L.Map, updateCallback: updateCallbackSignature, errorCallback: errorCallbackSignature, radiusLimit: number)
Parameters
map (L.Map) A Leaflet map instance
updateCallback (updateCallbackSignature)
errorCallback (errorCallbackSignature)
radiusLimit (number = 5000) ] In meters
Instance Members
radiusLimit
makeDefaultErrorMessage()
drawCircle(radius, latitude, longitude)
handleCreatedEvent()
handleEditResize()
isRadiusBelowLimit(radius)

updateCallbackSignature

Callback for handling geometry updates.

updateCallbackSignature(layerId: number, radius: number, latitude: number, longitude: number)

Type: Function

Parameters
layerId (number)
radius (number)
latitude (number)
longitude (number)

errorCallbackSignature

Callback for handling errors.

errorCallbackSignature(message: string)

Type: Function

Parameters
message (string)