diff --git a/reference.html b/reference.html index 32996d21..f715c158 100644 --- a/reference.html +++ b/reference.html @@ -96,7 +96,7 @@ bodyclass: api-page @@ -123,7 +123,7 @@ bodyclass: api-page
-

This reference reflects Leaflet 0.4.5. You can find docs for the in-progress master version in reference.html of gh-pages-master branch.

+

This reference reflects Leaflet 0.5. You can find docs for the in-progress master version in reference.html of gh-pages-master branch.

L.Map

@@ -266,8 +266,8 @@ var map = L.map('map', { worldCopyJump Boolean - true - With this option enabled, the map tracks when you pan to another "copy" of the world and moves all overlays like markers and vector layers there. + false + With this option enabled, the map tracks when you pan to another "copy" of the world and seamlessly jumps to the original one so that all overlays like markers and vector layers are still visible. closePopupOnClick @@ -577,14 +577,14 @@ var map = L.map('map', { Sets the zoom of the map. - zoomIn() + zoomIn( <Number> delta? ) this - Increases the zoom of the map by 1. + Increases the zoom of the map by delta (1 by default). - zoomOut() + zoomOut( <Number> delta? ) this - Decreases the zoom of the map by 1. + Decreases the zoom of the map by delta (1 by default). fitBounds( @@ -891,6 +891,13 @@ var map = L.map('map', { MapPanes Returns an object with different map panes (to render overlays in). + + whenReady( + <Function> fn, + <Object> context? ) + this + Runs the given callback when the map gets initialized with a place and zoom, or immediately if it happened already, optionally passing a function context. +

Locate options

@@ -1122,6 +1129,18 @@ var map = L.map('map', { 1.0 The opacity of the marker. + + riseOnHover + Boolean + false + If true, the marker will get on top of others when you hover the mouse over it. + + + riseOffset + Number + 250 + The z-index offset used for the riseOnHover feature. +

Events

@@ -1159,6 +1178,11 @@ var map = L.map('map', { MouseEvent Fired when the mouse leaves the marker. + + contextmenu + MouseEvent + Fired when the user right-clicks on the marker. + dragstart Event @@ -1382,6 +1406,12 @@ var map = L.map('map', {
The margin between the popup and the edges of the map view after autopanning was performed. + + zoomAnimation + Boolean + true + Whether to animate the popup on zoom. Disable it if you have problems with Flash content inside popups. +

Methods

@@ -2027,6 +2057,11 @@ L.imageOverlay(imageUrl, imageBounds).addTo(map); MouseEvent Fired when the user pushes the right mouse button on the object, prevents default browser context menu from showing if there are listeners on this event. + + add + Event + Fired when the path is added to the map. + remove Event @@ -2071,6 +2106,12 @@ L.imageOverlay(imageUrl, imageBounds).addTo(map); this Opens the popup previously bound by the bindPopup method in the given point, or in one of the path's points if not specified. + + closePopup() + + this + Closes the path's bound popup if it is opened. + setStyle( <Path options> object ) @@ -2712,6 +2753,16 @@ map.fitBounds(bounds); MouseEvent Fired when the user right-clicks on one of the layers. + + layeradd + LayerEvent + Fired when a layer is added to the group. + + + layerremove + LayerEvent + Fired when a layer is removed from the map. + @@ -2890,8 +2941,7 @@ map.panTo(new L.LatLng(50, 30)); L.LatLng( <Number> latitude, - <Number> longitude, - <Boolean> noWrap? ) + <Number> longitude ) @@ -2900,7 +2950,7 @@ map.panTo(new L.LatLng(50, 30)); L.latLng([]) - Creates an object representing a geographical point 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. + Creates an object representing a geographical point with the given latitude and longitude. @@ -2953,6 +3003,15 @@ map.panTo(new L.LatLng(50, 30)); String Returns a string representation of the point (for debugging purposes). + + wrap( + <Number> left, + <Number> right ) + + + LatLng + Returns a new LatLng object with the longitude wrapped around left and right boundaries (-180 to 180 by default). +

Constants

@@ -3248,6 +3307,14 @@ map.panBy(new L.Point(200, 300)); Point Returns a copy of the current point with rounded coordinates. + + equals( + <Point> otherPoint ) + + + Boolean + Returns true if the given point has the same coordinates. + toString() String @@ -3370,12 +3437,17 @@ map.panBy(new L.Point(200, 300)); Returns true if the rectangle intersects the given bounds. - isValid() - + isValid() Boolean Returns true if the bounds are properly initialized. + + getSize() + + Point + Returns the size of the given bounds. + @@ -3888,6 +3960,27 @@ L.control.layers(baseLayers, overlays).addTo(map); "<someName2>": layer2 } +

The layer names can contain HTML, which allows you to add additional styling to the items:

+ +
{"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
+ + +

Events

+ +

You can subscribe to the following events using these methods.

+ + + + + + + + + + + +
EventDataDescription
baselayerchangeLayerEvent + Fired when the base layer is changed through the control.

L.Control.Scale

@@ -4387,6 +4480,19 @@ L.map('map'); }; +

Constructor Hooks

+ +

If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for L.Polyline). Leaflet comes with a way to do it easily using the addInitHook method:

+ +
MyClass.addInitHook(function () {
+	// ... do something in constructor additionally
+	// e.g. add event listeners, set custom properties etc.
+});
+ +

You can also use the following shortcut when you just need to make one additional method call:

+ +
MyClass.addInitHook('methodName', arg1, arg2, …);
+

L.Browser

@@ -4412,6 +4518,11 @@ L.map('map'); Boolean true for Internet Explorer 6. + + ie7 + Boolean + true for Internet Explorer 6. + webkit Boolean @@ -4422,7 +4533,7 @@ L.map('map'); Boolean true for webkit-based browsers that support CSS 3D transformations. - + android Boolean true for Android mobile browser. + + android23 + Boolean + true for old Android stock browsers (2 and 3). + mobile Boolean @@ -4457,6 +4573,11 @@ L.map('map'); Boolean true for all browsers on touch devices. + + msTouch + Boolean + true for browsers with Microsoft touch model (e.g. IE10). + retina Boolean @@ -4484,7 +4605,7 @@ L.map('map'); Object - Merges the properties of the src object (or multiple objects) into dest object and returns the latter. + Merges the properties of the src object (or multiple objects) into dest object and returns the latter. Has an L.extend shortcut. bind( @@ -4493,12 +4614,12 @@ L.map('map'); Function - Returns a function which executes function fn with the given scope obj (so that this keyword refers to obj inside the function code). + Returns a function which executes function fn with the given scope obj (so that this keyword refers to obj inside the function code). Has an L.bind shortcut. stamp( <Object> obj ) String - Applies a unique key to the object and returns that key. + Applies a unique key to the object and returns that key. Has an L.stamp shortcut. + new L.PosAnimation() - Creates a Transition object tied to a particular element with the given options. + Creates a PosAnimation object. -

Options

+

Methods

- - - + + - - - - - - - - - - - - - - - - - - - - - - + + + +
OptionTypeDefaultMethodReturns Description
durationNumber0.5Duration of the animation in seconds.
easingString'ease'One of the timing functions for the animation.
fpsNumber50Frames per second for the timer fallback (IE6-9).
fakeStepIntervalNumber100How often to fire the step event during transition with a timer (as native transitions don't support such events).run( + <HTMLElement> element, + <Point> newPos, + <Number> duration?, + <Number> easeLinearity? ) + thisRun an animation of a given element to a new position, optionally setting duration in seconds (0.25 by default) and easing linearity factor (3rd argument of the cubic bezier curve, 0.5 by default)
@@ -5094,35 +5204,6 @@ fx.run({left: '300px', top: '500px'}); -

Methods

- - - - - - - - - - - - - -
MethodReturnsDescription
run( - <Object> properties ) - thisRun the animation with the given set of properties and their end values.
- -

Transition Properties

- -

An object literal of the following form:

- -
{
-	'<style-property-1>': '<value-1>',
-	'<style-property-2>': '<value-2>'
-	// ...
-}
- -

L.Draggable

@@ -5208,7 +5289,7 @@ draggable.enable(); -

Static Properties

+ @@ -5573,7 +5654,7 @@ map.addControl(new MyControl()); L.CRS.Simple - A simple CRS that maps longitude and latitude into x and y directly. May be used for maps of flat surfaces (e.g. game maps). + A simple CRS that maps longitude and latitude into x and y directly. May be used for maps of flat surfaces (e.g. game maps). Note that the y axis should still be inverted (going from bottom to top). @@ -5598,7 +5679,7 @@ map.addControl(new MyControl()); L_NO_TOUCH - Forces Leaflet to not use touch events even if it detects them. Particularly useful if you embed Leaflet inside a QT WebView (which exposes touch events even on desktop PCs). + Forces Leaflet to not use touch events even if it detects them. L_DISABLE_3D @@ -5622,4 +5703,4 @@ var Leaflet = L.noConflict();

A constant that represents the Leaflet version in use.

-

L.version // returns "0.4" (or whatever version is currently in use)
+
L.version // returns "0.5" (or whatever version is currently in use)