- - Point
+ - Point
- Bounds
- LatLng
- LatLngBounds
@@ -164,13 +164,13 @@ map.addLayer(cloudmade);
center |
LatLng |
- LatLng(0, 0) |
+ null |
Initial geographical center of the map. |
zoom |
Number |
- 0 |
+ null |
Initial map zoom. |
@@ -250,7 +250,7 @@ map.addLayer(cloudmade);
Pans the map to a given center. Makes an animated pan if new center is not more than one screen away from the current one. |
- panBy( <Point> point ) |
+ panBy( <Point> point ) |
this |
Pans the map by a given number of pixels (animated). |
@@ -306,7 +306,7 @@ map.addLayer(cloudmade);
getSize() |
- Point |
+ Point |
Returns the current size of the map container. |
@@ -316,7 +316,7 @@ map.addLayer(cloudmade);
getPixelOrigin() |
- Point |
+ Point |
Returns the projected pixel coordinates of the top left point of the map layer (useful in custom layer and overlay implementations). |
@@ -337,22 +337,22 @@ map.addLayer(cloudmade);
latLngToLayerPoint( <LatLng> latlng ) |
- Point |
+ Point |
Returns the map layer point that corresponds to the given geographical coordinates (useful for placing overlays on the map). |
- layerPointToLatLng( <Point> point ) |
+ layerPointToLatLng( <Point> point ) |
LatLng |
Returns the geographical coordinates of a given map layer point. |
mouseEventToContainerPoint( <MouseEvent> event ) |
- Point |
+ Point |
Returns the pixel coordinates of a mouse click (relative to the top left corner of the map) given its event object. |
mouseEventToLayerPoint( <MouseEvent> event ) |
- Point |
+ Point |
Returns the pixel coordinates of a mouse click relative to the map layer given its event object.
|
@@ -361,116 +361,29 @@ map.addLayer(cloudmade);
Returns the geographical coordinates of the point the mouse clicked on given the click's event object. |
- containerPointToLayerPoint( <Point> point ) |
- Point |
+ containerPointToLayerPoint( <Point> point ) |
+ Point |
Converts the point relative to the map container to a point relative to the map layer. |
- layerPointToContainerPoint( <Point> point ) |
- Point |
+ layerPointToContainerPoint( <Point> point ) |
+ Point |
Converts the point relative to the map layer to a point relative to the map container. |
project( <LatLng> latlng, <Number> zoom? ) |
- Point |
+ Point |
Projects the given geographical coordinates to pixel coordinates for the given zoom level (current zoom level by default). |
- unproject( <Point> point, <Number> zoom? ) |
+ unproject( <Point> point, <Number> zoom? ) |
LatLng |
Projects the given pixel coordinates to geographical coordinates for the given zoom level (current zoom level by default). |
- L.LatLng
-
- Represents a geographical point with a certain latitude and longitude.
-
- Constructor
-
-
-
- Constructor |
- Description |
-
-
- L.LatLng( <Number> latitude, <Number> longitude, <Boolean> noWrap? ) |
- Creates a LatLng object with the given latitude and longitude. Wraps longitude to lie between -180 and 180 and clamps longitude between -90 and 90 by default — you can disable this with the noWrap argument. |
-
-
-
- Properties
-
-
-
- Property |
- Type |
- Description |
-
-
- lat |
- Number |
- Latitude in degrees. |
-
-
- lng |
- Number |
- Longitude in degrees. |
-
-
-
- Methods
-
-
-
- Method |
- Returns |
- Description |
-
-
- equals( <LatLng> otherLatlng ) |
- Boolean |
- Returns true if the given LatLng point is at the same position (within a small margin of error). |
-
-
- toString() |
- String |
- Returns a string representation of the point (for debugging purposes). |
-
-
-
- Constants
-
-
-
- Constant |
- Type |
- Value |
- Description |
-
-
- DEG_TO_RAD |
- Number |
- Math.PI / 180 |
- A multiplier for converting degrees into radians. |
-
-
- RAD_TO_DEG |
- Number |
- 180 / Math.PI |
- A multiplier for converting radians into degrees. |
-
-
- MAX_MARGIN |
- Number |
- 1.0E-9 |
- Max margin of error for the equality check. |
-
-
-
-
-
+
L.Path
An abstract class that contains options and constants shared between vector overlays (Polygon, Polyline, Circle). Do not use it directly.
@@ -644,6 +557,185 @@ map.addLayer(polyline);
+
+
L.Point
+
+ Represents a point with x and y coordinates in pixels.
+
+
Constructor
+
+
+
+ Constructor |
+ Description |
+
+
+ L.Point( <Number> x, <Number> y ) |
+ Creates a Point object with the given x and y coordinates. |
+
+
+
+ Properties
+
+
+
+ Property |
+ Type |
+ Description |
+
+
+ x |
+ Number |
+ The x coordinate. |
+
+
+ y |
+ Number |
+ The y coordinate. |
+
+
+
+ Methods
+
+
+
+ Method |
+ Returns |
+ Description |
+
+
+ add( <Point> otherPoint ) |
+ Point |
+ Returns the result of addition of the current and the given points. |
+
+
+ subtract( <Point> otherPoint ) |
+ Point |
+ Returns the result of subtraction of the given point from the current. |
+
+
+ multiplyBy( <Number> number ) |
+ Point |
+ Returns the result of multiplication of the current point by the given number. |
+
+
+ divideBy( <Number> number ) |
+ Point |
+ Returns the result of division of the current point by the given number. |
+
+
+ distanceTo( <Point> otherPoint ) |
+ Number |
+ Returns the distance between the current and the given points. |
+
+
+ clone() |
+ Point |
+ Returns a copy of the current point. |
+
+
+ round() |
+ Point |
+ Returns a copy of the current point with rounded coordinates. |
+
+
+ toString() |
+ String |
+ Returns a string representation of the point for debugging purposes. |
+
+
+
+
+
+
+ L.LatLng
+
+ Represents a geographical point with a certain latitude and longitude.
+
+ Constructor
+
+
+
+ Constructor |
+ Description |
+
+
+ L.LatLng( <Number> latitude, <Number> longitude, <Boolean> noWrap? ) |
+ Creates a LatLng object with the given latitude and longitude. Wraps longitude to lie between -180 and 180 and clamps longitude between -90 and 90 by default — you can disable this with the noWrap argument. |
+
+
+
+ Properties
+
+
+
+ Property |
+ Type |
+ Description |
+
+
+ lat |
+ Number |
+ Latitude in degrees. |
+
+
+ lng |
+ Number |
+ Longitude in degrees. |
+
+
+
+ Methods
+
+
+
+ Method |
+ Returns |
+ Description |
+
+
+ equals( <LatLng> otherLatlng ) |
+ Boolean |
+ Returns true if the given LatLng point is at the same position (within a small margin of error). |
+
+
+ toString() |
+ String |
+ Returns a string representation of the point (for debugging purposes). |
+
+
+
+ Constants
+
+
+
+ Constant |
+ Type |
+ Value |
+ Description |
+
+
+ DEG_TO_RAD |
+ Number |
+ Math.PI / 180 |
+ A multiplier for converting degrees into radians. |
+
+
+ RAD_TO_DEG |
+ Number |
+ 180 / Math.PI |
+ A multiplier for converting radians into degrees. |
+
+
+ MAX_MARGIN |
+ Number |
+ 1.0E-9 |
+ Max margin of error for the equality check. |
+
+
+
+
+
© 2011 CloudMade. Map data © 2011 OpenStreetMap contributors, CC-BY-SA.