Point
Represents a point with x
and y
coordinates in pixels.
Usage example
var point = L.point(200, 300);
All Leaflet methods and options that accept Point
objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:
map.panBy([200, 300]);
map.panBy(L.point(200, 300));
Creation
Factory | Description |
---|---|
L.point( |
Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values. |
L.point( |
Expects an array of the form [x, y] instead. |
L.point( |
Expects a plain object of the form {x: Number, y: Number} instead. |
Methods
Method | Returns | Description |
---|---|---|
clone() |
Point |
Returns a copy of the current point. |
add( |
Point |
Returns the result of addition of the current and the given points. |
subtract( |
Point |
Returns the result of subtraction of the given point from the current. |
divideBy( |
Point |
Returns the result of division of the current point by the given number. |
multiplyBy( |
Point |
Returns the result of multiplication of the current point by the given number. |
scaleBy( |
Point |
Multiply each coordinate of the current point by each coordinate of
|
unscaleBy( |
Point |
Inverse of |
round() |
Point |
Returns a copy of the current point with rounded coordinates. |
floor() |
Point |
Returns a copy of the current point with floored coordinates (rounded down). |
ceil() |
Point |
Returns a copy of the current point with ceiled coordinates (rounded up). |
distanceTo( |
Number |
Returns the cartesian distance between the current and the given points. |
equals( |
Boolean |
Returns |
contains( |
Boolean |
Returns |
toString() |
String |
Returns a string representation of the point for debugging purposes. |
- 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