diff --git a/reference.html b/reference.html index 369827b9..94bf9e5f 100644 --- a/reference.html +++ b/reference.html @@ -72,7 +72,6 @@ bodyclass: api-page

Controls

Utility

-

Interfaces

+

Base Classes

Misc

@@ -188,7 +186,7 @@ var map = L.map('map', { layers - ILayer[] + ILayer[] null Layers that will be added to the map initially. @@ -212,7 +210,7 @@ var map = L.map('map', { crs - CRS + CRS L.CRS.
EPSG3857
Coordinate Reference System to use. Don't change this if you're not sure what it means. @@ -807,7 +805,7 @@ var map = L.map('map', { addLayer( - <ILayer> layer, + <ILayer> layer this @@ -815,7 +813,7 @@ var map = L.map('map', { removeLayer( - <ILayer> layer ) + <ILayer> layer ) this @@ -823,7 +821,7 @@ var map = L.map('map', { hasLayer( - <ILayer> layer ) + <ILayer> layer ) Boolean @@ -869,7 +867,7 @@ var map = L.map('map', { addControl( - <IControl> control ) + <IControl> control ) this @@ -877,7 +875,7 @@ var map = L.map('map', { removeControl( - <IControl> control ) + <IControl> control ) this @@ -1188,7 +1186,7 @@ var map = L.map('map', {

Properties

-

Map properties include interaction handlers that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging or touch zoom (see IHandler methods). Example:

+

Map properties include interaction handlers that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging or touch zoom (see IHandler methods). Example:

map.doubleClickZoom.disable();
@@ -1204,37 +1202,37 @@ var map = L.map('map', { dragging - IHandler + IHandler Map dragging handler (by both mouse and touch). touchZoom - IHandler + IHandler Touch zoom handler. doubleClickZoom - IHandler + IHandler Double click zoom handler. scrollWheelZoom - IHandler + IHandler Scroll wheel zoom handler. boxZoom - IHandler + IHandler Box (shift-drag with mouse) zoom handler. keyboard - IHandler + IHandler Keyboard navigation handler. tap - IHandler + IHandler Mobile touch hacks (quick tap and touch hold) handler. @@ -1585,7 +1583,7 @@ var map = L.map('map', {

Interaction handlers

-

Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see IHandler methods). Example:

+

Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see IHandler methods). Example:

marker.dragging.disable();
@@ -1597,7 +1595,7 @@ var map = L.map('map', { dragging - IHandler + IHandler Marker dragging handler (by both mouse and touch). @@ -1629,7 +1627,7 @@ var map = L.map('map', { L.popup( <Popup options> options?, - <ILayer> source? ) + <ILayer> source? ) @@ -1792,7 +1790,7 @@ var map = L.map('map', {

TileLayer

-

Used to load and display tile layers on the map, implements ILayer interface.

+

Used to load and display tile layers on the map, implements ILayer interface.

Usage example

@@ -2135,7 +2133,7 @@ var map = L.map('map', { crs - CRS + CRS null Coordinate Reference System to use for the WMS requests, defaults to map CRS. Don't change this if you're not sure what it means. @@ -2239,7 +2237,7 @@ canvasTiles.drawTile = function(canvas, tilePoint, zoom) {

ImageOverlay

-

Used to load and display a single image over specific bounds of the map, implements ILayer interface.

+

Used to load and display a single image over specific bounds of the map, implements ILayer interface.

Usage example

@@ -3076,7 +3074,7 @@ map.fitBounds(bounds);

LayerGroup

-

Used to group several layers and handle them as one. If you add it to the map, any layers added or removed from the group will be added/removed on the map as well. Implements ILayer interface.

+

Used to group several layers and handle them as one. If you add it to the map, any layers added or removed from the group will be added/removed on the map as well. Implements ILayer interface.

L.layerGroup([marker1, marker2])
 	.addLayer(polyline)
@@ -3090,8 +3088,8 @@ map.fitBounds(bounds);
Description - L.layerGroup( - <ILayer[]> layers? ) + L.LayerGroup( + <ILayer[]> layers? ) @@ -3117,7 +3115,7 @@ map.fitBounds(bounds); addLayer( - <ILayer> layer ) + <ILayer> layer ) this @@ -3125,7 +3123,7 @@ map.fitBounds(bounds); removeLayer( - <ILayer> layer ) + <ILayer> layer ) this @@ -3141,7 +3139,7 @@ map.fitBounds(bounds); hasLayer( - <ILayer> layer ) + <ILayer> layer ) Boolean @@ -3152,7 +3150,7 @@ map.fitBounds(bounds); <String> id ) - ILayer + ILayer Returns the layer with the given id. @@ -3188,7 +3186,7 @@ map.fitBounds(bounds);

FeatureGroup

-

Extended layerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements ILayer interface.

+

Extended layerGroup that also has mouse events (propagated from members of the group) and a shared bindPopup method. Implements ILayer interface.

L.featureGroup([marker1, marker2, polyline])
 	.bindPopup('Hello world!')
@@ -3205,7 +3203,7 @@ map.fitBounds(bounds);
L.featureGroup( - <ILayer[]> layers? ) + <ILayer[]> layers? ) @@ -3367,7 +3365,7 @@ map.fitBounds(bounds); onEachFeature( <GeoJSON> featureData, - <ILayer> layer ) + <ILayer> layer ) Function that will be called on each created feature layer. Useful for attaching events and popups to features. @@ -3375,7 +3373,7 @@ map.fitBounds(bounds); filter( <GeoJSON> featureData, - <ILayer> layer ) + <ILayer> layer ) Function that will be used to decide whether to show a feature or not. @@ -3439,7 +3437,7 @@ map.fitBounds(bounds); <Function> pointToLayer? ) - ILayer + ILayer Creates a layer from a given GeoJSON feature. @@ -4169,122 +4167,6 @@ L.marker([50.505, 30.57], {icon: myIcon}).addTo(map); - - - -

Control

- -

The base class for all Leaflet controls. Implements IControl interface. You can add controls to the map like this:

- -
control.addTo(map);
-// the same as
-map.addControl(control);
- -

Creation

- - - - - - - - - - - - - -
FactoryDescription
L.control( - <Control options> options? ) - Creates a control with the given options.
- -

Options

- - - - - - - - - - - - - -
OptionTypeDefaultDescription
positionString'topright'The initial position of the control (one of the map corners). See control positions.
- -

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
setPosition( - <String> position ) - thisSets the position of the control. See control positions.
getPosition()StringReturns the current position of the control.
addTo( - <Map> map ) - thisAdds the control to the map.
removeFrom( - <Map> map ) - thisRemoves the control from the map.
getContainer()HTMLElementReturns the HTML container of the control.
- -

Control Positions

- -

Control positions (map corner to put a control to) are set using strings. Margins between controls and the map border are set with CSS, so that you can easily override them.

- - - - - - - - - - - - - - - - - - - - - - -
PositionDescription
'topleft'Top left of the map.
'topright'Top right of the map.
'bottomleft'Bottom left of the map.
'bottomright'Bottom right of the map.
- -

Control.zoom

A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its zoomControl option to false. Extends Control.

@@ -4465,7 +4347,7 @@ L.control.layers(baseLayers, overlays).addTo(map); addBaseLayer( - <ILayer> layer, + <ILayer> layer, <String> name ) this @@ -4473,7 +4355,7 @@ L.control.layers(baseLayers, overlays).addTo(map); addOverlay( - <ILayer> layer, + <ILayer> layer, <String> name ) this @@ -4481,7 +4363,7 @@ L.control.layers(baseLayers, overlays).addTo(map); removeLayer( - <ILayer> layer ) + <ILayer> layer ) this Remove the given layer from the control. @@ -4891,7 +4773,7 @@ map.off('click', onClick); layer - ILayer + ILayer The layer that was added or removed. @@ -4906,7 +4788,7 @@ map.off('click', onClick); layer - ILayer + ILayer The layer that was added or removed. @@ -4961,7 +4843,7 @@ map.off('click', onClick); layer - ILayer + ILayer The layer for the GeoJSON feature that is being added to the map. @@ -5014,264 +4896,6 @@ map.off('click', onClick); - - -

Class

- -

L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.

-

In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.

- -
var MyClass = L.Class.extend({
-	initialize: function (greeter) {
-		this.greeter = greeter;
-		// class constructor
-	},
-
-	greet: function (name) {
-		alert(this.greeter + ', ' + name)
-	}
-});
-
-// create instance of MyClass, passing "Hello" to the constructor
-var a = new MyClass("Hello");
-
-// call greet method, alerting "Hello, World"
-a.greet("World");
-
- -

The initialize method is your class's constructor function, meaning that it gets called when you do new MyClass(...).

- - -

Class Factories

- -

You may have noticed that Leaflet objects are created without using the new keyword. This is achieved by complementing each class with a lowercase factory method:

- -
new L.Map('map'); // becomes:
-L.map('map');
- -

The factories are implemented very easily, and you can do this for your own classes:

- -
L.map = function (id, options) {
-	return new L.Map(id, options);
-};
- - -

Inheritance

- -

You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:

- -
var MyChildClass = MyClass.extend({
-	// ... new properties and methods
-});
- -

This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:

- -
var a = new MyChildClass();
-a instanceof MyChildClass; // true
-a instanceof MyClass; // true
-
- -

You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:

- -
var MyChildClass = MyClass.extend({
-	initialize: function () {
-		MyClass.prototype.initialize.call(this, "Yo");
-	},
-
-	greet: function (name) {
-		MyClass.prototype.greet.call(this, 'bro ' + name + '!');
-	}
-});
-
-var a = new MyChildClass();
-a.greet('Jason'); // alerts "Yo, bro Jason!"
- -

Options

- -

options is a special property that unlike other objects that you pass to extend will be merged with the parent one instead of overriding it completely, which makes managing configuration of objects and default values convenient:

- -
var MyClass = L.Class.extend({
-	options: {
-		myOption1: 'foo',
-		myOption2: 'bar'
-	}
-});
-
-var MyChildClass = MyClass.extend({
-	options: {
-		myOption1: 'baz',
-		myOption3: 5
-	}
-});
-
-var a = new MyChildClass();
-a.options.myOption1; // 'baz'
-a.options.myOption2; // 'bar'
-a.options.myOption3; // 5
- -

There's also L.Util.setOptions, a method for conveniently merging options passed to constructor with the defaults defined in the class:

- -
var MyClass = L.Class.extend({
-	options: {
-		foo: 'bar',
-		bla: 5
-	},
-
-	initialize: function (options) {
-		L.Util.setOptions(this, options);
-		...
-	}
-});
-
-var a = new MyClass({bla: 10});
-a.options; // {foo: 'bar', bla: 10}
- -

Includes

- -

includes is a special class property that merges all specified objects into the class (such objects are called mixins). - -

 var MyMixin = {
-	foo: function () { ... },
-	bar: 5
-};
-
-var MyClass = L.Class.extend({
-	includes: MyMixin
-});
-
-var a = new MyClass();
-a.foo();
- -

You can also do such includes in runtime with the include method:

- -
MyClass.include(MyMixin);
- -

Statics

- -

statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:

- -
var MyClass = L.Class.extend({
-	statics: {
-		FOO: 'bar',
-		BLA: 5
-	}
-});
-
-MyClass.FOO; // 'bar'
- - -

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, …);
- -

Evented

- -

When creating a plugin you may want your code to have access to the event methods. By extending the Evented class you can create a class which inherits event-related methods like on, off and fire

- -
MyEventedClass = L.Evented.extend({
-	fire: function(){
-		this.fire('custom', {
-			// you can attach optional data to an event as an object
-		});
-	}
-});
-
-var myEvents = new MyEventedClass();
-
-myEvents.on('custom', function(e){
-	// e.type will  be 'custom'
-	// anything else you passed in the
-});
-
-myEvents.fire();
- -You can still use the old-style `L.Mixin.Events` for backward compatibility. - -
// this class will include all event methods
-MyEventedClass = L.Class.extend({
-	includes: L.Mixin.Events
-});
- -

Layer

- -

When implementing a custom layer the L.Layer class can be extended to implementing basic functionality that all layers need to share, these methods can be used when extending L.Layer when implementing custom layers.

- -

Options

- - - - - - - - - - - - - - -
OptionTypeDefault valueDescription
paneString'overlayPane'By default the layer will be added to the maps overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
- -

Events

- - - - - - - - - - - - - - - - - -
EventDataDescription
addEventFired after the layer is added to a map.
removeEventFired after the layer is removed from a map.
- -

Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
addTo(<Map> map)thisAdds the layer to the given map.
removeFrom(<Map> map)thisRemoves the layer to the given map.
remove()thisRemoves the layer from the map it is currently active on.
getPane(<String> name?)HTMLElementReturns the HTMLElement representing the named pane on the map. Or if name is omitted the pane for this layer.
-

Browser

A namespace with properties for browser/feature detection used by Leaflet internally.

@@ -5392,6 +5016,7 @@ MyEventedClass = L.Class.extend({ Function + 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. Not a polyfill for ES 5 bind (compare L.bind to the MDN-recommended polyfill for Function.prototype.bind). @@ -6078,64 +5703,192 @@ draggable.enable(); --> +

Class

+ +

L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.

+

In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.

+ +
var MyClass = L.Class.extend({
+	initialize: function (greeter) {
+		this.greeter = greeter;
+		// class constructor
+	},
+
+	greet: function (name) {
+		alert(this.greeter + ', ' + name)
+	}
+});
+
+// create instance of MyClass, passing "Hello" to the constructor
+var a = new MyClass("Hello");
+
+// call greet method, alerting "Hello, World"
+a.greet("World");
+
-

IHandler

-

An interface implemented by interaction handlers.

+

Class Factories

- - - - - - - - - - - - - - - - - - - - - -
MethodReturnsDescription
enable()-Enables the handler.
disable()-Disables the handler.
enabled()BooleanReturns true if the handler is enabled.
+

You may have noticed that Leaflet objects are created without using the new keyword. This is achieved by complementing each class with a lowercase factory method:

+ +
new L.Map('map'); // becomes:
+L.map('map');
+ +

The factories are implemented very easily, and you can do this for your own classes:

+ +
L.map = function (id, options) {
+	return new L.Map(id, options);
+};
-

ILayer

+

Inheritance

-

Represents an object attached to a particular location (or a set of locations) on a map. Extends the L.Layer base class and is implemented by tile layers, markers, popups, image overlays, vector layers and layer groups.

+

You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:

-

Methods

+
var MyChildClass = MyClass.extend({
+	// ... new properties and methods
+});
- - - - - - - - +

This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:

- - - - - +
var a = new MyChildClass();
+a instanceof MyChildClass; // true
+a instanceof MyClass; // true
+
- - - -
MethodReturnsDescription
onAdd( - <Map> map ) - -Should contain code that creates DOM elements for the overlay, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).
onRemove( - <Map> map ) - -Should contain all clean up code that removes the overlay's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).
+

You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:

+ +
var MyChildClass = MyClass.extend({
+	initialize: function () {
+		MyClass.prototype.initialize.call("Yo");
+	},
+
+	greet: function (name) {
+		MyClass.prototype.greet.call(this, 'bro ' + name + '!');
+	}
+});
+
+var a = new MyChildClass();
+a.greet('Jason'); // alerts "Yo, bro Jason!"
+ +

Options

+ +

options is a special property that unlike other objects that you pass to extend will be merged with the parent one instead of overriding it completely, which makes managing configuration of objects and default values convenient:

+ +
var MyClass = L.Class.extend({
+	options: {
+		myOption1: 'foo',
+		myOption2: 'bar'
+	}
+});
+
+var MyChildClass = L.Class.extend({
+	options: {
+		myOption1: 'baz',
+		myOption3: 5
+	}
+});
+
+var a = new MyChildClass();
+a.options.myOption1; // 'baz'
+a.options.myOption2; // 'bar'
+a.options.myOption3; // 5
+ +

There's also L.Util.setOptions, a method for conveniently merging options passed to constructor with the defauls defines in the class:

+ +
var MyClass = L.Class.extend({
+	options: {
+		foo: 'bar',
+		bla: 5
+	},
+
+	initialize: function (options) {
+		L.Util.setOptions(this, options);
+		...
+	}
+});
+
+var a = new MyClass({bla: 10});
+a.options; // {foo: 'bar', bla: 10}
+ +

Includes

+ +

includes is a special class property that merges all specified objects into the class (such objects are called mixins). + +

 var MyMixin = {
+	foo: function () { ... },
+	bar: 5
+};
+
+var MyClass = L.Class.extend({
+	includes: MyMixin
+});
+
+var a = new MyClass();
+a.foo();
+ +

You can also do such includes in runtime with the include method:

+ +
MyClass.include(MyMixin);
+ +

Statics

+ +

statics is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:

+ +
var MyClass = L.Class.extend({
+	statics: {
+		FOO: 'bar',
+		BLA: 5
+	}
+});
+
+MyClass.FOO; // 'bar'
+ + +

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, …);
+ +

Evented

+ +

When creating a plugin you may want your code to have access to the event methods. By extending the Evented class you can create a class which inherits event-related methods like on, off and fire

+ +
MyEventedClass = L.Evented.extend({
+	fire: function(){
+		this.fire('custom', {
+			// you can attach optional data to an event as an object
+		});
+	}
+});
+
+var myEvents = new MyEventedClass();
+
+myEvents.on('custom', function(e){
+	// e.type will  be 'custom'
+	// anything else you passed in the
+});
+
+myEvents.fire();
+ +You can still use the old-style `L.Mixin.Events` for backward compatibility. + +
// this class will include all event methods
+MyEventedClass = L.Class.extend({
+	includes: L.Mixin.Events
+});
+ +

Layer

+ +

The base class for all Leaflet layers that impliments basic shared methods and functionality. Can be extended to create custom layers by extending L.Layer and implimenting the onAdd and onRemove methods.

Implementing Custom Layers

@@ -6147,6 +5900,33 @@ draggable.enable();

Another thing to note is that you'll usually need to add leaflet-zoom-hide class to the DOM elements you create for the layer so that it hides during zoom animation. Implementing zoom animation for custom layers is a complex topic and will be documented separately in future, but meanwhile you can take a look at how it's done for Leaflet layers (e.g. ImageOverlay) in the source.

+

Methods

+ +

Every layer should extend from L.Layer and impliment the following methods:

+ + + + + + + + + + + + + + + + + + + + + + +
MethodReturnsDescription
onAdd(<Map> map)thisShould contain code that creates DOM elements for the overlay, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).
onRemove(<Map> map)thisShould contain all clean up code that removes the overlay's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).
getEvents()ObjectThis optional method should return an object like { viewreset: this._reset }for addEventListener. These events will be automatically added and removed from the map with your layer.
+

Custom Layer Example

Here's how a custom layer implementation usually looks:

@@ -6176,7 +5956,7 @@ draggable.enable(); onRemove: function (map) { // remove layer's DOM elements and listeners - this.getPane().overlayPane.removeChild(this._el); + this.getPane().removeChild(this._el); }, _reset: function () { @@ -6189,9 +5969,82 @@ draggable.enable(); var myLayer = new MyCustomLayer(latlng).addTo(map); -

IControl

+

Inherited Options

-

Represents a UI element in one of the corners of the map. Implemented by zoom, attribution, scale and layers controls.

+

Classes extending from L.Layer will also inherit the following options:

+ + + + + + + + + + + + + + +
OptionTypeDefault valueDescription
paneString'overlayPane'By default the layer will be added to the maps overlay pane. Overriding this option will cause the layer to be placed on another pane by default.
+ +

Inherited Events

+ +

Classes extending from L.Layer will also fire the following events:

+ + + + + + + + + + + + + + + + + +
EventDataDescription
addEventFired after the layer is added to a map.
removeEventFired after the layer is removed from a map.
+ +

Inherited Methods

+ +

Classes extending from L.Layer will also inherit the following methods:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodReturnsDescription
addTo(<Map> map)thisAdds the layer to the given map.
removeFrom(<Map> map)thisRemoves the layer to the given map.
remove()thisRemoves the layer from the map it is currently active on.
getPane(<String> name?)HTMLElementReturns the HTMLElement representing the named pane on the map. Or if name is omitted the pane for this layer.
+ +

Control

+ +

Controls represents a UI element in one of the corners of the map. Implemented by zoom, attribution, scale and layers controls. Can be used to create custom controls by extending L.Control and implimenting the onAdd and onRemove methods.

Methods

@@ -6255,16 +6108,132 @@ map.addControl(new MyControl());
map.addControl(new MyControl('bar', {position: 'bottomleft'}));
+

Options

+ +

Classes extending from L.Control will also inherit the following options:

+ + + + + + + + + + + + + + +
OptionTypeDefaultDescription
positionString'topright'The initial position of the control (one of the map corners). See control positions.
+ +

Inherited Methods

+ +

Classes extending from L.Control will also inherit the following methods:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodReturnsDescription
setPosition( + <String> position ) + thisSets the position of the control. See control positions.
getPosition()StringReturns the current position of the control.
addTo( + <Map> map ) + thisAdds the control to the map.
removeFrom( + <Map> map ) + thisRemoves the control from the map.
getContainer()HTMLElementReturns the HTML container of the control.
+ +

Control Positions

+ +

Control positions (map corner to put a control to) are set using strings. Margins between controls and the map border are set with CSS, so that you can easily override them.

+ + + + + + + + + + + + + + + + + + + + + + +
PositionDescription
'topleft'Top left of the map.
'topright'Top right of the map.
'bottomleft'Bottom left of the map.
'bottomright'Bottom right of the map.
+

Handler

+

An interface implemented by interaction handlers.

-

IProjection

+ + + + + + + + + + + + + + + + + + + + + +
MethodReturnsDescription
enable()-Enables the handler.
disable()-Disables the handler.
enabled()BooleanReturns true if the handler is enabled.
+ +

Projection

An object with methods for projecting geographical coordinates of the world onto a flat surface (and back). See Map projection.

Methods

- +
@@ -6317,13 +6286,13 @@ map.addControl(new MyControl()); -

ICRS

+

CRS

Defines coordinate reference systems for projecting geographical points into pixel (screen) coordinates and back (and to coordinates in other units for WMS services). See Spatial reference system.

Methods

-
Method Returns
+
@@ -6375,7 +6344,7 @@ map.addControl(new MyControl());

Properties

-
Method Returns
+
@@ -6384,7 +6353,7 @@ map.addControl(new MyControl()); - +
Property Type
projectionIProjectionIProjection Projection that this CRS uses.