Control.Scale
A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends Control
.
Usage example
L.control.scale().addTo(map);
Creation
Factory | Description |
---|---|
L.control.scale( |
Creates a scale control with the given options. |
Options
Option | Type | Default | Description |
---|---|---|---|
maxWidth |
Number
| 100 |
Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500). |
metric |
Boolean
| True |
Whether to show the metric scale line (m/km). |
imperial |
Boolean
| True |
Whether to show the imperial scale line (mi/ft). |
updateWhenIdle |
Boolean
| false |
If true , the control is updated on moveend , otherwise it's always up-to-date (updated on move ). |
Option | Type | Default | Description |
---|---|---|---|
position |
String
| 'topright' |
The position of the control (one of the map corners). Possible values are 'topleft' ,
'topright' , 'bottomleft' or 'bottomright' |
Methods
Method | Returns | Description |
---|---|---|
getPosition() |
string |
Returns the position of the control. |
setPosition( |
this |
Sets the position of the control. |
getContainer() |
HTMLElement |
Returns the HTMLElement that contains the control. |
addTo( |
this |
Adds the control to the given map. |
remove() |
this |
Removes the control from the map it is currently active on. |
v1.1.0
- Wrld.map
- Wrld.map.indoors
- Wrld.map.themes
- Wrld.map.routes
- Wrld.map.buildings
- Wrld.map.props
- Wrld.map.indoorMapEntities
- Wrld.map.indoorMapFloorOutlines
- Wrld.Prop
- Wrld.indoorMapEntities .IndoorMapEntityInformation
- Wrld.indoorMapEntities.IndoorMapEntity
- Wrld.indoorMapFloorOutlines .IndoorMapFloorOutlineInformation
- Wrld.indoorMapFloorOutlines .IndoorMapFloorOutlinePolygon
- Wrld.indoorMapFloorOutlines .IndoorMapFloorOutlinePolygonRing
- Wrld.themes
- Wrld.Marker
- Wrld.Popup
- Wrld.Circle
- Wrld.Polygon
- Wrld.Polyline
- Wrld.Rectangle
- Wrld.native.Polygon
- Wrld.native.Polyline
- Wrld.Heatmap
- Wrld.buildings.BuildingHighlight
- Wrld.buildings.BuildingHighlightOptions
- Wrld.buildings.BuildingInformation
- Wrld.buildings.BuildingDimensions
- Wrld.buildings.BuildingContour
- Event objects
- WrldIndoorControl
- WrldMarkerController
- WrldSearchbar
- WrldNavigation
- WrldRouteView
- WrldIndoorPolygonEditor
- WrldPoiApi
- L.Map
- L.Marker
- L.Popup
- L.Tooltip
- L.TileLayer
- L.TileLayer.WMS
- L.ImageOverlay
- L.Path
- L.Polyline
- L.Polygon
- L.Rectangle
- L.Circle
- L.CircleMarker
- L.SVG
- L.Canvas
- L.LayerGroup
- L.FeatureGroup
- L.GeoJSON
- L.GridLayer
- L.LatLng
- L.LatLngBounds
- L.Point
- L.Bounds
- L.Icon
- L.DivIcon
- L.Control.Zoom
- L.Control.Attribution
- L.Control.Layers
- L.Control.Scale
- L.Browser
- L.Util
- L.Transformation
- L.LineUtil
- L.PolyUtil
- L.DomEvent
- L.DomUtil
- L.PosAnimation
- L.Draggable
- L.Class
- L.Evented
- L.Layer
- Interactive layer
- L.Control
- L.Handler
- L.Projection
- L.CRS
- L.Renderer
- Event objects
- L.DivOverlay
- Global Switches
- L.noConflict
- L.version
Map
Props
Indoor Map Entities
Indoor Map Floor Outlines
Themes
UI Layers
Vector Layers
Heatmaps
Buildings
Events
Widgets (Optional)
Services (Optional)
Leaflet
Map
Wrld.map
Wrld.map.indoors
Wrld.map.themes
Wrld.map.routes
Wrld.map.buildings
Wrld.map.props
Wrld.map.indoorMapEntities
Wrld.map.indoorMapFloorOutlines
Props
Wrld.Prop
Indoor Map Entities
Wrld.indoorMapEntities .IndoorMapEntityInformation
Wrld.indoorMapEntities.IndoorMapEntity
Indoor Map Floor Outlines
Wrld.indoorMapFloorOutlines .IndoorMapFloorOutlineInformation
Wrld.indoorMapFloorOutlines .IndoorMapFloorOutlinePolygon
Wrld.indoorMapFloorOutlines .IndoorMapFloorOutlinePolygonRing
Themes
Wrld.themes
UI Layers
Wrld.Marker
Wrld.Popup
Vector Layers
Wrld.Circle
Wrld.Polygon
Wrld.Polyline
Wrld.Rectangle
Wrld.native.Polygon
Wrld.native.Polyline
Heatmaps
Wrld.Heatmap
Buildings
Wrld.buildings.BuildingHighlight
Wrld.buildings.BuildingHighlightOptions
Wrld.buildings.BuildingInformation
Wrld.buildings.BuildingDimensions
Wrld.buildings.BuildingContour
Events
Event objects
Widgets (Optional)
WrldIndoorControl
WrldMarkerController
WrldSearchbar
WrldNavigation
WrldRouteView
WrldIndoorPolygonEditor
Services (Optional)
WrldPoiApi
Leaflet
L.Map
L.Marker
L.Popup
L.Tooltip
L.TileLayer
L.TileLayer.WMS
L.ImageOverlay
L.Path
L.Polyline
L.Polygon
L.Rectangle
L.Circle
L.CircleMarker
L.SVG
L.Canvas
L.LayerGroup
L.FeatureGroup
L.GeoJSON
L.GridLayer
L.LatLng
L.LatLngBounds
L.Point
L.Bounds
L.Icon
L.DivIcon
L.Control.Zoom
L.Control.Attribution
L.Control.Layers
L.Control.Scale
L.Browser
L.Util
L.Transformation
L.LineUtil
L.PolyUtil
L.DomEvent
L.DomUtil
L.PosAnimation
L.Draggable
L.Class
L.Evented
L.Layer
Interactive layer
L.Control
L.Handler
L.Projection
L.CRS
L.Renderer
Event objects
L.DivOverlay
Global Switches
L.noConflict
L.version