|
@@ -12,8 +12,8 @@ Creates a new Leaflet Control for comparing two layers or collections of layers.
|
12
|
12
|
|
13
|
13
|
| parameter | type | description |
|
14
|
14
|
| ---------- | -------------- | ------------- |
|
15
|
|
-| `leftLayers` | L.Layer\|array | A Leaflet Layer or array of layers to show on the left side of the map. Any layers in this array that are added to the map will be shown on the left |
|
16
|
|
-| `rightLayers` | L.Layer\|array | A Leaflet Layer or array of layers to show on the right side of the map. Any layers in this array that are added to the map will be shown on the right. These *should not be the same as any layers in `leftLayers`* |
|
|
15
|
+| `leftLayers` | L.Layer\|array | A Leaflet Layer or array of layers to show on the left side of the map. Any layer added to the map that is in this array will be shown on the left |
|
|
16
|
+| `rightLayers` | L.Layer\|array | A Leaflet Layer or array of layers to show on the right side of the map. Any layer added to the map that is in this array will be shown on the right. These *should not be* the same as any layers in `leftLayers` |
|
17
|
17
|
|
18
|
18
|
### Events
|
19
|
19
|
|
|
@@ -27,6 +27,13 @@ Subscribe to events using [these methods](http://leafletjs.com/reference.html#ev
|
27
|
27
|
| `rightlayerremove` | [LayerEvent](http://leafletjs.com/reference.html#layer-event) | You guessed it... fired when a layer is removed from the right-hand-side pane |
|
28
|
28
|
| `dividermove` | {x: Number} | Fired when the divider is moved. Returns an event object with the property `x` = the pixels of the divider from the left side of the map container. |
|
29
|
29
|
|
|
30
|
+### Methods
|
|
31
|
+
|
|
32
|
+| Method | Returns | Description |
|
|
33
|
+| ---------- | -------------- | ------------- |
|
|
34
|
+| `setLeftLayers` | `this` | Set the layer(s) for the left side |
|
|
35
|
+| `setRightLayers` | `this` | Set the layer(s) for the right side |
|
|
36
|
+
|
30
|
37
|
### Usage
|
31
|
38
|
|
32
|
39
|
Add the script to the top of your page (css is included in the javascript):
|