LatLng
Represents a geographical point with a certain latitude and longitude.
Usage example
var latlng = L.latLng(50.5, 30.5);
All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:
map.panTo([50, 30]);
map.panTo({lon: 30, lat: 50});
map.panTo({lat: 50, lng: 30});
map.panTo(L.latLng(50, 30));
Creation
Factory | Description |
---|---|
L.latLng( |
Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude). |
L.latLng( |
Expects an array of the form [Number, Number] or [Number, Number, Number] instead. |
L.latLng( |
Expects a plain object of the form {lat: Number, lng: Number} or {lat: Number, lng: Number, alt: Number} instead. |
Methods
Method | Returns | Description |
---|---|---|
equals( |
Boolean |
Returns |
toString() |
String |
Returns a string representation of the point (for debugging purposes). |
distanceTo( |
Number |
Returns the distance (in meters) to the given |
wrap() |
LatLng |
Returns a new |
toBounds( |
LatLngBounds |
Returns a new |
Properties
Property | Type | Description |
---|---|---|
lat
| ||
lng
| ||
alt
|
- 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