RulerControl.js

RulerControl()


constructor

RulerControl class is responsible for displaying map navigation UI. Controls should be added using Map

Options:
  • disableMouse(Boolean)If true, mouse clicks on the map will be ignored (default: false)
  • useCanvas(Boolean)If true, canvas will be used to draw the polyline (default: false)
  • startFlag(String)The URL to the image representing the start of the ruler (default: '')
  • endFlag(String)The URL to the image representing the end of the ruler (default: '')
Parameter Type Description
options Object The options of the control

enable()


method

Enables the control

disable()


method

Disables the control

addCoordinate()


method

Adds a new coordinate to the ruler

Parameter Type Description
coord LatLng The new coordinate

addCoordinateAt()


method

Adds a new coordinate at a specific index in the list of coordinates

Parameter Type Description
coord LatLng The coordinate to add
index Number The index at which to insert the coordinate

clear()


method

Clears the coordinates list and removes the ruler from the map