Skip to content

Commit f9761db

Browse files
committed
Move to webpack for example, rename to splitmap
1 parent 290b448 commit f9761db

14 files changed

Lines changed: 10614 additions & 77 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules/
2+
dist/

.npmignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
leaflet-side-by-side.js
2-
leaflet-side-by-side.min.js
1+
leaflet-splitmap.js
32
screencast.gif

CHANGELOG.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,27 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6-
## Unreleased
6+
## [leaflet-splitmap]
77

88
- ADDED: Allows Leaflet version 0.7.7 through 1.x
99

10-
## [v2.0.0] - 2015-12-08
10+
## [leaflet-side-by-side v2.0.0] - 2015-12-08
1111

1212
- ADDED: Add `setLeftLayers()` and `setRightLayers()` methods
1313
- ADDED: `options.padding`
1414
- ADDED: `getPosition()` returns the x coordinate (relative to the map container) of the divider
1515
- FIXED: **[BREAKING]** Export factory function on `L.control` not `L.Control`
1616
- FIXED: Slider drag was not working on touch devices
1717

18-
## [v1.1.1] - 2015-12-03
18+
## [leaflet-side-by-side v1.1.1] - 2015-12-03
1919

2020
- FIXED: fix package.json settings for npm distribution
2121

22-
## [v1.1.0] - 2015-12-03
22+
## [leaflet-side-by-side v1.1.0] - 2015-12-03
2323

2424
- ADDED: Events
2525
- FIXED: Fix initial divider position in Firefox, should start in middle of map
2626

27-
## v1.0.2 - 2015-12-02
27+
## [leaflet-side-by-side] v1.0.2 - 2015-12-02
2828

2929
Initial release
30-
31-
[Unreleased]: https://github.com/digidem/leaflet-side-by-side/compare/v2.0.0...HEAD
32-
[Unreleased]: https://github.com/digidem/leaflet-side-by-side/compare/v1.1.1...v2.0.0
33-
[v1.1.1]: https://github.com/digidem/leaflet-side-by-side/compare/v1.1.0...v1.1.1
34-
[v1.1.0]: https://github.com/digidem/leaflet-side-by-side/compare/v1.0.2...v1.1.0

README.md

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# leaflet-side-by-side
1+
# leaflet-splitmap
22

33
A Leaflet control to add a split screen to compare two map overlays.
44

5+
**This project is a fork of the leaflet-side-by-side plugin**
6+
57
![screencast example](screencast.gif)
68

79
### L.control.sideBySide(_leftLayer[s]_, _rightLayer[s]_)
@@ -36,32 +38,6 @@ Subscribe to events using [these methods](http://leafletjs.com/reference.html#ev
3638
| `setLeftLayers` | `this` | Set the layer(s) for the left side |
3739
| `setRightLayers` | `this` | Set the layer(s) for the right side |
3840

39-
### Usage
40-
41-
Add the script to the top of your page (css is included in the javascript):
42-
43-
```html
44-
<script src="leaflet-side-by-side.js"></script>
45-
```
46-
47-
Or if you are using browserify:
48-
49-
```js
50-
var sideBySide = require('leaflet-side-by-side')
51-
```
52-
53-
Then create a map, add two layers to it, and create the SideBySide control and add it to the map:
54-
55-
```js
56-
var map = L.map('map').setView([51.505, -0.09], 13);
57-
58-
var myLayer1 = L.tileLayer(...).addTo(map);
59-
60-
var myLayer2 = L.tileLayer(...).addTo(map)
61-
62-
L.control.sideBySide(myLayer1, myLayer2).addTo(map);
63-
```
64-
6541
### Example
6642

6743
[Live Example](http://lab.digital-democracy.org/leaflet-side-by-side/) see [source](index.html)

index.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
<head>
44
<meta charset=utf-8 />
55
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui' />
6-
<title>Leaflet Side-by-side</title>
7-
<script src='http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet-src.js'></script>
8-
<script src="leaflet-side-by-side.js"></script>
9-
<link href='http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css' rel='stylesheet' />
6+
<title>Leaflet SplitMap</title>
7+
<link rel="stylesheet" type="text/css" href='https://unpkg.com/leaflet@1.3.1/dist/leaflet.css'></link>
8+
<script src="dist/leaflet-splitmap.js"></script>
109
<style>
1110
body {
1211
margin: 0;
@@ -40,7 +39,7 @@
4039
maxZoom: 16
4140
}).addTo(map)
4241

43-
L.control.sideBySide(stamenLayer, osmLayer).addTo(map);
42+
L.control.splitMap(stamenLayer, osmLayer).addTo(map);
4443
</script>
4544
</body>
4645
</html>

leaflet-side-by-side.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)