Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21fd7c8bd3 | ||
|
|
df8851fc8b | ||
|
|
5ca0430872 | ||
|
|
e985eb6cba | ||
|
|
6203fdc45d | ||
|
|
383bff4d6d | ||
|
|
396651d6be | ||
|
|
37efd85ad1 | ||
|
|
0dbb9424e2 | ||
|
|
aab101e58e | ||
|
|
337a1c7458 | ||
|
|
86faf4dd48 | ||
|
|
9f2d5d94dc | ||
|
|
5364c0f15e | ||
|
|
4212248b27 | ||
|
|
90a08c29ef | ||
|
|
0cd3b761a8 | ||
|
|
9ec5bbd3e6 | ||
|
|
7c1ebcb15d | ||
|
|
052ac6df07 | ||
|
|
1b410ee3fd | ||
|
|
f181b4efab | ||
|
|
67d2a40846 | ||
|
|
1a77d7b36a | ||
|
|
623fc7452b | ||
|
|
54feda21cd | ||
|
|
6e7cd514c1 | ||
|
|
8a15b79623 | ||
|
|
9c3618a521 | ||
|
|
471e89c789 | ||
|
|
0c35742117 | ||
|
|
a5cfd435fe | ||
|
|
461ac3544c | ||
|
|
b49da13abe |
37
README.md
@@ -12,14 +12,16 @@ Contao CMS.
|
|||||||
|
|
||||||
This package contains following packages:
|
This package contains following packages:
|
||||||
|
|
||||||
- [leaflet 0.7.5](http://leafletjs.com)
|
- [leaflet 1.0.3](http://leafletjs.com)
|
||||||
- [Leaflet-providers 1.0.12](http://leaflet-extras.github.io/leaflet-providers)
|
- [Leaflet-providers 1.1.15](http://leaflet-extras.github.io/leaflet-providers)
|
||||||
- [Leaflet.markercluster 0.4.0](https://github.com/Leaflet/Leaflet.markercluster)
|
- [Leaflet.markercluster 1.0.2](https://github.com/Leaflet/Leaflet.markercluster)
|
||||||
- [Leaflet-omnivore 0.3.2](https://github.com/mapbox/leaflet-omnivore)
|
- [Leaflet-omnivore 0.3.4](https://github.com/mapbox/leaflet-omnivore)
|
||||||
- [Leaflet.loading 0.1.15](https://github.com/ebrelsford/Leaflet.loading)
|
- [Leaflet.loading 0.1.24](https://github.com/ebrelsford/Leaflet.loading)
|
||||||
- [Leaflet.Control.FullScreen 1.1.4](https://github.com/brunob/leaflet.fullscreen)
|
- [Leaflet.Control.FullScreen 1.4.2](https://github.com/brunob/leaflet.fullscreen)
|
||||||
- [Leaflet Control Geocoder 1.0.0](https://github.com/perliedman/leaflet-control-geocoder)
|
- [Leaflet Control Geocoder 1.5.4](https://github.com/perliedman/leaflet-control-geocoder)
|
||||||
- [spin.js 2.0.2](http://fgnass.github.io/spin.js)
|
- [Leaflet.ExtraMarkers 1.0.6](https://github.com/coryasilva/Leaflet.ExtraMarkers)
|
||||||
|
- [osmtogeojson 2.2.12](https://github.com/tyrasd/osmtogeojson)
|
||||||
|
- [spin.js 2.3.2](http://fgnass.github.io/spin.js)
|
||||||
|
|
||||||
|
|
||||||
Install
|
Install
|
||||||
@@ -28,12 +30,23 @@ Install
|
|||||||
You can install this package via composer.
|
You can install this package via composer.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ php composer.phar require netzmacht/contao-leaflet-libraries:~0.7
|
$ php composer.phar require netzmacht/contao-leaflet-libraries:~1.0
|
||||||
```
|
```
|
||||||
|
|
||||||
When releasing the first stable version of
|
If you use Contao 4 without the managed edition, you also have to register the module as a bundle.
|
||||||
[netzmacht/contao-leaflet-maps](https://github.com/netzmacht/contao-leaflet-maps) the version number gonna be the same
|
|
||||||
as the included leaflet library.
|
```php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Dependency is automatically installed and has to be registered
|
||||||
|
new Contao\CoreBundle\HttpKernel\Bundle\ContaoModuleBundle('leaflet-libs', $this->getRootDir()),
|
||||||
|
```
|
||||||
|
|
||||||
|
Version numbers
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Each release has is tagged with the main leaflet version which is shipped with this bundle. For any bugfix release which
|
||||||
|
is created without shipping a newer version of leaflet, this package uses four parts of the version number.
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|||||||
@@ -1,64 +1,67 @@
|
|||||||
.leaflet-control-geocoder {
|
.leaflet-control-geocoder {
|
||||||
|
border-radius: 4px;
|
||||||
background: white;
|
background: white;
|
||||||
box-shadow: 0 1px 7px rgba(0,0,0,0.65);
|
min-width: 26px;
|
||||||
-webkit-border-radius: 4px;
|
min-height: 26px;
|
||||||
border-radius: 4px;
|
|
||||||
line-height: 26px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-touch .leaflet-control-geocoder {
|
.leaflet-touch .leaflet-control-geocoder {
|
||||||
box-shadow: none;
|
min-width: 30px;
|
||||||
border: 2px solid rgba(0,0,0,0.2);
|
min-height: 30px;
|
||||||
background-clip: padding-box;
|
}
|
||||||
line-height: 30px;
|
|
||||||
|
.leaflet-control-geocoder a, .leaflet-control-geocoder .leaflet-control-geocoder-icon {
|
||||||
|
border-bottom: none;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-control-geocoder .leaflet-control-geocoder-alternatives a {
|
||||||
|
width: inherit;
|
||||||
|
height: inherit;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-control-geocoder a:hover, .leaflet-control-geocoder .leaflet-control-geocoder-icon:hover {
|
||||||
|
border-bottom: none;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-geocoder-form {
|
.leaflet-control-geocoder-form {
|
||||||
display: inline;
|
display: none;
|
||||||
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
.leaflet-control-geocoder-expanded .leaflet-control-geocoder-form {
|
||||||
.leaflet-control-geocoder-form input, .leaflet-control-geocoder-form ul, .leaflet-control-geocoder-error {
|
display: inline-block;
|
||||||
border: 0;
|
|
||||||
color: transparent;
|
|
||||||
background: white;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-geocoder-form input {
|
.leaflet-control-geocoder-form input {
|
||||||
font-size: 16px;
|
font-size: 120%;
|
||||||
width: 0;
|
border: 0;
|
||||||
transition: width 0.125s ease-in;
|
background-color: transparent;
|
||||||
}
|
width: 246px;
|
||||||
|
|
||||||
.leaflet-touch .leaflet-control-geocoder-form input {
|
|
||||||
font-size: 22px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-geocoder-icon {
|
.leaflet-control-geocoder-icon {
|
||||||
|
border-radius: 4px;
|
||||||
width: 26px;
|
width: 26px;
|
||||||
height: 26px;
|
height: 26px;
|
||||||
|
border: none;
|
||||||
|
background-color: white;
|
||||||
background-image: url(images/geocoder.png);
|
background-image: url(images/geocoder.png);
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
float: right;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-touch .leaflet-control-geocoder-icon {
|
.leaflet-touch .leaflet-control-geocoder-icon {
|
||||||
margin-top: 2px;
|
|
||||||
width: 30px;
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-geocoder-throbber .leaflet-control-geocoder-icon {
|
.leaflet-control-geocoder-throbber .leaflet-control-geocoder-icon {
|
||||||
background-image: url(images/throbber.gif);
|
background-image: url(images/throbber.gif);
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-geocoder-expanded input, .leaflet-control-geocoder-error {
|
.leaflet-control-geocoder-form-no-error {
|
||||||
width: 226px;
|
display: none;
|
||||||
margin: 0 0 0 4px;
|
|
||||||
padding: 0 0 0 4px;
|
|
||||||
vertical-align: middle;
|
|
||||||
color: #000;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-geocoder-form input:focus {
|
.leaflet-control-geocoder-form input:focus {
|
||||||
@@ -68,73 +71,52 @@
|
|||||||
.leaflet-control-geocoder-form button {
|
.leaflet-control-geocoder-form button {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-geocoder-form-no-error {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaflet-control-geocoder-error {
|
.leaflet-control-geocoder-error {
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
|
margin-left: 8px;
|
||||||
display: block;
|
display: block;
|
||||||
color: #444;
|
color: #444;
|
||||||
}
|
}
|
||||||
|
.leaflet-control-geocoder-alternatives {
|
||||||
ul.leaflet-control-geocoder-alternatives {
|
display: block;
|
||||||
width: 260px;
|
width: 272px;
|
||||||
overflow: hidden;
|
list-style: none;
|
||||||
text-overflow: ellipsis;
|
padding: 0;
|
||||||
white-space: nowrap;
|
margin: 0;
|
||||||
list-style: none;
|
|
||||||
padding: 0;
|
|
||||||
transition: height 0.125s ease-in;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-geocoder-alternatives-minimized {
|
.leaflet-control-geocoder-alternatives-minimized {
|
||||||
width: 0 !important;
|
display: none;
|
||||||
height: 0;
|
height: 0;
|
||||||
overflow: hidden;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-geocoder-alternatives li {
|
.leaflet-control-geocoder-alternatives li {
|
||||||
width: 100%;
|
white-space: nowrap;
|
||||||
|
display: block;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
padding: 5px 8px;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #ccc;
|
||||||
padding: 0;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.leaflet-control-geocoder-alternatives li a, .leaflet-control-geocoder-alternatives li a:hover {
|
||||||
|
width: inherit;
|
||||||
|
height: inherit;
|
||||||
|
line-height: inherit;
|
||||||
|
background: inherit;
|
||||||
|
border-radius: inherit;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
.leaflet-control-geocoder-alternatives li:last-child {
|
.leaflet-control-geocoder-alternatives li:last-child {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
.leaflet-control-geocoder-alternatives li:hover, .leaflet-control-geocoder-selected {
|
||||||
.leaflet-control-geocoder-alternatives a {
|
background-color: #f5f5f5;
|
||||||
display: block;
|
|
||||||
text-decoration: none;
|
|
||||||
color: black;
|
|
||||||
padding: 6px 8px 16px 6px;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 1;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-touch .leaflet-control-geocoder-alternatives a {
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaflet-control-geocoder-alternatives a:hover, .leaflet-control-geocoder-selected {
|
|
||||||
background-color: #ddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaflet-control-geocoder-address-detail {
|
.leaflet-control-geocoder-address-detail {
|
||||||
font-size: 12px;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-geocoder-address-context {
|
.leaflet-control-geocoder-address-context {
|
||||||
color: #666;
|
color: #666;
|
||||||
font-size: 12px;
|
|
||||||
font-weight: lighter;
|
|
||||||
}
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
.leaflet-control-geocoder{background:#fff;box-shadow:0 1px 7px rgba(0,0,0,.65);-webkit-border-radius:4px;border-radius:4px;line-height:26px;overflow:hidden}.leaflet-touch .leaflet-control-geocoder{box-shadow:none;border:2px solid rgba(0,0,0,.2);background-clip:padding-box;line-height:30px}.leaflet-control-geocoder-form{display:inline}.leaflet-control-geocoder-error,.leaflet-control-geocoder-form input,.leaflet-control-geocoder-form ul{border:0;color:transparent;background:#fff}.leaflet-control-geocoder-form input{font-size:16px;width:0;transition:width .125s ease-in}.leaflet-touch .leaflet-control-geocoder-form input{font-size:22px}.leaflet-control-geocoder-icon{width:26px;height:26px;background-image:url('images/geocoder.png');background-repeat:no-repeat;background-position:center;float:right;cursor:pointer}.leaflet-touch .leaflet-control-geocoder-icon{margin-top:2px;width:30px}.leaflet-control-geocoder-throbber .leaflet-control-geocoder-icon{background-image:url('images/throbber.gif')}.leaflet-control-geocoder-error,.leaflet-control-geocoder-expanded input{width:226px;margin:0 0 0 4px;padding:0 0 0 4px;vertical-align:middle;color:#000}.leaflet-control-geocoder-form input:focus{outline:0}.leaflet-control-geocoder-form button,.leaflet-control-geocoder-form-no-error{display:none}.leaflet-control-geocoder-error{margin-top:8px;display:block;color:#444}ul.leaflet-control-geocoder-alternatives{width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;list-style:none;padding:0;transition:height .125s ease-in}.leaflet-control-geocoder-alternatives-minimized{width:0!important;height:0;overflow:hidden;margin:0;padding:0}.leaflet-control-geocoder-alternatives li{width:100%;overflow:hidden;text-overflow:ellipsis;border-bottom:1px solid #eee;padding:0}.leaflet-control-geocoder-alternatives li:last-child{border-bottom:none}.leaflet-control-geocoder-alternatives a{display:block;text-decoration:none;color:#000;padding:6px 8px 16px 6px;font-size:14px;line-height:1;font-weight:700}.leaflet-touch .leaflet-control-geocoder-alternatives a{font-size:18px}.leaflet-control-geocoder-alternatives a:hover,.leaflet-control-geocoder-selected{background-color:#ddd}.leaflet-control-geocoder-address-detail{font-size:12px;font-weight:400}.leaflet-control-geocoder-address-context{color:#666;font-size:12px;font-weight:lighter}
|
.leaflet-control-geocoder .leaflet-control-geocoder-icon,.leaflet-control-geocoder .leaflet-control-geocoder-icon:hover,.leaflet-control-geocoder a,.leaflet-control-geocoder a:hover{border-bottom:none;display:inline-block}.leaflet-control-geocoder{border-radius:4px;background:#fff;min-width:26px;min-height:26px}.leaflet-touch .leaflet-control-geocoder{min-width:30px;min-height:30px}.leaflet-control-geocoder .leaflet-control-geocoder-alternatives a{width:inherit;height:inherit;line-height:inherit}.leaflet-control-geocoder-form{display:none;vertical-align:middle}.leaflet-control-geocoder-expanded .leaflet-control-geocoder-form{display:inline-block}.leaflet-control-geocoder-form button,.leaflet-control-geocoder-form-no-error{display:none}.leaflet-control-geocoder-form input{font-size:120%;border:0;background-color:transparent;width:246px}.leaflet-control-geocoder-icon{border-radius:4px;width:26px;height:26px;border:none;background-color:#fff;background-image:url('images/geocoder.png');background-repeat:no-repeat;background-position:center}.leaflet-touch .leaflet-control-geocoder-icon{width:30px;height:30px}.leaflet-control-geocoder-throbber .leaflet-control-geocoder-icon{background-image:url('images/throbber.gif')}.leaflet-control-geocoder-form input:focus{outline:0}.leaflet-control-geocoder-error{margin-top:8px;margin-left:8px;display:block;color:#444}.leaflet-control-geocoder-alternatives{display:block;width:272px;list-style:none;padding:0;margin:0}.leaflet-control-geocoder-alternatives-minimized{display:none;height:0}.leaflet-control-geocoder-alternatives li{white-space:nowrap;display:block;overflow:hidden;padding:5px 8px;text-overflow:ellipsis;border-bottom:1px solid #ccc;cursor:pointer}.leaflet-control-geocoder-alternatives li a,.leaflet-control-geocoder-alternatives li a:hover{width:inherit;height:inherit;line-height:inherit;background:inherit;border-radius:inherit;text-align:left}.leaflet-control-geocoder-alternatives li:last-child{border-bottom:none}.leaflet-control-geocoder-alternatives li:hover,.leaflet-control-geocoder-selected{background-color:#f5f5f5}.leaflet-control-geocoder-address-context{color:#666}
|
||||||
46
assets/control-geocoder/README.md
Normal file → Executable file
@@ -6,7 +6,7 @@ I strongly believe that it is my — and your — duty to make the open
|
|||||||
|
|
||||||
While I can't force anyone to do anything, if you happen to disagree with this, I ask of you not to use any of the open source I have published. Nor am I interested in contributions from people who can't accept or act respectfully towards other humans regardless of gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics. If you think feminism, anti-racism or the LGBT movement is somehow wrong, disturbing or irrelevant, I ask you to go elsewhere to find software.
|
While I can't force anyone to do anything, if you happen to disagree with this, I ask of you not to use any of the open source I have published. Nor am I interested in contributions from people who can't accept or act respectfully towards other humans regardless of gender identity, sexual orientation, disability, ethnicity, religion, age, physical appearance, body size, race, or similar personal characteristics. If you think feminism, anti-racism or the LGBT movement is somehow wrong, disturbing or irrelevant, I ask you to go elsewhere to find software.
|
||||||
|
|
||||||
Leaflet Control Geocoder [](http://badge.fury.io/js/leaflet-control-geocoder)
|
Leaflet Control Geocoder [](https://www.npmjs.com/package/leaflet-control-geocoder) 
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
A simple geocoder for [Leaflet](http://leafletjs.com/) that by default uses [OSM](http://www.openstreetmap.org/)/[Nominatim](http://wiki.openstreetmap.org/wiki/Nominatim).
|
A simple geocoder for [Leaflet](http://leafletjs.com/) that by default uses [OSM](http://www.openstreetmap.org/)/[Nominatim](http://wiki.openstreetmap.org/wiki/Nominatim).
|
||||||
@@ -18,18 +18,24 @@ The plugin supports many different data providers:
|
|||||||
* [Google Geocoding API](https://developers.google.com/maps/documentation/geocoding/)
|
* [Google Geocoding API](https://developers.google.com/maps/documentation/geocoding/)
|
||||||
* [Mapbox Geocoding](https://www.mapbox.com/developers/api/geocoding/)
|
* [Mapbox Geocoding](https://www.mapbox.com/developers/api/geocoding/)
|
||||||
* [MapQuest Geocoding API](http://developer.mapquest.com/web/products/dev-services/geocoding-ws)
|
* [MapQuest Geocoding API](http://developer.mapquest.com/web/products/dev-services/geocoding-ws)
|
||||||
* [RaveGeo](http://www2.idevio.com/ravegeo-server.html)
|
* [What3Words](http://what3words.com/)
|
||||||
|
* [Photon](http://photon.komoot.de/)
|
||||||
|
* [Mapzen Search](https://mapzen.com/projects/search)
|
||||||
|
* [HERE Geocoder API] (https://developer.here.com/rest-apis/documentation/geocoder/topics/overview.html)
|
||||||
|
|
||||||
The plugin can easily be extended to support other providers.
|
The plugin can easily be extended to support other providers. Current extensions:
|
||||||
|
|
||||||
|
* [DAWA Geocoder](https://github.com/kjoller/leaflet-control-geocoder-dawa/tree/new) - support for Danish Address Web API by [Niels Kjøller Hansen](https://github.com/kjoller)
|
||||||
|
|
||||||
See the [Leaflet Control Geocoder Demo](http://perliedman.github.com/leaflet-control-geocoder/).
|
See the [Leaflet Control Geocoder Demo](http://perliedman.github.com/leaflet-control-geocoder/).
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
Load the CSS and Javascript:
|
[Download latest release](https://github.com/perliedman/leaflet-control-geocoder/releases). Load the CSS and Javascript, located in
|
||||||
|
the `dist` folder:
|
||||||
|
|
||||||
```HTML
|
```HTML
|
||||||
<link rel="stylesheet" href="../Control.Geocoder.css" />
|
<link rel="stylesheet" href="Control.Geocoder.css" />
|
||||||
<script src="Control.Geocoder.js"></script>
|
<script src="Control.Geocoder.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -46,23 +52,27 @@ L.Control.geocoder().addTo(map);
|
|||||||
# Customizing
|
# Customizing
|
||||||
|
|
||||||
By default, when a geocoding result is found, the control will center the map on it and place
|
By default, when a geocoding result is found, the control will center the map on it and place
|
||||||
a marker at its location. This can be customized by overwriting the control's ```markGeocode```
|
a marker at its location. This can be customized by listening to the control's `markgeocode`
|
||||||
function, to perform any action desired.
|
event. To remove the control's default handler for marking a result, set the option
|
||||||
|
`defaultMarkGeocode` to `false`.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var geocoder = L.Control.geocoder().addTo(map);
|
var geocoder = L.Control.geocoder({
|
||||||
|
defaultMarkGeocode: false
|
||||||
geocoder.markGeocode = function(result) {
|
})
|
||||||
var bbox = result.bbox;
|
.on('markgeocode', function(e) {
|
||||||
L.polygon([
|
var bbox = e.geocode.bbox;
|
||||||
bbox.getSouthEast(),
|
var poly = L.polygon([
|
||||||
bbox.getNorthEast(),
|
bbox.getSouthEast(),
|
||||||
bbox.getNorthWest(),
|
bbox.getNorthEast(),
|
||||||
bbox.getSouthWest()
|
bbox.getNorthWest(),
|
||||||
]).addTo(map);
|
bbox.getSouthWest()
|
||||||
};
|
]).addTo(map);
|
||||||
|
map.fitBounds(poly.getBounds());
|
||||||
|
})
|
||||||
|
.addTo(map);
|
||||||
```
|
```
|
||||||
|
|
||||||
This will add a polygon representing the result's boundingbox when a result is selected.
|
This will add a polygon representing the result's boundingbox when a result is selected.
|
||||||
|
|||||||
25
assets/control-geocoder/bower.json
Normal file → Executable file
@@ -1,12 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet-control-geocoder",
|
"name": "leaflet-control-geocoder",
|
||||||
"version": "1.1.0",
|
"version": "1.5.4",
|
||||||
"homepage": "https://github.com/perliedman/leaflet-control-geocoder",
|
"homepage": "https://github.com/perliedman/leaflet-control-geocoder",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Per Liedman <per@liedman.net>"
|
"Per Liedman <per@liedman.net>"
|
||||||
],
|
],
|
||||||
"description": "Extendable geocoder with builtin OSM/Nominatim support",
|
"description": "Extendable geocoder with builtin OSM/Nominatim support",
|
||||||
"main": "Control.Geocoder.js",
|
"main": [
|
||||||
|
"Control.Geocoder.js",
|
||||||
|
"Control.Geocoder.css",
|
||||||
|
"images/geocoder.png",
|
||||||
|
"images/throbber.gif"
|
||||||
|
],
|
||||||
"moduleType": [
|
"moduleType": [
|
||||||
"amd",
|
"amd",
|
||||||
"globals"
|
"globals"
|
||||||
@@ -14,7 +19,16 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"leaflet",
|
"leaflet",
|
||||||
"geocoder",
|
"geocoder",
|
||||||
"nominatim"
|
"locations",
|
||||||
|
"nominatim",
|
||||||
|
"bing",
|
||||||
|
"google",
|
||||||
|
"mapbox",
|
||||||
|
"photon",
|
||||||
|
"what3words",
|
||||||
|
"mapquest",
|
||||||
|
"mapzen",
|
||||||
|
"here"
|
||||||
],
|
],
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
@@ -23,8 +37,5 @@
|
|||||||
"bower_components",
|
"bower_components",
|
||||||
"test",
|
"test",
|
||||||
"tests"
|
"tests"
|
||||||
],
|
]
|
||||||
"dependencies": {
|
|
||||||
"leaflet": "~0.7.2"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 490 B |
@@ -1,10 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet-control-geocoder",
|
"name": "leaflet-control-geocoder",
|
||||||
"version": "1.1.0",
|
"version": "1.5.4",
|
||||||
"description": "Extendable geocoder with builtin OSM/Nominatim support",
|
"description": "Extendable geocoder with builtin support for Nominatim, Bing, Google, Mapbox, Photon, What3Words, MapQuest, Mapzen, HERE",
|
||||||
"main": "Control.Geocoder.js",
|
"main": "dist/Control.Geocoder.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"prepublish": "sh ./scripts/build.sh",
|
||||||
|
"publish": "sh ./scripts/publish.sh",
|
||||||
|
"postpublish": "sh ./scripts/postpublish.sh"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -13,14 +15,30 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"leaflet",
|
"leaflet",
|
||||||
"geocoder",
|
"geocoder",
|
||||||
"nominatim"
|
"locations",
|
||||||
|
"nominatim",
|
||||||
|
"bing",
|
||||||
|
"google",
|
||||||
|
"mapbox",
|
||||||
|
"photon",
|
||||||
|
"what3words",
|
||||||
|
"mapquest",
|
||||||
|
"mapzen",
|
||||||
|
"here"
|
||||||
],
|
],
|
||||||
"author": "Per Liedman <per@liedman.net>",
|
"author": "Per Liedman <per@liedman.net>",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/perliedman/leaflet-control-geocoder/issues"
|
"url": "https://github.com/perliedman/leaflet-control-geocoder/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"browserify-shim": {
|
||||||
"leaflet": "~0.7.2"
|
"leaflet": "global:L"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"browserify": "^11.0.1",
|
||||||
|
"browserify-shim": "^3.8.10",
|
||||||
|
"derequire": "^2.0.3",
|
||||||
|
"es3ify": "^0.1.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
60
assets/leaflet-extra-markers/.gitignore
vendored
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
### General Ignores ###
|
||||||
|
|
||||||
|
.idea
|
||||||
|
*~
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Operating System Ignores ###
|
||||||
|
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Windows Installer files
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# Windows shortcuts
|
||||||
|
*.lnk
|
||||||
|
|
||||||
|
|
||||||
|
# OSX
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###Node###
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
|
||||||
|
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# Dependency directory
|
||||||
|
# Commenting this out is preferred by some people, see
|
||||||
|
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Users Environment Variables
|
||||||
|
.lock-wscript
|
||||||
64
assets/leaflet-extra-markers/Gruntfile.js
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// require it at the top and pass in the grunt instance
|
||||||
|
require('time-grunt')(grunt);
|
||||||
|
|
||||||
|
/*****************************************************
|
||||||
|
Grunt Init Config:
|
||||||
|
load each task config into grunt via require
|
||||||
|
*****************************************************/
|
||||||
|
grunt.initConfig({
|
||||||
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
|
|
||||||
|
// Project Config
|
||||||
|
project: require('./build/grunt-config/project'), // Contains paths and banner
|
||||||
|
less: require('./build/grunt-config/less'), // Config to compile and autoprefix less files
|
||||||
|
uglify: require('./build/grunt-config/uglify'),
|
||||||
|
jshint: require('./build/grunt-config/jshint'), // Lint Javascript
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/*****************************************************
|
||||||
|
Dev Tasks - Compile and check files withing the /src/assets/ directory
|
||||||
|
*****************************************************/
|
||||||
|
|
||||||
|
// Default grunt task compiles & checks dev files
|
||||||
|
grunt.registerTask('default', [], function(){
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-less');
|
||||||
|
grunt.task.run('less:dev','js-dev');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Javascript Dev Build - Checks for Errors in Javascript
|
||||||
|
grunt.registerTask('js-dev', [], function(){
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||||
|
grunt.task.run('jshint:all', 'uglify:dev');
|
||||||
|
});
|
||||||
|
|
||||||
|
/*****************************************************
|
||||||
|
Dist Tasks
|
||||||
|
*****************************************************/
|
||||||
|
|
||||||
|
// 'grunt build' global build command for both less and js files
|
||||||
|
grunt.registerTask('build', 'Compiles all files for live environment', function() {
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-less');
|
||||||
|
grunt.task.run('less:build', 'js-build');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 'grunt js-build' compiles only javascript
|
||||||
|
grunt.registerTask('js-build', [], function(){
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||||
|
grunt.task.run('jshint:all', 'uglify:build');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 'grunt less-build' compiles only less
|
||||||
|
grunt.registerTask('less-build', [], function(){
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-less');
|
||||||
|
grunt.task.run('less:build');
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
21
assets/leaflet-extra-markers/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2014 coryasilva
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
69
assets/leaflet-extra-markers/README.md
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
# Leaflet.extra-markers plugin v1.0.4
|
||||||
|
<a href="https://github.com/lvoogdt/Leaflet.awesome-markers">Big Thanks to lvoogdt of Leaflet.awesome-markers</a>
|
||||||
|
|
||||||
|

|
||||||
|
### <a href="http://coryasilva.github.io/Leaflet.ExtraMarkers/" target="_blank">Demo</a>
|
||||||
|
|
||||||
|
## Icons
|
||||||
|
Version 1.0 of Leaflet.extra-markers is designed for:
|
||||||
|
- [Bootstrap 3 icons](http://twitter.github.com/bootstrap/)
|
||||||
|
- [Getting Started Guide](http://getbootstrap.com/getting-started/)
|
||||||
|
- [Font Awesome 4.0](http://fortawesome.github.com/Font-Awesome/)
|
||||||
|
- [Getting Started Guide](http://fortawesome.github.io/Font-Awesome/get-started/)
|
||||||
|
- [Semantic UI 0.9.8 icons](http://semantic-ui.com/)
|
||||||
|
- [Ion Icons 2.0.1](http://ionicons.com/)
|
||||||
|
- Leaflet 0.5-Latest
|
||||||
|
|
||||||
|
## Using the plugin
|
||||||
|
|
||||||
|
##### 1. Requirements #####
|
||||||
|
|
||||||
|
Follow the [getting started guide](#icons) for the desired font library and make sure its included in your project.
|
||||||
|
|
||||||
|
##### 2. Installing Leaflet.extra-markers #####
|
||||||
|
|
||||||
|
Next, copy the `dist/img` directory, `/dist/css/leaflet.extra-markers.min.css`, and `/dist/js/leaflet.extra-markers.min.js` to your project and include them:
|
||||||
|
|
||||||
|
````xml
|
||||||
|
<link rel="stylesheet" href="css/leaflet.extra-markers.min.css">
|
||||||
|
````
|
||||||
|
or
|
||||||
|
````less
|
||||||
|
@import 'bower_components/src/assets/less/Leaflet.extra-markers.less
|
||||||
|
````
|
||||||
|
and
|
||||||
|
````xml
|
||||||
|
<script src="js/leaflet.extra-markers.min.js"></script>
|
||||||
|
````
|
||||||
|
|
||||||
|
##### 3. Creating a Marker #####
|
||||||
|
|
||||||
|
Now use the plugin to create a marker like this:
|
||||||
|
````js
|
||||||
|
// Creates a red marker with the coffee icon
|
||||||
|
var redMarker = L.ExtraMarkers.icon({
|
||||||
|
icon: 'fa-coffee',
|
||||||
|
markerColor: 'red',
|
||||||
|
shape: 'square',
|
||||||
|
prefix: 'fa'
|
||||||
|
});
|
||||||
|
|
||||||
|
L.marker([51.941196,4.512291], {icon: redMarker,}).addTo(map);
|
||||||
|
````
|
||||||
|
---
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
| Property | Description | Default Value | Possible values |
|
||||||
|
| --------------- | ------------------------------------------- | ------------- | ---------------------------------------------------- |
|
||||||
|
| extraClasses | Additional classes in the created `<i>` tag | `''` | `fa-rotate90 myclass`; space delimited classes to add |
|
||||||
|
| icon | Name of the icon **with** prefix | `''` | `fa-coffee` (see icon library's documentation) |
|
||||||
|
| iconColor | Color of the icon | `'white'` | `'white'`, `'black'` or css code (hex, rgba etc) |
|
||||||
|
| innerHTML | Custom HTML code | `''` | `<svg>`, images, or other HTML; a truthy assignment will override the default html icon creation behavior |
|
||||||
|
| markerColor | Color of the marker (css class) | `'blue'` | `'red'`, `'orange-dark'`, `'orange'`, `'yellow'`, `'blue-dark'`, `'cyan'`, `'purple'`, `'violet'`, `'pink'`, `'green-dark'`, `'green'`, `'green-light'`, `'black'`, or `'white'` |
|
||||||
|
| number | Instead of an icon, define a plain text | `''` | `'1'` or `'A'`, must set `icon: 'fa-number'` |
|
||||||
|
| prefix | The icon library's base class | `'glyphicon'` | `fa` (see icon library's documentation) |
|
||||||
|
| shape | Shape of the marker (css class) | `'circle'` | `'circle'`, `'square'`, `'star'`, or `'penta'` |
|
||||||
|
|
||||||
|
## License
|
||||||
|
- Leaflet.ExtraMarkers and colored markers are licensed under the MIT License - http://opensource.org/licenses/mit-license.html.
|
||||||
30
assets/leaflet-extra-markers/bower.json
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"name": "Leaflet.extra-markers",
|
||||||
|
"version": "1.0.6",
|
||||||
|
"homepage": "https://github.com/coryasilva/Leaflet.ExtraMarkers",
|
||||||
|
"authors": [
|
||||||
|
"Cory Silva"
|
||||||
|
],
|
||||||
|
"description": "Custom Markers for Leaflet JS based on Awesome Markers",
|
||||||
|
"main": [
|
||||||
|
"src/assets/css/leaflet.extra-markers.css",
|
||||||
|
"src/assets/less/leaflet.extra-markers.less",
|
||||||
|
"src/assets/js/leaflet.extra-markers.js"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"ignore": [
|
||||||
|
"gh-pages",
|
||||||
|
".bowerrc",
|
||||||
|
".gitignore",
|
||||||
|
".jshintignore",
|
||||||
|
".jshintrc",
|
||||||
|
"bower.json",
|
||||||
|
"gruntfile.js",
|
||||||
|
"package.json",
|
||||||
|
"README.md"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
}
|
||||||
|
}
|
||||||
1
assets/leaflet-extra-markers/css/leaflet.extra-markers.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.extra-marker{background:url("../img/markers_default.png") no-repeat 0 0;width:35px;height:46px;position:absolute;left:0;top:0;display:block;text-align:center}.extra-marker-shadow{background:url("../img/markers_shadow.png") no-repeat 0 0;width:36px;height:16px}@media (min--moz-device-pixel-ratio:1.5),(-webkit-min-device-pixel-ratio:1.5),(min-device-pixel-ratio:1.5),(min-resolution:1.5dppx){.extra-marker{background-image:url("../img/markers_default@2x.png");background-size:540px 184px}.extra-marker-shadow{background-image:url("../img/markers_shadow@2x.png");background-size:35px 16px}}.extra-marker i{color:#fff;margin-top:10px;display:inline-block;font-size:14px}.extra-marker i.icon{margin-right:0;opacity:1}.extra-marker-circle-red{background-position:0 0}.extra-marker-circle-orange-dark{background-position:-36px 0}.extra-marker-circle-orange{background-position:-72px 0}.extra-marker-circle-yellow{background-position:-108px 0}.extra-marker-circle-blue-dark{background-position:-144px 0}.extra-marker-circle-blue{background-position:-180px 0}.extra-marker-circle-cyan{background-position:-216px 0}.extra-marker-circle-purple{background-position:-252px 0}.extra-marker-circle-violet{background-position:-288px 0}.extra-marker-circle-pink{background-position:-324px 0}.extra-marker-circle-green-dark{background-position:-360px 0}.extra-marker-circle-green{background-position:-396px 0}.extra-marker-circle-green-light{background-position:-432px 0}.extra-marker-circle-black{background-position:-468px 0}.extra-marker-circle-white{background-position:-504px 0}.extra-marker-square-red{background-position:0 -46px}.extra-marker-square-orange-dark{background-position:-36px -46px}.extra-marker-square-orange{background-position:-72px -46px}.extra-marker-square-yellow{background-position:-108px -46px}.extra-marker-square-blue-dark{background-position:-144px -46px}.extra-marker-square-blue{background-position:-180px -46px}.extra-marker-square-cyan{background-position:-216px -46px}.extra-marker-square-purple{background-position:-252px -46px}.extra-marker-square-violet{background-position:-288px -46px}.extra-marker-square-pink{background-position:-324px -46px}.extra-marker-square-green-dark{background-position:-360px -46px}.extra-marker-square-green{background-position:-396px -46px}.extra-marker-square-green-light{background-position:-432px -46px}.extra-marker-square-black{background-position:-468px -46px}.extra-marker-square-white{background-position:-504px -46px}.extra-marker-star-red{background-position:0 -92px}.extra-marker-star-orange-dark{background-position:-36px -92px}.extra-marker-star-orange{background-position:-72px -92px}.extra-marker-star-yellow{background-position:-108px -92px}.extra-marker-star-blue-dark{background-position:-144px -92px}.extra-marker-star-blue{background-position:-180px -92px}.extra-marker-star-cyan{background-position:-216px -92px}.extra-marker-star-purple{background-position:-252px -92px}.extra-marker-star-violet{background-position:-288px -92px}.extra-marker-star-pink{background-position:-324px -92px}.extra-marker-star-green-dark{background-position:-360px -92px}.extra-marker-star-green{background-position:-396px -92px}.extra-marker-star-green-light{background-position:-432px -92px}.extra-marker-star-black{background-position:-468px -92px}.extra-marker-star-white{background-position:-504px -92px}.extra-marker-penta-red{background-position:0 -138px}.extra-marker-penta-orange-dark{background-position:-36px -138px}.extra-marker-penta-orange{background-position:-72px -138px}.extra-marker-penta-yellow{background-position:-108px -138px}.extra-marker-penta-blue-dark{background-position:-144px -138px}.extra-marker-penta-blue{background-position:-180px -138px}.extra-marker-penta-cyan{background-position:-216px -138px}.extra-marker-penta-purple{background-position:-252px -138px}.extra-marker-penta-violet{background-position:-288px -138px}.extra-marker-penta-pink{background-position:-324px -138px}.extra-marker-penta-green-dark{background-position:-360px -138px}.extra-marker-penta-green{background-position:-396px -138px}.extra-marker-penta-green-light{background-position:-432px -138px}.extra-marker-penta-black{background-position:-468px -138px}.extra-marker-penta-white{background-position:-504px -138px}.extra-marker .fa-number:before{content:attr(number)}
|
||||||
BIN
assets/leaflet-extra-markers/img/markers_default.png
Normal file
|
After Width: | Height: | Size: 117 KiB |
BIN
assets/leaflet-extra-markers/img/markers_default@2x.png
Normal file
|
After Width: | Height: | Size: 248 KiB |
BIN
assets/leaflet-extra-markers/img/markers_shadow.png
Normal file
|
After Width: | Height: | Size: 535 B |
BIN
assets/leaflet-extra-markers/img/markers_shadow@2x.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
1
assets/leaflet-extra-markers/js/leaflet.extra-markers.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
!function(a,b){"use strict";L.ExtraMarkers={},L.ExtraMarkers.version="1.0.1",L.ExtraMarkers.Icon=L.Icon.extend({options:{iconSize:[35,45],iconAnchor:[17,42],popupAnchor:[1,-32],shadowAnchor:[10,12],shadowSize:[36,16],className:"extra-marker",prefix:"",extraClasses:"",shape:"circle",icon:"",innerHTML:"",markerColor:"red",iconColor:"#fff",number:""},initialize:function(a){a=L.Util.setOptions(this,a)},createIcon:function(){var a=b.createElement("div"),c=this.options;return c.icon&&(a.innerHTML=this._createInner()),c.innerHTML&&(a.innerHTML=c.innerHTML),c.bgPos&&(a.style.backgroundPosition=-c.bgPos.x+"px "+-c.bgPos.y+"px"),this._setIconStyles(a,c.shape+"-"+c.markerColor),a},_createInner:function(){var a="",b="",c=this.options;return c.iconColor&&(a="style='color: "+c.iconColor+"' "),c.number&&(b="number='"+c.number+"' "),"<i "+b+a+"class='"+c.extraClasses+" "+c.prefix+" "+c.icon+"'></i>"},_setIconStyles:function(a,b){var c,d,e=this.options,f=L.point(e["shadow"===b?"shadowSize":"iconSize"]);"shadow"===b?(c=L.point(e.shadowAnchor||e.iconAnchor),d="shadow"):(c=L.point(e.iconAnchor),d="icon"),!c&&f&&(c=f.divideBy(2,!0)),a.className="leaflet-marker-"+d+" extra-marker-"+b+" "+e.className,c&&(a.style.marginLeft=-c.x+"px",a.style.marginTop=-c.y+"px"),f&&(a.style.width=f.x+"px",a.style.height=f.y+"px")},createShadow:function(){var a=b.createElement("div");return this._setIconStyles(a,"shadow"),a}}),L.ExtraMarkers.icon=function(a){return new L.ExtraMarkers.Icon(a)}}(window,document);
|
||||||
21
assets/leaflet-extra-markers/package.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "Leaflet.extra-markers",
|
||||||
|
"title": "Leaflet ExtraMarkers",
|
||||||
|
"url": "https://github.com/coryasilva/Leaflet.ExtraMarkers/",
|
||||||
|
"version": "1.0.6",
|
||||||
|
"description": "Custom Markers for Leaflet JS based on Awesome Markers",
|
||||||
|
"author": "coryasilva <https://github.com/coryasilva>",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/coryasilva/Leaflet.ExtraMarkers"
|
||||||
|
},
|
||||||
|
"main": "src/assets/js/leaflet.extra-markers.js",
|
||||||
|
"devDependencies": {
|
||||||
|
"grunt": "^0.4.5",
|
||||||
|
"grunt-contrib-jshint": "^0.11.0",
|
||||||
|
"grunt-contrib-uglify": "^0.8.0",
|
||||||
|
"grunt-contrib-less": "^1.1.0",
|
||||||
|
"less-plugin-autoprefix": "^1.5.1",
|
||||||
|
"time-grunt": "^1.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
assets/leaflet-extra-markers/screenshot.png
Normal file
|
After Width: | Height: | Size: 177 KiB |
@@ -1,4 +1,8 @@
|
|||||||
.leaflet-control-zoom-fullscreen { background-image: url(icon-fullscreen.png); }
|
.fullscreen-icon { background-image: url(icon-fullscreen.png); }
|
||||||
.leaflet-retina .leaflet-control-zoom-fullscreen { background-image: url(icon-fullscreen-2x.png); background-size: 26px 26px; }
|
.leaflet-retina .fullscreen-icon { background-image: url(icon-fullscreen-2x.png); background-size: 26px 26px; }
|
||||||
|
/* one selector per rule as explained here : http://www.sitepoint.com/html5-full-screen-api/ */
|
||||||
.leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
.leaflet-container:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
||||||
|
.leaflet-container:-ms-fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
||||||
|
.leaflet-container:full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
||||||
|
.leaflet-container:fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
||||||
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }
|
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }
|
||||||
95
assets/leaflet-fullscreen/Control.FullScreen.js
vendored
@@ -1,15 +1,17 @@
|
|||||||
(function() {
|
(function () {
|
||||||
|
|
||||||
L.Control.FullScreen = L.Control.extend({
|
L.Control.FullScreen = L.Control.extend({
|
||||||
options: {
|
options: {
|
||||||
position: 'topleft',
|
position: 'topleft',
|
||||||
title: 'Full Screen',
|
title: 'Full Screen',
|
||||||
|
titleCancel: 'Exit Full Screen',
|
||||||
forceSeparateButton: false,
|
forceSeparateButton: false,
|
||||||
forcePseudoFullscreen: false
|
forcePseudoFullscreen: false,
|
||||||
|
fullscreenElement: false
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdd: function (map) {
|
onAdd: function (map) {
|
||||||
var className = 'leaflet-control-zoom-fullscreen', container;
|
var className = 'leaflet-control-zoom-fullscreen', container, content = '';
|
||||||
|
|
||||||
if (map.zoomControl && !this.options.forceSeparateButton) {
|
if (map.zoomControl && !this.options.forceSeparateButton) {
|
||||||
container = map.zoomControl._container;
|
container = map.zoomControl._container;
|
||||||
@@ -17,20 +19,29 @@ L.Control.FullScreen = L.Control.extend({
|
|||||||
container = L.DomUtil.create('div', 'leaflet-bar');
|
container = L.DomUtil.create('div', 'leaflet-bar');
|
||||||
}
|
}
|
||||||
|
|
||||||
this._createButton(this.options.title, className, container, this.toggleFullScreen, this);
|
if (this.options.content) {
|
||||||
|
content = this.options.content;
|
||||||
|
} else {
|
||||||
|
className += ' fullscreen-icon';
|
||||||
|
}
|
||||||
|
|
||||||
|
this._createButton(this.options.title, className, content, container, this.toggleFullScreen, this);
|
||||||
|
|
||||||
|
this._map.on('enterFullscreen exitFullscreen', this._toggleTitle, this);
|
||||||
|
|
||||||
return container;
|
return container;
|
||||||
},
|
},
|
||||||
|
|
||||||
_createButton: function (title, className, container, fn, context) {
|
_createButton: function (title, className, content, container, fn, context) {
|
||||||
var link = L.DomUtil.create('a', className, container);
|
this.link = L.DomUtil.create('a', className, container);
|
||||||
link.href = '#';
|
this.link.href = '#';
|
||||||
link.title = title;
|
this.link.title = title;
|
||||||
|
this.link.innerHTML = content;
|
||||||
|
|
||||||
L.DomEvent
|
L.DomEvent
|
||||||
.addListener(link, 'click', L.DomEvent.stopPropagation)
|
.addListener(this.link, 'click', L.DomEvent.stopPropagation)
|
||||||
.addListener(link, 'click', L.DomEvent.preventDefault)
|
.addListener(this.link, 'click', L.DomEvent.preventDefault)
|
||||||
.addListener(link, 'click', fn, context);
|
.addListener(this.link, 'click', fn, context);
|
||||||
|
|
||||||
L.DomEvent
|
L.DomEvent
|
||||||
.addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation)
|
.addListener(container, fullScreenApi.fullScreenEventName, L.DomEvent.stopPropagation)
|
||||||
@@ -42,7 +53,7 @@ L.Control.FullScreen = L.Control.extend({
|
|||||||
.addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault)
|
.addListener(document, fullScreenApi.fullScreenEventName, L.DomEvent.preventDefault)
|
||||||
.addListener(document, fullScreenApi.fullScreenEventName, this._handleEscKey, context);
|
.addListener(document, fullScreenApi.fullScreenEventName, this._handleEscKey, context);
|
||||||
|
|
||||||
return link;
|
return this.link;
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleFullScreen: function () {
|
toggleFullScreen: function () {
|
||||||
@@ -50,7 +61,7 @@ L.Control.FullScreen = L.Control.extend({
|
|||||||
map._exitFired = false;
|
map._exitFired = false;
|
||||||
if (map._isFullscreen) {
|
if (map._isFullscreen) {
|
||||||
if (fullScreenApi.supportsFullScreen && !this.options.forcePseudoFullscreen) {
|
if (fullScreenApi.supportsFullScreen && !this.options.forcePseudoFullscreen) {
|
||||||
fullScreenApi.cancelFullScreen(map._container);
|
fullScreenApi.cancelFullScreen(this.options.fullscreenElement ? this.options.fullscreenElement : map._container);
|
||||||
} else {
|
} else {
|
||||||
L.DomUtil.removeClass(map._container, 'leaflet-pseudo-fullscreen');
|
L.DomUtil.removeClass(map._container, 'leaflet-pseudo-fullscreen');
|
||||||
}
|
}
|
||||||
@@ -61,7 +72,7 @@ L.Control.FullScreen = L.Control.extend({
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (fullScreenApi.supportsFullScreen && !this.options.forcePseudoFullscreen) {
|
if (fullScreenApi.supportsFullScreen && !this.options.forcePseudoFullscreen) {
|
||||||
fullScreenApi.requestFullScreen(map._container);
|
fullScreenApi.requestFullScreen(this.options.fullscreenElement ? this.options.fullscreenElement : map._container);
|
||||||
} else {
|
} else {
|
||||||
L.DomUtil.addClass(map._container, 'leaflet-pseudo-fullscreen');
|
L.DomUtil.addClass(map._container, 'leaflet-pseudo-fullscreen');
|
||||||
}
|
}
|
||||||
@@ -71,6 +82,10 @@ L.Control.FullScreen = L.Control.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_toggleTitle: function () {
|
||||||
|
this.link.title = this._map._isFullscreen ? this.options.title : this.options.titleCancel;
|
||||||
|
},
|
||||||
|
|
||||||
_handleEscKey: function () {
|
_handleEscKey: function () {
|
||||||
var map = this._map;
|
var map = this._map;
|
||||||
if (!fullScreenApi.isFullScreen(map) && !map._exitFired) {
|
if (!fullScreenApi.isFullScreen(map) && !map._exitFired) {
|
||||||
@@ -104,9 +119,9 @@ source : http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugi
|
|||||||
var
|
var
|
||||||
fullScreenApi = {
|
fullScreenApi = {
|
||||||
supportsFullScreen: false,
|
supportsFullScreen: false,
|
||||||
isFullScreen: function() { return false; },
|
isFullScreen: function () { return false; },
|
||||||
requestFullScreen: function() {},
|
requestFullScreen: function () {},
|
||||||
cancelFullScreen: function() {},
|
cancelFullScreen: function () {},
|
||||||
fullScreenEventName: '',
|
fullScreenEventName: '',
|
||||||
prefix: ''
|
prefix: ''
|
||||||
},
|
},
|
||||||
@@ -117,40 +132,64 @@ source : http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugi
|
|||||||
fullScreenApi.supportsFullScreen = true;
|
fullScreenApi.supportsFullScreen = true;
|
||||||
} else {
|
} else {
|
||||||
// check for fullscreen support by vendor prefix
|
// check for fullscreen support by vendor prefix
|
||||||
for (var i = 0, il = browserPrefixes.length; i < il; i++ ) {
|
for (var i = 0, il = browserPrefixes.length; i < il; i++) {
|
||||||
fullScreenApi.prefix = browserPrefixes[i];
|
fullScreenApi.prefix = browserPrefixes[i];
|
||||||
if (typeof document[fullScreenApi.prefix + 'CancelFullScreen' ] !== 'undefined' ) {
|
if (typeof document[fullScreenApi.prefix + 'CancelFullScreen'] !== 'undefined') {
|
||||||
fullScreenApi.supportsFullScreen = true;
|
fullScreenApi.supportsFullScreen = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (typeof document['msExitFullscreen'] !== 'undefined') {
|
||||||
|
fullScreenApi.prefix = 'ms';
|
||||||
|
fullScreenApi.supportsFullScreen = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// update methods to do something useful
|
// update methods to do something useful
|
||||||
if (fullScreenApi.supportsFullScreen) {
|
if (fullScreenApi.supportsFullScreen) {
|
||||||
fullScreenApi.fullScreenEventName = fullScreenApi.prefix + 'fullscreenchange';
|
if (fullScreenApi.prefix === 'ms') {
|
||||||
fullScreenApi.isFullScreen = function() {
|
fullScreenApi.fullScreenEventName = 'MSFullscreenChange';
|
||||||
switch (this.prefix) {
|
} else {
|
||||||
|
fullScreenApi.fullScreenEventName = fullScreenApi.prefix + 'fullscreenchange';
|
||||||
|
}
|
||||||
|
fullScreenApi.isFullScreen = function () {
|
||||||
|
switch (this.prefix) {
|
||||||
case '':
|
case '':
|
||||||
return document.fullScreen;
|
return document.fullScreen;
|
||||||
case 'webkit':
|
case 'webkit':
|
||||||
return document.webkitIsFullScreen;
|
return document.webkitIsFullScreen;
|
||||||
|
case 'ms':
|
||||||
|
return document.msFullscreenElement;
|
||||||
default:
|
default:
|
||||||
return document[this.prefix + 'FullScreen'];
|
return document[this.prefix + 'FullScreen'];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
fullScreenApi.requestFullScreen = function(el) {
|
fullScreenApi.requestFullScreen = function (el) {
|
||||||
return (this.prefix === '') ? el.requestFullscreen() : el[this.prefix + 'RequestFullScreen']();
|
switch (this.prefix) {
|
||||||
|
case '':
|
||||||
|
return el.requestFullscreen();
|
||||||
|
case 'ms':
|
||||||
|
return el.msRequestFullscreen();
|
||||||
|
default:
|
||||||
|
return el[this.prefix + 'RequestFullScreen']();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
fullScreenApi.cancelFullScreen = function(el) {
|
fullScreenApi.cancelFullScreen = function () {
|
||||||
return (this.prefix === '') ? document.exitFullscreen() : document[this.prefix + 'CancelFullScreen']();
|
switch (this.prefix) {
|
||||||
|
case '':
|
||||||
|
return document.exitFullscreen();
|
||||||
|
case 'ms':
|
||||||
|
return document.msExitFullscreen();
|
||||||
|
default:
|
||||||
|
return document[this.prefix + 'CancelFullScreen']();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// jQuery plugin
|
// jQuery plugin
|
||||||
if (typeof jQuery !== 'undefined') {
|
if (typeof jQuery !== 'undefined') {
|
||||||
jQuery.fn.requestFullScreen = function() {
|
jQuery.fn.requestFullScreen = function () {
|
||||||
return this.each(function() {
|
return this.each(function () {
|
||||||
var el = jQuery(this);
|
var el = jQuery(this);
|
||||||
if (fullScreenApi.supportsFullScreen) {
|
if (fullScreenApi.supportsFullScreen) {
|
||||||
fullScreenApi.requestFullScreen(el);
|
fullScreenApi.requestFullScreen(el);
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
.leaflet-control-zoom-fullscreen{background-image:url('icon-fullscreen.png')}.leaflet-retina .leaflet-control-zoom-fullscreen{background-image:url('icon-fullscreen-2x.png');background-size:26px 26px}.leaflet-container:-webkit-full-screen{width:100%!important;height:100%!important;z-index:99999}.leaflet-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}
|
.leaflet-container:full-screen,.leaflet-pseudo-fullscreen{width:100%!important;height:100%!important;z-index:99999}.fullscreen-icon{background-image:url('icon-fullscreen.png')}.leaflet-retina .fullscreen-icon{background-image:url('icon-fullscreen-2x.png');background-size:26px 26px}.leaflet-container:-webkit-full-screen{width:100%!important;height:100%!important;z-index:99999}.leaflet-container:-ms-fullscreen{width:100%!important;height:100%!important;z-index:99999}.leaflet-container:fullscreen{width:100%!important;height:100%!important;z-index:99999}.leaflet-pseudo-fullscreen{position:fixed!important;top:0!important;left:0!important}
|
||||||
@@ -1 +1 @@
|
|||||||
!function(){L.Control.FullScreen=L.Control.extend({options:{position:"topleft",title:"Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1},onAdd:function(e){var n,t="leaflet-control-zoom-fullscreen";return n=e.zoomControl&&!this.options.forceSeparateButton?e.zoomControl._container:L.DomUtil.create("div","leaflet-bar"),this._createButton(this.options.title,t,n,this.toggleFullScreen,this),n},_createButton:function(n,t,l,r,o){var u=L.DomUtil.create("a",t,l);return u.href="#",u.title=n,L.DomEvent.addListener(u,"click",L.DomEvent.stopPropagation).addListener(u,"click",L.DomEvent.preventDefault).addListener(u,"click",r,o),L.DomEvent.addListener(l,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(l,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(l,e.fullScreenEventName,this._handleEscKey,o),L.DomEvent.addListener(document,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(document,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(document,e.fullScreenEventName,this._handleEscKey,o),u},toggleFullScreen:function(){var n=this._map;n._exitFired=!1,n._isFullscreen?(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.cancelFullScreen(n._container):L.DomUtil.removeClass(n._container,"leaflet-pseudo-fullscreen"),n.invalidateSize(),n.fire("exitFullscreen"),n._exitFired=!0,n._isFullscreen=!1):(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.requestFullScreen(n._container):L.DomUtil.addClass(n._container,"leaflet-pseudo-fullscreen"),n.invalidateSize(),n.fire("enterFullscreen"),n._isFullscreen=!0)},_handleEscKey:function(){var n=this._map;e.isFullScreen(n)||n._exitFired||(n.fire("exitFullscreen"),n._exitFired=!0,n._isFullscreen=!1)}}),L.Map.addInitHook(function(){this.options.fullscreenControl&&(this.fullscreenControl=L.control.fullscreen(this.options.fullscreenControlOptions),this.addControl(this.fullscreenControl))}),L.control.fullscreen=function(e){return new L.Control.FullScreen(e)};var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",prefix:""},n="webkit moz o ms khtml".split(" ");if("undefined"!=typeof document.exitFullscreen)e.supportsFullScreen=!0;else for(var t=0,l=n.length;l>t;t++)if(e.prefix=n[t],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}e.supportsFullScreen&&(e.fullScreenEventName=e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){return""===this.prefix?e.requestFullscreen():e[this.prefix+"RequestFullScreen"]()},e.cancelFullScreen=function(){return""===this.prefix?document.exitFullscreen():document[this.prefix+"CancelFullScreen"]()}),"undefined"!=typeof jQuery&&(jQuery.fn.requestFullScreen=function(){return this.each(function(){var n=jQuery(this);e.supportsFullScreen&&e.requestFullScreen(n)})}),window.fullScreenApi=e}();
|
!function(){L.Control.FullScreen=L.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},onAdd:function(e){var n,t="leaflet-control-zoom-fullscreen",l="";return n=e.zoomControl&&!this.options.forceSeparateButton?e.zoomControl._container:L.DomUtil.create("div","leaflet-bar"),this.options.content?l=this.options.content:t+=" fullscreen-icon",this._createButton(this.options.title,t,l,n,this.toggleFullScreen,this),this._map.on("enterFullscreen exitFullscreen",this._toggleTitle,this),n},_createButton:function(n,t,l,r,i,s){return this.link=L.DomUtil.create("a",t,r),this.link.href="#",this.link.title=n,this.link.innerHTML=l,L.DomEvent.addListener(this.link,"click",L.DomEvent.stopPropagation).addListener(this.link,"click",L.DomEvent.preventDefault).addListener(this.link,"click",i,s),L.DomEvent.addListener(r,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(r,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(r,e.fullScreenEventName,this._handleEscKey,s),L.DomEvent.addListener(document,e.fullScreenEventName,L.DomEvent.stopPropagation).addListener(document,e.fullScreenEventName,L.DomEvent.preventDefault).addListener(document,e.fullScreenEventName,this._handleEscKey,s),this.link},toggleFullScreen:function(){var n=this._map;n._exitFired=!1,n._isFullscreen?(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.cancelFullScreen(this.options.fullscreenElement?this.options.fullscreenElement:n._container):L.DomUtil.removeClass(n._container,"leaflet-pseudo-fullscreen"),n.invalidateSize(),n.fire("exitFullscreen"),n._exitFired=!0,n._isFullscreen=!1):(e.supportsFullScreen&&!this.options.forcePseudoFullscreen?e.requestFullScreen(this.options.fullscreenElement?this.options.fullscreenElement:n._container):L.DomUtil.addClass(n._container,"leaflet-pseudo-fullscreen"),n.invalidateSize(),n.fire("enterFullscreen"),n._isFullscreen=!0)},_toggleTitle:function(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel},_handleEscKey:function(){var n=this._map;e.isFullScreen(n)||n._exitFired||(n.fire("exitFullscreen"),n._exitFired=!0,n._isFullscreen=!1)}}),L.Map.addInitHook(function(){this.options.fullscreenControl&&(this.fullscreenControl=L.control.fullscreen(this.options.fullscreenControlOptions),this.addControl(this.fullscreenControl))}),L.control.fullscreen=function(e){return new L.Control.FullScreen(e)};var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",prefix:""},n="webkit moz o ms khtml".split(" ");if("undefined"!=typeof document.exitFullscreen)e.supportsFullScreen=!0;else{for(var t=0,l=n.length;t<l;t++)if(e.prefix=n[t],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}"undefined"!=typeof document.msExitFullscreen&&(e.prefix="ms",e.supportsFullScreen=!0)}e.supportsFullScreen&&("ms"===e.prefix?e.fullScreenEventName="MSFullscreenChange":e.fullScreenEventName=e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;case"ms":return document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){switch(this.prefix){case"":return e.requestFullscreen();case"ms":return e.msRequestFullscreen();default:return e[this.prefix+"RequestFullScreen"]()}},e.cancelFullScreen=function(){switch(this.prefix){case"":return document.exitFullscreen();case"ms":return document.msExitFullscreen();default:return document[this.prefix+"CancelFullScreen"]()}}),"undefined"!=typeof jQuery&&(jQuery.fn.requestFullScreen=function(){return this.each(function(){var n=jQuery(this);e.supportsFullScreen&&e.requestFullScreen(n)})}),window.fullScreenApi=e}();
|
||||||
@@ -1,22 +1,19 @@
|
|||||||
Copyright (c) 2013, Bruno Bergot
|
Copyright (c) 2013, Bruno Bergot
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification, are
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
permitted provided that the following conditions are met:
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
The above copyright notice and this permission notice shall be included in
|
||||||
conditions and the following disclaimer.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice, this list
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
of conditions and the following disclaimer in the documentation and/or other materials
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
provided with the distribution.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
THE SOFTWARE.
|
||||||
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
||||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
|
||||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|||||||
@@ -44,8 +44,11 @@ __Events and options__:
|
|||||||
L.control.fullscreen({
|
L.control.fullscreen({
|
||||||
position: 'topleft', // change the position of the button can be topleft, topright, bottomright or bottomleft, defaut topleft
|
position: 'topleft', // change the position of the button can be topleft, topright, bottomright or bottomleft, defaut topleft
|
||||||
title: 'Show me the fullscreen !', // change the title of the button, default Full Screen
|
title: 'Show me the fullscreen !', // change the title of the button, default Full Screen
|
||||||
|
titleCancel: 'Exit fullscreen mode' // change the title of the button when fullscreen is on, default Exit Full Screen
|
||||||
|
content: null // change the content of the button, can be HTML, default null
|
||||||
forceSeparateButton: true, // force seperate button to detach from zoom buttons, default false
|
forceSeparateButton: true, // force seperate button to detach from zoom buttons, default false
|
||||||
forcePseudoFullscreen: true // force use of pseudo full screen even if full screen API is available, default false
|
forcePseudoFullscreen: true, // force use of pseudo full screen even if full screen API is available, default false
|
||||||
|
fullscreenElement: false // Dom element to render in full screen, false by default, fallback to map._container
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
// events are fired when entering or exiting fullscreen.
|
// events are fired when entering or exiting fullscreen.
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet.fullscreen",
|
"name": "leaflet.fullscreen",
|
||||||
"version": "1.1.4",
|
"version": "1.4.2",
|
||||||
"homepage": "https://github.com/brunob/leaflet.fullscreen",
|
"homepage": "https://github.com/brunob/leaflet.fullscreen",
|
||||||
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
"brunob <brunobergot@gmail.com>"
|
"brunob <brunobergot@gmail.com>"
|
||||||
],
|
],
|
||||||
@@ -12,13 +13,15 @@
|
|||||||
"icon-fullscreen.png",
|
"icon-fullscreen.png",
|
||||||
"icon-fullscreen-2x.png"
|
"icon-fullscreen-2x.png"
|
||||||
],
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "2.3.0"
|
||||||
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"leaflet",
|
"leaflet",
|
||||||
"plugins",
|
"plugins",
|
||||||
"maps",
|
"maps",
|
||||||
"fullscreen"
|
"fullscreen"
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"**/.*",
|
"**/.*",
|
||||||
"node_modules",
|
"node_modules",
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 215 B |
|
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 139 B |
@@ -3,17 +3,18 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset='utf-8'>
|
<meta charset='utf-8'>
|
||||||
<title>Leaflet.Control.FullScreen Demo</title>
|
<title>Leaflet.Control.FullScreen Demo</title>
|
||||||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
|
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map { width: 700px; height: 433px; }
|
#map { width: 700px; height: 433px; }
|
||||||
.leaflet-control-zoom-fullscreen { background-image: url(icon-fullscreen.png); }
|
.fullscreen-icon { background-image: url(icon-fullscreen.png); }
|
||||||
/* on selector per rule as explained here : http://www.sitepoint.com/html5-full-screen-api/ */
|
/* one selector per rule as explained here : http://www.sitepoint.com/html5-full-screen-api/ */
|
||||||
#map:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
#map:-webkit-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
||||||
#map:-moz-full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
#map:-ms-fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
||||||
#map:full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
#map:full-screen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
||||||
|
#map:fullscreen { width: 100% !important; height: 100% !important; z-index: 99999; }
|
||||||
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }
|
.leaflet-pseudo-fullscreen { position: fixed !important; width: 100% !important; height: 100% !important; top: 0px !important; left: 0px !important; z-index: 99999; }
|
||||||
</style>
|
</style>
|
||||||
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
|
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
|
||||||
<script src="Control.FullScreen.js"></script>
|
<script src="Control.FullScreen.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -21,9 +22,10 @@
|
|||||||
<div id="map"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var base = new L.TileLayer('http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png', {
|
var base = new L.TileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
|
||||||
maxZoom: 18,
|
maxZoom: 19,
|
||||||
attribution: '© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
|
subdomains: 'abcd',
|
||||||
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> © <a href="http://cartodb.com/attributions">CartoDB</a>'
|
||||||
});
|
});
|
||||||
|
|
||||||
var map = new L.Map('map', {
|
var map = new L.Map('map', {
|
||||||
@@ -32,7 +34,8 @@
|
|||||||
zoom: 5,
|
zoom: 5,
|
||||||
fullscreenControl: true,
|
fullscreenControl: true,
|
||||||
fullscreenControlOptions: { // optional
|
fullscreenControlOptions: { // optional
|
||||||
title:"Show me the fullscreen !"
|
title:"Show me the fullscreen !",
|
||||||
|
titleCancel:"Exit fullscreen mode"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet.fullscreen",
|
"name": "leaflet.fullscreen",
|
||||||
"version": "1.1.4",
|
"version": "1.4.2",
|
||||||
"description": "Simple plugin for Leaflet that adds fullscreen button to your maps.",
|
"description": "Simple plugin for Leaflet that adds fullscreen button to your maps.",
|
||||||
"main": "Control.FullScreen.js",
|
"main": "Control.FullScreen.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"fullscreen"
|
"fullscreen"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jshint": "2.5.0"
|
"eslint": "2.3.0"
|
||||||
},
|
},
|
||||||
"author": "b_b",
|
"author": "b_b",
|
||||||
"license": "MIT License",
|
"license": "MIT License",
|
||||||
|
|||||||
@@ -18,3 +18,4 @@ Your pull requests are very welcome! Please follow these guidelines:
|
|||||||
* [kcwu](https://github.com/kcwu)
|
* [kcwu](https://github.com/kcwu)
|
||||||
* [Robbie Trencheny](https://github.com/robbiet480)
|
* [Robbie Trencheny](https://github.com/robbiet480)
|
||||||
* [David Molineus](https://github.com/dmolineus)
|
* [David Molineus](https://github.com/dmolineus)
|
||||||
|
* [Marwen Arfa](https://github.com/arfa)
|
||||||
|
|||||||
@@ -5,14 +5,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-loading,
|
.leaflet-control-loading,
|
||||||
.leaflet-control-zoom a.leaflet-control-loading ,
|
.leaflet-control-zoom a.leaflet-control-loading,
|
||||||
.leaflet-control-zoomslider a.leaflet-control-loading {
|
.leaflet-control-zoomslider a.leaflet-control-loading,
|
||||||
|
.leaflet-control-layer-container {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-loading.is-loading,
|
.leaflet-control-loading.is-loading,
|
||||||
.leaflet-control-zoom a.leaflet-control-loading.is-loading,
|
.leaflet-control-zoom a.leaflet-control-loading.is-loading,
|
||||||
.leaflet-control-zoomslider a.leaflet-control-loading.is-loading {
|
.leaflet-control-zoomslider a.leaflet-control-loading.is-loading,
|
||||||
|
.leaflet-control-layer-container.is-loading {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,17 +13,18 @@
|
|||||||
function defineLeafletLoading(L) {
|
function defineLeafletLoading(L) {
|
||||||
L.Control.Loading = L.Control.extend({
|
L.Control.Loading = L.Control.extend({
|
||||||
options: {
|
options: {
|
||||||
|
delayIndicator: null,
|
||||||
position: 'topleft',
|
position: 'topleft',
|
||||||
separate: false,
|
separate: false,
|
||||||
zoomControl: null,
|
zoomControl: null,
|
||||||
spinjs: false,
|
spinjs: false,
|
||||||
spin: {
|
spin: {
|
||||||
lines: 7,
|
lines: 7,
|
||||||
length: 3,
|
length: 3,
|
||||||
width: 3,
|
width: 3,
|
||||||
radius: 5,
|
radius: 5,
|
||||||
rotate: 13,
|
rotate: 13,
|
||||||
top: "83%"
|
top: "83%"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -70,12 +71,13 @@
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Otherwise, create a container for the indicator
|
// Otherwise, create a container for the indicator
|
||||||
container = L.DomUtil.create('div', 'leaflet-control-zoom leaflet-bar');
|
container = L.DomUtil.create('div', 'leaflet-control-zoom leaflet-control-layer-container leaflet-bar');
|
||||||
}
|
}
|
||||||
|
this._indicatorContainer = container;
|
||||||
this._indicator = L.DomUtil.create('a', classes, container);
|
this._indicator = L.DomUtil.create('a', classes, container);
|
||||||
if (this.options.spinjs) {
|
if (this.options.spinjs) {
|
||||||
this._spinner = new Spinner(this.options.spin).spin();
|
this._spinner = new Spinner(this.options.spin).spin();
|
||||||
this._indicator.appendChild(this._spinner.el);
|
this._indicator.appendChild(this._spinner.el);
|
||||||
}
|
}
|
||||||
return container;
|
return container;
|
||||||
},
|
},
|
||||||
@@ -103,12 +105,32 @@
|
|||||||
|
|
||||||
addLoader: function(id) {
|
addLoader: function(id) {
|
||||||
this._dataLoaders[id] = true;
|
this._dataLoaders[id] = true;
|
||||||
this.updateIndicator();
|
if (this.options.delayIndicator && !this.delayIndicatorTimeout) {
|
||||||
|
// If we are delaying showing the indicator and we're not
|
||||||
|
// already waiting for that delay, set up a timeout.
|
||||||
|
var that = this;
|
||||||
|
this.delayIndicatorTimeout = setTimeout(function () {
|
||||||
|
that.updateIndicator();
|
||||||
|
that.delayIndicatorTimeout = null;
|
||||||
|
}, this.options.delayIndicator);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Otherwise show the indicator immediately
|
||||||
|
this.updateIndicator();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
removeLoader: function(id) {
|
removeLoader: function(id) {
|
||||||
delete this._dataLoaders[id];
|
delete this._dataLoaders[id];
|
||||||
this.updateIndicator();
|
this.updateIndicator();
|
||||||
|
|
||||||
|
// If removing this loader means we're in no danger of loading,
|
||||||
|
// clear the timeout. This prevents old delays from instantly
|
||||||
|
// triggering the indicator.
|
||||||
|
if (this.options.delayIndicator && this.delayIndicatorTimeout && !this.isLoading()) {
|
||||||
|
clearTimeout(this.delayIndicatorTimeout);
|
||||||
|
this.delayIndicatorTimeout = null;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
updateIndicator: function() {
|
updateIndicator: function() {
|
||||||
@@ -135,6 +157,7 @@
|
|||||||
_showIndicator: function() {
|
_showIndicator: function() {
|
||||||
// Show loading indicator
|
// Show loading indicator
|
||||||
L.DomUtil.addClass(this._indicator, 'is-loading');
|
L.DomUtil.addClass(this._indicator, 'is-loading');
|
||||||
|
L.DomUtil.addClass(this._indicatorContainer, 'is-loading');
|
||||||
|
|
||||||
// If zoomControl exists, make the zoom-out button not last
|
// If zoomControl exists, make the zoom-out button not last
|
||||||
if (!this.options.separate) {
|
if (!this.options.separate) {
|
||||||
@@ -150,6 +173,7 @@
|
|||||||
_hideIndicator: function() {
|
_hideIndicator: function() {
|
||||||
// Hide loading indicator
|
// Hide loading indicator
|
||||||
L.DomUtil.removeClass(this._indicator, 'is-loading');
|
L.DomUtil.removeClass(this._indicator, 'is-loading');
|
||||||
|
L.DomUtil.removeClass(this._indicatorContainer, 'is-loading');
|
||||||
|
|
||||||
// If zoomControl exists, make the zoom-out button last
|
// If zoomControl exists, make the zoom-out button last
|
||||||
if (!this.options.separate) {
|
if (!this.options.separate) {
|
||||||
@@ -183,6 +207,26 @@
|
|||||||
this.addLoader(this.getEventId(e));
|
this.addLoader(this.getEventId(e));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_handleBaseLayerChange: function (e) {
|
||||||
|
var that = this;
|
||||||
|
|
||||||
|
// Check for a target 'layer' that contains multiple layers, such as
|
||||||
|
// L.LayerGroup. This will happen if you have an L.LayerGroup in an
|
||||||
|
// L.Control.Layers.
|
||||||
|
if (e.layer && e.layer.eachLayer && typeof e.layer.eachLayer === 'function') {
|
||||||
|
e.layer.eachLayer(function (layer) {
|
||||||
|
that._handleBaseLayerChange({ layer: layer });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// If we're changing to a canvas layer, don't handle loading
|
||||||
|
// as canvas layers will not fire load events.
|
||||||
|
if (!(L.TileLayer.Canvas && e.layer instanceof L.TileLayer.Canvas)) {
|
||||||
|
that._handleLoading(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
_handleLoad: function(e) {
|
_handleLoad: function(e) {
|
||||||
this.removeLoader(this.getEventId(e));
|
this.removeLoader(this.getEventId(e));
|
||||||
},
|
},
|
||||||
@@ -212,6 +256,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_layerRemove: function(e) {
|
||||||
|
if (!e.layer || !e.layer.off) return;
|
||||||
|
try {
|
||||||
|
e.layer.off({
|
||||||
|
loading: this._handleLoading,
|
||||||
|
load: this._handleLoad
|
||||||
|
}, this);
|
||||||
|
}
|
||||||
|
catch (exception) {
|
||||||
|
console.warn('L.Control.Loading: Tried and failed to remove ' +
|
||||||
|
'event handlers from layer', e.layer);
|
||||||
|
console.warn('L.Control.Loading: Full details', exception);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
_addLayerListeners: function(map) {
|
_addLayerListeners: function(map) {
|
||||||
// Add listeners for begin and end of load to any layers already on the
|
// Add listeners for begin and end of load to any layers already on the
|
||||||
// map
|
// map
|
||||||
@@ -226,6 +285,7 @@
|
|||||||
// When a layer is added to the map, add listeners for begin and end
|
// When a layer is added to the map, add listeners for begin and end
|
||||||
// of load
|
// of load
|
||||||
map.on('layeradd', this._layerAdd, this);
|
map.on('layeradd', this._layerAdd, this);
|
||||||
|
map.on('layerremove', this._layerRemove, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
_removeLayerListeners: function(map) {
|
_removeLayerListeners: function(map) {
|
||||||
@@ -238,8 +298,9 @@
|
|||||||
}, this);
|
}, this);
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
// Remove layeradd listener from map
|
// Remove layeradd/layerremove listener from map
|
||||||
map.off('layeradd', this._layerAdd, this);
|
map.off('layeradd', this._layerAdd, this);
|
||||||
|
map.off('layerremove', this._layerRemove, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
_addMapListeners: function(map) {
|
_addMapListeners: function(map) {
|
||||||
@@ -247,6 +308,7 @@
|
|||||||
// events, eg, for AJAX calls that affect the map but will not be
|
// events, eg, for AJAX calls that affect the map but will not be
|
||||||
// reflected in the above layer events.
|
// reflected in the above layer events.
|
||||||
map.on({
|
map.on({
|
||||||
|
baselayerchange: this._handleBaseLayerChange,
|
||||||
dataloading: this._handleLoading,
|
dataloading: this._handleLoading,
|
||||||
dataload: this._handleLoad,
|
dataload: this._handleLoad,
|
||||||
layerremove: this._handleLoad
|
layerremove: this._handleLoad
|
||||||
@@ -255,6 +317,7 @@
|
|||||||
|
|
||||||
_removeMapListeners: function(map) {
|
_removeMapListeners: function(map) {
|
||||||
map.off({
|
map.off({
|
||||||
|
baselayerchange: this._handleBaseLayerChange,
|
||||||
dataloading: this._handleLoading,
|
dataloading: this._handleLoading,
|
||||||
dataload: this._handleLoad,
|
dataload: this._handleLoad,
|
||||||
layerremove: this._handleLoad
|
layerremove: this._handleLoad
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
.leaflet-control-loading:empty{background-image:url('data:image/gif;base64,R0lGODlhEAAQAPQAAP///wAAAPDw8IqKiuDg4EZGRnp6egAAAFhYWCQkJKysrL6+vhQUFJycnAQEBDY2NmhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH+GkNyZWF0ZWQgd2l0aCBhamF4bG9hZC5pbmZvACH5BAAKAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAEAAQAAAFdyAgAgIJIeWoAkRCCMdBkKtIHIngyMKsErPBYbADpkSCwhDmQCBethRB6Vj4kFCkQPG4IlWDgrNRIwnO4UKBXDufzQvDMaoSDBgFb886MiQadgNABAokfCwzBA8LCg0Egl8jAggGAA1kBIA1BAYzlyILczULC2UhACH5BAAKAAEALAAAAAAQABAAAAV2ICACAmlAZTmOREEIyUEQjLKKxPHADhEvqxlgcGgkGI1DYSVAIAWMx+lwSKkICJ0QsHi9RgKBwnVTiRQQgwF4I4UFDQQEwi6/3YSGWRRmjhEETAJfIgMFCnAKM0KDV4EEEAQLiF18TAYNXDaSe3x6mjidN1s3IQAh+QQACgACACwAAAAAEAAQAAAFeCAgAgLZDGU5jgRECEUiCI+yioSDwDJyLKsXoHFQxBSHAoAAFBhqtMJg8DgQBgfrEsJAEAg4YhZIEiwgKtHiMBgtpg3wbUZXGO7kOb1MUKRFMysCChAoggJCIg0GC2aNe4gqQldfL4l/Ag1AXySJgn5LcoE3QXI3IQAh+QQACgADACwAAAAAEAAQAAAFdiAgAgLZNGU5joQhCEjxIssqEo8bC9BRjy9Ag7GILQ4QEoE0gBAEBcOpcBA0DoxSK/e8LRIHn+i1cK0IyKdg0VAoljYIg+GgnRrwVS/8IAkICyosBIQpBAMoKy9dImxPhS+GKkFrkX+TigtLlIyKXUF+NjagNiEAIfkEAAoABAAsAAAAABAAEAAABWwgIAICaRhlOY4EIgjH8R7LKhKHGwsMvb4AAy3WODBIBBKCsYA9TjuhDNDKEVSERezQEL0WrhXucRUQGuik7bFlngzqVW9LMl9XWvLdjFaJtDFqZ1cEZUB0dUgvL3dgP4WJZn4jkomWNpSTIyEAIfkEAAoABQAsAAAAABAAEAAABX4gIAICuSxlOY6CIgiD8RrEKgqGOwxwUrMlAoSwIzAGpJpgoSDAGifDY5kopBYDlEpAQBwevxfBtRIUGi8xwWkDNBCIwmC9Vq0aiQQDQuK+VgQPDXV9hCJjBwcFYU5pLwwHXQcMKSmNLQcIAExlbH8JBwttaX0ABAcNbWVbKyEAIfkEAAoABgAsAAAAABAAEAAABXkgIAICSRBlOY7CIghN8zbEKsKoIjdFzZaEgUBHKChMJtRwcWpAWoWnifm6ESAMhO8lQK0EEAV3rFopIBCEcGwDKAqPh4HUrY4ICHH1dSoTFgcHUiZjBhAJB2AHDykpKAwHAwdzf19KkASIPl9cDgcnDkdtNwiMJCshACH5BAAKAAcALAAAAAAQABAAAAV3ICACAkkQZTmOAiosiyAoxCq+KPxCNVsSMRgBsiClWrLTSWFoIQZHl6pleBh6suxKMIhlvzbAwkBWfFWrBQTxNLq2RG2yhSUkDs2b63AYDAoJXAcFRwADeAkJDX0AQCsEfAQMDAIPBz0rCgcxky0JRWE1AmwpKyEAIfkEAAoACAAsAAAAABAAEAAABXkgIAICKZzkqJ4nQZxLqZKv4NqNLKK2/Q4Ek4lFXChsg5ypJjs1II3gEDUSRInEGYAw6B6zM4JhrDAtEosVkLUtHA7RHaHAGJQEjsODcEg0FBAFVgkQJQ1pAwcDDw8KcFtSInwJAowCCA6RIwqZAgkPNgVpWndjdyohACH5BAAKAAkALAAAAAAQABAAAAV5ICACAimc5KieLEuUKvm2xAKLqDCfC2GaO9eL0LABWTiBYmA06W6kHgvCqEJiAIJiu3gcvgUsscHUERm+kaCxyxa+zRPk0SgJEgfIvbAdIAQLCAYlCj4DBw0IBQsMCjIqBAcPAooCBg9pKgsJLwUFOhCZKyQDA3YqIQAh+QQACgAKACwAAAAAEAAQAAAFdSAgAgIpnOSonmxbqiThCrJKEHFbo8JxDDOZYFFb+A41E4H4OhkOipXwBElYITDAckFEOBgMQ3arkMkUBdxIUGZpEb7kaQBRlASPg0FQQHAbEEMGDSVEAA1QBhAED1E0NgwFAooCDWljaQIQCE5qMHcNhCkjIQAh+QQACgALACwAAAAAEAAQAAAFeSAgAgIpnOSoLgxxvqgKLEcCC65KEAByKK8cSpA4DAiHQ/DkKhGKh4ZCtCyZGo6F6iYYPAqFgYy02xkSaLEMV34tELyRYNEsCQyHlvWkGCzsPgMCEAY7Cg04Uk48LAsDhRA8MVQPEF0GAgqYYwSRlycNcWskCkApIyEAOwAAAAAAAAAAAA==');background-repeat:no-repeat}.leaflet-control-loading,.leaflet-control-zoom a.leaflet-control-loading,.leaflet-control-zoomslider a.leaflet-control-loading{display:none}.leaflet-control-loading.is-loading,.leaflet-control-zoom a.leaflet-control-loading.is-loading,.leaflet-control-zoomslider a.leaflet-control-loading.is-loading{display:block}.leaflet-bar-part-bottom{border-bottom:medium none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}
|
.leaflet-control-loading:empty{background-image:url('data:image/gif;base64,R0lGODlhEAAQAPQAAP///wAAAPDw8IqKiuDg4EZGRnp6egAAAFhYWCQkJKysrL6+vhQUFJycnAQEBDY2NmhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH+GkNyZWF0ZWQgd2l0aCBhamF4bG9hZC5pbmZvACH5BAAKAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAEAAQAAAFdyAgAgIJIeWoAkRCCMdBkKtIHIngyMKsErPBYbADpkSCwhDmQCBethRB6Vj4kFCkQPG4IlWDgrNRIwnO4UKBXDufzQvDMaoSDBgFb886MiQadgNABAokfCwzBA8LCg0Egl8jAggGAA1kBIA1BAYzlyILczULC2UhACH5BAAKAAEALAAAAAAQABAAAAV2ICACAmlAZTmOREEIyUEQjLKKxPHADhEvqxlgcGgkGI1DYSVAIAWMx+lwSKkICJ0QsHi9RgKBwnVTiRQQgwF4I4UFDQQEwi6/3YSGWRRmjhEETAJfIgMFCnAKM0KDV4EEEAQLiF18TAYNXDaSe3x6mjidN1s3IQAh+QQACgACACwAAAAAEAAQAAAFeCAgAgLZDGU5jgRECEUiCI+yioSDwDJyLKsXoHFQxBSHAoAAFBhqtMJg8DgQBgfrEsJAEAg4YhZIEiwgKtHiMBgtpg3wbUZXGO7kOb1MUKRFMysCChAoggJCIg0GC2aNe4gqQldfL4l/Ag1AXySJgn5LcoE3QXI3IQAh+QQACgADACwAAAAAEAAQAAAFdiAgAgLZNGU5joQhCEjxIssqEo8bC9BRjy9Ag7GILQ4QEoE0gBAEBcOpcBA0DoxSK/e8LRIHn+i1cK0IyKdg0VAoljYIg+GgnRrwVS/8IAkICyosBIQpBAMoKy9dImxPhS+GKkFrkX+TigtLlIyKXUF+NjagNiEAIfkEAAoABAAsAAAAABAAEAAABWwgIAICaRhlOY4EIgjH8R7LKhKHGwsMvb4AAy3WODBIBBKCsYA9TjuhDNDKEVSERezQEL0WrhXucRUQGuik7bFlngzqVW9LMl9XWvLdjFaJtDFqZ1cEZUB0dUgvL3dgP4WJZn4jkomWNpSTIyEAIfkEAAoABQAsAAAAABAAEAAABX4gIAICuSxlOY6CIgiD8RrEKgqGOwxwUrMlAoSwIzAGpJpgoSDAGifDY5kopBYDlEpAQBwevxfBtRIUGi8xwWkDNBCIwmC9Vq0aiQQDQuK+VgQPDXV9hCJjBwcFYU5pLwwHXQcMKSmNLQcIAExlbH8JBwttaX0ABAcNbWVbKyEAIfkEAAoABgAsAAAAABAAEAAABXkgIAICSRBlOY7CIghN8zbEKsKoIjdFzZaEgUBHKChMJtRwcWpAWoWnifm6ESAMhO8lQK0EEAV3rFopIBCEcGwDKAqPh4HUrY4ICHH1dSoTFgcHUiZjBhAJB2AHDykpKAwHAwdzf19KkASIPl9cDgcnDkdtNwiMJCshACH5BAAKAAcALAAAAAAQABAAAAV3ICACAkkQZTmOAiosiyAoxCq+KPxCNVsSMRgBsiClWrLTSWFoIQZHl6pleBh6suxKMIhlvzbAwkBWfFWrBQTxNLq2RG2yhSUkDs2b63AYDAoJXAcFRwADeAkJDX0AQCsEfAQMDAIPBz0rCgcxky0JRWE1AmwpKyEAIfkEAAoACAAsAAAAABAAEAAABXkgIAICKZzkqJ4nQZxLqZKv4NqNLKK2/Q4Ek4lFXChsg5ypJjs1II3gEDUSRInEGYAw6B6zM4JhrDAtEosVkLUtHA7RHaHAGJQEjsODcEg0FBAFVgkQJQ1pAwcDDw8KcFtSInwJAowCCA6RIwqZAgkPNgVpWndjdyohACH5BAAKAAkALAAAAAAQABAAAAV5ICACAimc5KieLEuUKvm2xAKLqDCfC2GaO9eL0LABWTiBYmA06W6kHgvCqEJiAIJiu3gcvgUsscHUERm+kaCxyxa+zRPk0SgJEgfIvbAdIAQLCAYlCj4DBw0IBQsMCjIqBAcPAooCBg9pKgsJLwUFOhCZKyQDA3YqIQAh+QQACgAKACwAAAAAEAAQAAAFdSAgAgIpnOSonmxbqiThCrJKEHFbo8JxDDOZYFFb+A41E4H4OhkOipXwBElYITDAckFEOBgMQ3arkMkUBdxIUGZpEb7kaQBRlASPg0FQQHAbEEMGDSVEAA1QBhAED1E0NgwFAooCDWljaQIQCE5qMHcNhCkjIQAh+QQACgALACwAAAAAEAAQAAAFeSAgAgIpnOSoLgxxvqgKLEcCC65KEAByKK8cSpA4DAiHQ/DkKhGKh4ZCtCyZGo6F6iYYPAqFgYy02xkSaLEMV34tELyRYNEsCQyHlvWkGCzsPgMCEAY7Cg04Uk48LAsDhRA8MVQPEF0GAgqYYwSRlycNcWskCkApIyEAOwAAAAAAAAAAAA==');background-repeat:no-repeat}.leaflet-control-layer-container,.leaflet-control-loading,.leaflet-control-zoom a.leaflet-control-loading,.leaflet-control-zoomslider a.leaflet-control-loading{display:none}.leaflet-control-layer-container.is-loading,.leaflet-control-loading.is-loading,.leaflet-control-zoom a.leaflet-control-loading.is-loading,.leaflet-control-zoomslider a.leaflet-control-loading.is-loading{display:block}.leaflet-bar-part-bottom{border-bottom:medium none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}
|
||||||
@@ -4,19 +4,22 @@ Leaflet.loading
|
|||||||
Leaflet.loading is a simple loading control for [Leaflet][]. An unobtrusive
|
Leaflet.loading is a simple loading control for [Leaflet][]. An unobtrusive
|
||||||
loading indicator is added below the zoom control if one exists. The indicator
|
loading indicator is added below the zoom control if one exists. The indicator
|
||||||
is visible when tiles are loading or when other data is loading, as indicated by
|
is visible when tiles are loading or when other data is loading, as indicated by
|
||||||
firing custom events on a map. The indicator can be an image, or a [spin.js][]
|
firing custom events on a map. The indicator can be an image, or a [spin.js][]
|
||||||
spinner (image-less).
|
spinner (image-less).
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Leaflet.loading is only tested on Leaflet version 0.6 or greater. It will almost
|
Leaflet.loading is only tested on Leaflet version 0.6 or greater. It will almost
|
||||||
certainly not work with older versions of Leaflet.
|
certainly not work with older versions of Leaflet. Of course we intend to
|
||||||
|
support Leaflet 1.0, and we have tested against the latest release (beta 2).
|
||||||
|
Please create an issue if you find that any part of this project is not
|
||||||
|
compatible with Leaflet 1.0.
|
||||||
|
|
||||||
Include `Control.Loading.js` and `Control.Loading.css`, then create a map with
|
Include `Control.Loading.js` and `Control.Loading.css`, then create a map with
|
||||||
`loadingControl: true` in its options.
|
`loadingControl: true` in its options.
|
||||||
|
|
||||||
By default, Leaflet.loading includes a base64-encoded animagted loading image in
|
By default, Leaflet.loading includes a base64-encoded animagted loading image in
|
||||||
`Control.Loading.css`. You can customize this by changing `background-image` for
|
`Control.Loading.css`. You can customize this by changing `background-image` for
|
||||||
the selector `.leaflet-control-loading`. The simplest case would be adding a 16
|
the selector `.leaflet-control-loading`. The simplest case would be adding a 16
|
||||||
x 16 loading gif in `.leaflet-control-loading`.
|
x 16 loading gif in `.leaflet-control-loading`.
|
||||||
@@ -28,13 +31,14 @@ initializing the control.
|
|||||||
Whichever method you use, make sure you only use one.
|
Whichever method you use, make sure you only use one.
|
||||||
|
|
||||||
Once the above is complete you will have a loading indicator that only appears
|
Once the above is complete you will have a loading indicator that only appears
|
||||||
when tiles are loading.
|
when tiles are loading.
|
||||||
|
|
||||||
If you want to show the loading indicator while other AJAX requests or something
|
If you want to show the loading indicator while other AJAX requests or something
|
||||||
else is occurring, simply fire the `dataloading` event on your map when you
|
else is occurring, fire the `dataloading` event on your map when you begin
|
||||||
begin loading and `dataload` when you are finished loading. The control tracks
|
loading and `dataload` when you are finished loading. Please note that there is
|
||||||
the number of concurrent loaders, so it is your responsibility to ensure that
|
[an issue](https://github.com/ebrelsford/Leaflet.loading/issues/26) with the
|
||||||
the `dataloading` and `dataload` are called symmetrically.
|
way this control tracks these events and that this will be re-worked in a
|
||||||
|
future version.
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
|
|
||||||
@@ -43,20 +47,22 @@ the `dataloading` and `dataload` are called symmetrically.
|
|||||||
- **separate**: (boolean) Whether the control should be separate from the zoom
|
- **separate**: (boolean) Whether the control should be separate from the zoom
|
||||||
control or not, defaults to false.
|
control or not, defaults to false.
|
||||||
- **zoomControl**: (L.Control.Zoom) The zoom control that the control should be
|
- **zoomControl**: (L.Control.Zoom) The zoom control that the control should be
|
||||||
added to. This is only necessary when adding a loading control to a zoom
|
added to. This is only necessary when adding a loading control to a zoom
|
||||||
control that you added manually and do not want a separate loading control.
|
control that you added manually and do not want a separate loading control.
|
||||||
- **spinjs**: (boolean) Enable the use of [spin.js][]. Optional, defaults to
|
- **delayIndicator**: (float) The number of milliseconds to wait before
|
||||||
|
showing the loading indicator. Defaults to `null` (no delay).
|
||||||
|
- **spinjs**: (boolean) Enable the use of [spin.js][]. Optional, defaults to
|
||||||
`false`
|
`false`
|
||||||
- **spin**: (object) A [spin.js][] options object. Optional, defaults to
|
- **spin**: (object) A [spin.js][] options object. Optional, defaults to
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
lines: 7,
|
lines: 7,
|
||||||
length: 3,
|
length: 3,
|
||||||
width: 3,
|
width: 3,
|
||||||
radius: 5,
|
radius: 5,
|
||||||
rotate: 13,
|
rotate: 13,
|
||||||
top: "83%"
|
top: "83%"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet.loading",
|
"name": "leaflet.loading",
|
||||||
"version": "0.1.16",
|
"version": "0.1.24",
|
||||||
"homepage": "https://github.com/ebrelsford/leaflet.loading",
|
"homepage": "https://github.com/ebrelsford/leaflet.loading",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Eric Brelsford <ebrelsford@gmail.com>"
|
"Eric Brelsford <ebrelsford@gmail.com>"
|
||||||
],
|
],
|
||||||
"description": "A loading-indicator control for Leaflet",
|
"description": "A loading-indicator control for Leaflet",
|
||||||
"main": "src/Control.Loading.js",
|
"main": [
|
||||||
|
"src/Control.Loading.css",
|
||||||
|
"src/Control.Loading.js"
|
||||||
|
],
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"leaflet",
|
"leaflet",
|
||||||
"map",
|
"map",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet-loading",
|
"name": "leaflet-loading",
|
||||||
"version": "0.1.16",
|
"version": "0.1.24",
|
||||||
"description": "A simple loading control for Leaflet",
|
"description": "A simple loading control for Leaflet",
|
||||||
"main": "src/Control.Loading.js",
|
"main": "src/Control.Loading.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -3,7 +3,80 @@ Leaflet.markercluster
|
|||||||
|
|
||||||
(all changes without author notice are by [@danzel](https://github.com/danzel))
|
(all changes without author notice are by [@danzel](https://github.com/danzel))
|
||||||
|
|
||||||
## Master
|
## 1.0.2 (2016-01-27)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* Support `layeradd` and `layerremove` events [#647](https://github.com/Leaflet/Leaflet.markercluster/issues/647)
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
|
||||||
|
* Add support for maps with negative minZoom [#704](https://github.com/Leaflet/Leaflet.markercluster/issues/704)
|
||||||
|
* Fixed zoomToShowLayer() markers disappearing bug (by [@z3ut](https://github.com/z3ut)) [#739](https://github.com/Leaflet/Leaflet.markercluster/issues/739)
|
||||||
|
* Fix an issue when opening a popup inside of zoomToShowLayer
|
||||||
|
* If a marker is moved with an open popup on it, re-open the popup after moving it. [#651](https://github.com/Leaflet/Leaflet.markercluster/issues/651)
|
||||||
|
|
||||||
|
|
||||||
|
## 1.0.1 (2016-01-25)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* Add install and build steps with jake (by [@kazes](https://github.com/kazes)) [#733](https://github.com/Leaflet/Leaflet.markercluster/pull/733)
|
||||||
|
* Readme improvements (by [@ghybs](https://github.com/ghybs), [@bertyhell](https://github.com/bertyhell)) [#734](https://github.com/Leaflet/Leaflet.markercluster/pull/738), [#734](https://github.com/Leaflet/Leaflet.markercluster/pull/738
|
||||||
|
* Bump all examples to leaflet 1.0.3
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
|
||||||
|
* Fixed leaflet 1.0.2 bug where clearLayers would throw an exception (by [@marcianoviereck92](https://github.com/marcianoviereck92)) [#746](https://github.com/Leaflet/Leaflet.markercluster/pull/746)
|
||||||
|
|
||||||
|
|
||||||
|
## 1.0.0 (2016-10-03)
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
* Compatibility with Leaflet 1.0.0 (by [@danzel](https://githum.com/danzel), [@Eschon](https://github.com/Eschon), [@ghybs](https://github.com/ghybs), [@IvanSanchez](https://github.com/IvanSanchez))
|
||||||
|
* Support moving markers [#57](https://github.com/Leaflet/Leaflet.markercluster/issues/57)
|
||||||
|
* chunkedLoading option to keep browser more responsive during larging a load data set [#292](https://github.com/Leaflet/Leaflet.markercluster/issues/292)
|
||||||
|
* maxClusterRadius can be a function (by [@Schwanksta](https://github.com/Schwanksta)) [#298](https://github.com/Leaflet/Leaflet.markercluster/issues/298)
|
||||||
|
* Spiderfy without zooming when all markers at same location (by [@rdenniston](https://github.com/rdenniston), [@ghybs](https://github.com/ghybs)) [#415](https://github.com/Leaflet/Leaflet.markercluster/issues/415), [#606](https://github.com/Leaflet/Leaflet.markercluster/issues/606)
|
||||||
|
* On becoming visible, markers retain their original opacity. (by [@IvanSanchez](https://github.com/IvanSanchez)) [#444](https://github.com/Leaflet/Leaflet.markercluster/issues/444)
|
||||||
|
* Spiderleg Polyline options (by [@mikeatlas](https://github.com/mikeatlas)) [#466](https://github.com/Leaflet/Leaflet.markercluster/issues/466)
|
||||||
|
* Extra methods to allow refreshing cluster icons (by [@ghybs](https://github.com/ghybs)) [#564](https://github.com/Leaflet/Leaflet.markercluster/issues/564)
|
||||||
|
* Ability to disable animations (by [@ghybs](https://github.com/ghybs)) [#578](https://github.com/Leaflet/Leaflet.markercluster/issues/578)
|
||||||
|
* Optimized performance of bulk addLayers and removeLayers (by [@ghybs](https://github.com/ghybs)) [#584](https://github.com/Leaflet/Leaflet.markercluster/issues/584)
|
||||||
|
* Replaced spiderfy legs animation from SMIL to CSS transition (by [@ghybs](https://github.com/ghybs)) [#585](https://github.com/Leaflet/Leaflet.markercluster/issues/585)
|
||||||
|
* Provide more detailed context information on the spiderfied event (by [@evanvosberg](https://github.com/evanvosberg)) [#421](https://github.com/Leaflet/Leaflet.markercluster/issues/421)
|
||||||
|
* Add unspiderfied event
|
||||||
|
* Readme updates (by [@ghybs](https://github.com/ghybs), [@tomchadwin](https://github.com/tomchadwin) [@Cyrille37](https://github.com/Cyrille37) [@franckl](https://github.com/franckl) [@mikeatlas](https://github.com/mikeatlas)
|
||||||
|
[@rdenniston](https://github.com/rdenniston) [@maackle](https://github.com/maackle) [@fureigh](https://github.com/fureigh) [@Wildhoney](https://github.com/Wildhoney) [@Schwanksta](https://github.com/Schwanksta) [@frankrowe](https://github.com/frankrowe))
|
||||||
|
* Improve adding and removing nested LayerGroups (by [@ghybs](https://github.com/ghybs)) [#624](https://github.com/Leaflet/Leaflet.markercluster/pull/624)
|
||||||
|
* Add public unspiderfy method (by [@zverev](https://github.com/zverev)) [#617](https://github.com/Leaflet/Leaflet.markercluster/pull/617)
|
||||||
|
* Optimized performance of bulk add with complex icon create function (by [@mlazowik](https://github.com/mlazowik)) [#697](https://github.com/Leaflet/Leaflet.markercluster/pull/697)
|
||||||
|
* Remove leaflet from peerDependencies (by [@tyleralves](https://github.com/tyleralves)) [#703](https://github.com/Leaflet/Leaflet.markercluster/pull/703)
|
||||||
|
* Simplified _recursively (by [@ghybs](https://github.com/ghybs)) [#656](https://github.com/Leaflet/Leaflet.markercluster/pull/656)
|
||||||
|
|
||||||
|
### Bugfixes
|
||||||
|
|
||||||
|
* Fix getBounds when removeOutsideVisibleBounds: false is set. [#321](https://github.com/Leaflet/Leaflet.markercluster/issues/321)
|
||||||
|
* Fix zoomToShowLayer fails after initial spiderfy [#286](https://github.com/Leaflet/Leaflet.markercluster/issues/286)
|
||||||
|
* Fix cluster not disappearing on Android [#344](https://github.com/Leaflet/Leaflet.markercluster/issues/344)
|
||||||
|
* Fix RemoveLayers() when spiderified (by [@Grsmto](https://github.com/Grsmto)) [#358](https://github.com/Leaflet/Leaflet.markercluster/issues/358)
|
||||||
|
* Remove lines from map when removing cluster (by [@olive380](https://github.com/olive380)) [#532](https://github.com/Leaflet/Leaflet.markercluster/issues/532)
|
||||||
|
* Fix getConvexHull when all markers are located at same latitude (by [@olive380](https://github.com/olive380)) [#533](https://github.com/Leaflet/Leaflet.markercluster/issues/533)
|
||||||
|
* Fix removeLayers when cluster is not on the map (by [@eschon](https://github.com/eschon)) [#556](https://github.com/Leaflet/Leaflet.markercluster/issues/556)
|
||||||
|
* Improved zoomToShowLayer with callback check (by [@ghybs](https://github.com/ghybs)) [#572](https://github.com/Leaflet/Leaflet.markercluster/issues/572)
|
||||||
|
* Improved reliability of RefreshSpec test suite for PhantomJS (by [@ghybs](https://github.com/ghybs)) [#577](https://github.com/Leaflet/Leaflet.markercluster/issues/577)
|
||||||
|
* Corrected effect of removeOutsideVisibleBounds option (by [@ghybs](https://github.com/ghybs)) [#575](https://github.com/Leaflet/Leaflet.markercluster/issues/575)
|
||||||
|
* Fix getLayer when provided a string [#531](https://github.com/Leaflet/Leaflet.markercluster/issues/531)
|
||||||
|
* Documentation improvements (by [@ghybs](https://github.com/ghybs)) [#579](https://github.com/Leaflet/Leaflet.markercluster/issues/579)
|
||||||
|
* Correct _getExpandedVisibleBounds for Max Latitude (by [@ghybs](https://github.com/ghybs)) [#587](https://github.com/Leaflet/Leaflet.markercluster/issues/587)
|
||||||
|
* Correct unspiderfy vector (by [@ghybs](https://github.com/ghybs)) [#604](https://github.com/Leaflet/Leaflet.markercluster/issues/604)
|
||||||
|
* Remove "leaflet-cluster-anim" class on map remove while spiderfied (by [@ghybs](https://github.com/ghybs)) [#607](https://github.com/Leaflet/Leaflet.markercluster/issues/607)
|
||||||
|
* Fix disableClusteringAtZoom maxZoom troubles (by [@OriginalSin](https://github.com/OriginalSin)) [#609](https://github.com/Leaflet/Leaflet.markercluster/issues/609)
|
||||||
|
* Fix clusters not disappearing when they were near the edge on mobile (by [@ghybs](https://github.com/ghybs)) [#529](https://github.com/Leaflet/Leaflet.markercluster/issues/529)
|
||||||
|
* Remove leaflet from dependencies (by [@ghybs](https://github.com/ghybs)) [#639](https://github.com/Leaflet/Leaflet.markercluster/issues/639)
|
||||||
|
* Fix interaction between zoomOrSpiderfy and disableClusteringAtZoom (by [@ghybs](https://github.com/ghybs)) [#633](https://github.com/Leaflet/Leaflet.markercluster/issues/633) [#648](https://github.com/Leaflet/Leaflet.markercluster/issues/648)
|
||||||
|
|
||||||
|
|
||||||
##0.4 (2013-12-19)
|
##0.4 (2013-12-19)
|
||||||
|
|
||||||
@@ -16,6 +89,7 @@ Leaflet.markercluster
|
|||||||
|
|
||||||
* Fix some cases zoomToShowLayer wouldn't work (Reported by [@absemetov](https://github.com/absemetov)) [#203](https://github.com/Leaflet/Leaflet.markercluster/issues/203) [#228](https://github.com/Leaflet/Leaflet.markercluster/issues/228) [#286](https://github.com/Leaflet/Leaflet.markercluster/issues/286)
|
* Fix some cases zoomToShowLayer wouldn't work (Reported by [@absemetov](https://github.com/absemetov)) [#203](https://github.com/Leaflet/Leaflet.markercluster/issues/203) [#228](https://github.com/Leaflet/Leaflet.markercluster/issues/228) [#286](https://github.com/Leaflet/Leaflet.markercluster/issues/286)
|
||||||
|
|
||||||
|
|
||||||
##0.3 (2013-12-18)
|
##0.3 (2013-12-18)
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|||||||
@@ -3,4 +3,12 @@
|
|||||||
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
|
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
|
||||||
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
|
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
|
||||||
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
|
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.leaflet-cluster-spider-leg {
|
||||||
|
/* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */
|
||||||
|
-webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;
|
||||||
|
-moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;
|
||||||
|
-o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;
|
||||||
|
transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,77 +3,148 @@ Leaflet.markercluster
|
|||||||
|
|
||||||
Provides Beautiful Animated Marker Clustering functionality for [Leaflet](http://leafletjs.com), a JS library for interactive maps.
|
Provides Beautiful Animated Marker Clustering functionality for [Leaflet](http://leafletjs.com), a JS library for interactive maps.
|
||||||
|
|
||||||
*Requires Leaflet 0.7.0 or newer.*
|
*Requires Leaflet 1.0.0*
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
For a Leaflet 0.7 compatible version, [use the leaflet-0.7 branch](https://github.com/Leaflet/Leaflet.markercluster/tree/leaflet-0.7)<br>
|
||||||
For a Leaflet 0.5 compatible version, [Download b128e950](https://github.com/Leaflet/Leaflet.markercluster/archive/b128e950d8f5d7da5b60bd0aa9a88f6d3dd17c98.zip)<br>
|
For a Leaflet 0.5 compatible version, [Download b128e950](https://github.com/Leaflet/Leaflet.markercluster/archive/b128e950d8f5d7da5b60bd0aa9a88f6d3dd17c98.zip)<br>
|
||||||
For a Leaflet 0.4 compatible version, [Download the 0.2 release](https://github.com/Leaflet/Leaflet.markercluster/archive/0.2.zip)
|
For a Leaflet 0.4 compatible version, [Download the 0.2 release](https://github.com/Leaflet/Leaflet.markercluster/archive/0.2.zip)
|
||||||
|
|
||||||
|
<!---
|
||||||
|
TOC created with gh-md-toc
|
||||||
|
https://github.com/ekalinin/github-markdown-toc
|
||||||
|
removed link to h1 and indented back 2 spaces all links.
|
||||||
|
-->
|
||||||
|
## Table of Contents
|
||||||
|
* [Using the plugin](#using-the-plugin)
|
||||||
|
* [Building, testing and linting scripts](#building-testing-and-linting-scripts)
|
||||||
|
* [Examples](#examples)
|
||||||
|
* [Usage](#usage)
|
||||||
|
* [Options](#options)
|
||||||
|
* [Defaults](#defaults)
|
||||||
|
* [Customising the Clustered Markers](#customising-the-clustered-markers)
|
||||||
|
* [All Options](#all-options)
|
||||||
|
* [Enabled by default (boolean options)](#enabled-by-default-boolean-options)
|
||||||
|
* [Other options](#other-options)
|
||||||
|
* [Chunked addLayers options](#chunked-addlayers-options)
|
||||||
|
* [Events](#events)
|
||||||
|
* [Additional MarkerClusterGroup Events](#additional-markerclustergroup-events)
|
||||||
|
* [Methods](#methods)
|
||||||
|
* [Group methods](#group-methods)
|
||||||
|
* [Adding and removing Markers](#adding-and-removing-markers)
|
||||||
|
* [Bulk adding and removing Markers](#bulk-adding-and-removing-markers)
|
||||||
|
* [Getting the visible parent of a marker](#getting-the-visible-parent-of-a-marker)
|
||||||
|
* [Refreshing the clusters icon](#refreshing-the-clusters-icon)
|
||||||
|
* [Other Group Methods](#other-group-methods)
|
||||||
|
* [Clusters methods](#clusters-methods)
|
||||||
|
* [Getting the bounds of a cluster](#getting-the-bounds-of-a-cluster)
|
||||||
|
* [Zooming to the bounds of a cluster](#zooming-to-the-bounds-of-a-cluster)
|
||||||
|
* [Other clusters methods](#other-clusters-methods)
|
||||||
|
* [Handling LOTS of markers](#handling-lots-of-markers)
|
||||||
|
* [License](#license)
|
||||||
|
* [Sub-plugins](#sub-plugins)
|
||||||
|
|
||||||
|
|
||||||
## Using the plugin
|
## Using the plugin
|
||||||
|
Include the plugin CSS and JS files on your page after Leaflet files, using your method of choice:
|
||||||
|
* [Download the `v1.0.0` release](https://github.com/Leaflet/Leaflet.markercluster/archive/v1.0.0.zip)
|
||||||
|
* Use unpkg CDN: `https://unpkg.com/leaflet.markercluster@1.0.0/dist/`
|
||||||
|
* Install with npm: `npm install leaflet.markercluster`
|
||||||
|
|
||||||
Install with Bower: `bower install leaflet.markercluster`
|
In each case, use files in the `dist` folder:
|
||||||
|
* `MarkerCluster.css`
|
||||||
|
* `MarkerCluster.Default.css` (not needed if you use your own `iconCreateFunction` instead of the default one)
|
||||||
|
* `leaflet.markercluster.js` (or `leaflet.markercluster-src.js` for the non-minified version)
|
||||||
|
|
||||||
|
### Building, testing and linting scripts
|
||||||
|
Install jake `npm install -g jake` then run `npm install`
|
||||||
|
* To check the code for errors and build Leaflet from source, run `jake`.
|
||||||
|
* To run the tests, run `jake test`.
|
||||||
|
* For a custom build, open `build/build.html` in the browser and follow the instructions
|
||||||
|
|
||||||
|
### Examples
|
||||||
See the included examples for usage.
|
See the included examples for usage.
|
||||||
|
|
||||||
The [realworld example](http://leaflet.github.com/Leaflet.markercluster/example/marker-clustering-realworld.388.html) is a good place to start, it uses all of the defaults of the clusterer.
|
The [realworld example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html) is a good place to start, it uses all of the defaults of the clusterer.
|
||||||
Or check out the [custom example](http://leaflet.github.com/Leaflet.markercluster/example/marker-clustering-custom.html) for how to customise the behaviour and appearance of the clusterer
|
Or check out the [custom example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-custom.html) for how to customise the behaviour and appearance of the clusterer
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
Create a new MarkerClusterGroup, add your markers to it, then add it to the map
|
Create a new MarkerClusterGroup, add your markers to it, then add it to the map
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var markers = new L.MarkerClusterGroup();
|
var markers = L.markerClusterGroup();
|
||||||
markers.addLayer(new L.Marker(getRandomLatLng(map)));
|
markers.addLayer(L.marker(getRandomLatLng(map)));
|
||||||
... Add more layers ...
|
... Add more layers ...
|
||||||
map.addLayer(markers);
|
map.addLayer(markers);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Options
|
||||||
### Defaults
|
### Defaults
|
||||||
By default the Clusterer enables some nice defaults for you:
|
By default the Clusterer enables some nice defaults for you:
|
||||||
* **showCoverageOnHover**: When you mouse over a cluster it shows the bounds of its markers.
|
* **showCoverageOnHover**: When you mouse over a cluster it shows the bounds of its markers.
|
||||||
* **zoomToBoundsOnClick**: When you click a cluster we zoom to its bounds.
|
* **zoomToBoundsOnClick**: When you click a cluster we zoom to its bounds.
|
||||||
* **spiderfyOnMaxZoom**: When you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers. (*Note: the spiderfy occurs at the current zoom level if all items within the cluster are physically located at the same latitude and longitude.*)
|
* **spiderfyOnMaxZoom**: When you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers. (*Note: the spiderfy occurs at the current zoom level if all items within the cluster are still clustered at the maximum zoom level or at zoom specified by `disableClusteringAtZoom` option*)
|
||||||
* **removeOutsideVisibleBounds**: Clusters and markers too far from the viewport are removed from the map for performance.
|
* **removeOutsideVisibleBounds**: Clusters and markers too far from the viewport are removed from the map for performance.
|
||||||
* **spiderLegPolylineOptions**: Allows you to specify [PolylineOptions](http://leafletjs.com/reference.html#polyline-options) to style spider legs. By default, they are `{ weight: 1.5, color: '#222' }`.
|
* **spiderLegPolylineOptions**: Allows you to specify [PolylineOptions](http://leafletjs.com/reference.html#polyline-options) to style spider legs. By default, they are `{ weight: 1.5, color: '#222', opacity: 0.5 }`.
|
||||||
|
|
||||||
You can disable any of these as you want in the options when you create the MarkerClusterGroup:
|
You can disable any of these as you want in the options when you create the MarkerClusterGroup:
|
||||||
```javascript
|
```javascript
|
||||||
var markers = new L.MarkerClusterGroup({ spiderfyOnMaxZoom: false, showCoverageOnHover: false, zoomToBoundsOnClick: false });
|
var markers = L.markerClusterGroup({
|
||||||
|
spiderfyOnMaxZoom: false,
|
||||||
|
showCoverageOnHover: false,
|
||||||
|
zoomToBoundsOnClick: false
|
||||||
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
### Customising the Clustered Markers
|
### Customising the Clustered Markers
|
||||||
As an option to MarkerClusterGroup you can provide your own function for creating the Icon for the clustered markers.
|
As an option to MarkerClusterGroup you can provide your own function for creating the Icon for the clustered markers.
|
||||||
The default implementation changes color at bounds of 10 and 100, but more advanced uses may require customising this.
|
The default implementation changes color at bounds of 10 and 100, but more advanced uses may require customising this.
|
||||||
You do not need to include the .Default css if you go this way.
|
You do not need to include the .Default css if you go this way.
|
||||||
You are passed a MarkerCluster object, you'll probably want to use getChildCount() or getAllChildMarkers() to work out the icon to show
|
You are passed a MarkerCluster object, you'll probably want to use `getChildCount()` or `getAllChildMarkers()` to work out the icon to show.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var markers = new L.MarkerClusterGroup({
|
var markers = L.markerClusterGroup({
|
||||||
iconCreateFunction: function(cluster) {
|
iconCreateFunction: function(cluster) {
|
||||||
return new L.DivIcon({ html: '<b>' + cluster.getChildCount() + '</b>' });
|
return L.divIcon({ html: '<b>' + cluster.getChildCount() + '</b>' });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
Check out the [custom example](http://leaflet.github.com/Leaflet.markercluster/example/marker-clustering-custom.html) for an example of this.
|
Check out the [custom example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-custom.html) for an example of this.
|
||||||
|
|
||||||
|
If you need to update the clusters icon (e.g. they are based on markers real-time data), use the method [refreshClusters()](#refreshing-the-clusters-icon).
|
||||||
|
|
||||||
### All Options
|
### All Options
|
||||||
Enabled by default (boolean options):
|
#### Enabled by default (boolean options)
|
||||||
* **showCoverageOnHover**: When you mouse over a cluster it shows the bounds of its markers.
|
* **showCoverageOnHover**: When you mouse over a cluster it shows the bounds of its markers.
|
||||||
* **zoomToBoundsOnClick**: When you click a cluster we zoom to its bounds.
|
* **zoomToBoundsOnClick**: When you click a cluster we zoom to its bounds.
|
||||||
* **spiderfyOnMaxZoom**: When you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers. (*Note: the spiderfy occurs at the current zoom level if all items within the cluster are physically located at the same latitude and longitude.*)
|
* **spiderfyOnMaxZoom**: When you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers. (*Note: the spiderfy occurs at the current zoom level if all items within the cluster are still clustered at the maximum zoom level or at zoom specified by `disableClusteringAtZoom` option*).
|
||||||
* **removeOutsideVisibleBounds**: Clusters and markers too far from the viewport are removed from the map for performance.
|
* **removeOutsideVisibleBounds**: Clusters and markers too far from the viewport are removed from the map for performance.
|
||||||
|
* **animate**: Smoothly split / merge cluster children when zooming and spiderfying. If `L.DomUtil.TRANSITION` is false, this option has no effect (no animation is possible).
|
||||||
|
|
||||||
Other options
|
#### Other options
|
||||||
* **animateAddingMarkers**: If set to true then adding individual markers to the MarkerClusterGroup after it has been added to the map will add the marker and animate it in to the cluster. Defaults to false as this gives better performance when bulk adding markers. addLayers does not support this, only addLayer with individual Markers.
|
* **animateAddingMarkers**: If set to true (and `animate` option is also true) then adding individual markers to the MarkerClusterGroup after it has been added to the map will add the marker and animate it into the cluster. Defaults to false as this gives better performance when bulk adding markers. addLayers does not support this, only addLayer with individual Markers.
|
||||||
* **disableClusteringAtZoom**: If set, at this zoom level and below markers will not be clustered. This defaults to disabled. [See Example](http://leaflet.github.com/Leaflet.markercluster/example/marker-clustering-realworld-maxzoom.388.html)
|
* **disableClusteringAtZoom**: If set, at this zoom level and below, markers will not be clustered. This defaults to disabled. [See Example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld-maxzoom.388.html). Note: you may be interested in disabling `spiderfyOnMaxZoom` option when using `disableClusteringAtZoom`.
|
||||||
* **maxClusterRadius**: The maximum radius that a cluster will cover from the central marker (in pixels). Default 80. Decreasing will make more, smaller clusters. You can also use a function that accepts the current map zoom and returns the maximum cluster radius in pixels.
|
* **maxClusterRadius**: The maximum radius that a cluster will cover from the central marker (in pixels). Default 80. Decreasing will make more, smaller clusters. You can also use a function that accepts the current map zoom and returns the maximum cluster radius in pixels.
|
||||||
* **polygonOptions**: Options to pass when creating the L.Polygon(points, options) to show the bounds of a cluster
|
* **polygonOptions**: Options to pass when creating the L.Polygon(points, options) to show the bounds of a cluster. Defaults to empty, which lets Leaflet use the [default Path options](http://leafletjs.com/reference.html#path-options).
|
||||||
* **singleMarkerMode**: If set to true, overrides the icon for all added markers to make them appear as a 1 size cluster
|
* **singleMarkerMode**: If set to true, overrides the icon for all added markers to make them appear as a 1 size cluster. Note: the markers are not replaced by cluster objects, only their icon is replaced. Hence they still react to normal events, and option `disableClusteringAtZoom` does not restore their previous icon (see [#391](https://github.com/Leaflet/Leaflet.markercluster/issues/391)).
|
||||||
* **spiderfyDistanceMultiplier**: Increase from 1 to increase the distance away from the center that spiderfied markers are placed. Use if you are using big marker icons (Default:1)
|
* **spiderLegPolylineOptions**: Allows you to specify [PolylineOptions](http://leafletjs.com/reference.html#polyline-options) to style spider legs. By default, they are `{ weight: 1.5, color: '#222', opacity: 0.5 }`.
|
||||||
|
* **spiderfyDistanceMultiplier**: Increase from 1 to increase the distance away from the center that spiderfied markers are placed. Use if you are using big marker icons (Default: 1).
|
||||||
* **iconCreateFunction**: Function used to create the cluster icon [See default as example](https://github.com/Leaflet/Leaflet.markercluster/blob/15ed12654acdc54a4521789c498e4603fe4bf781/src/MarkerClusterGroup.js#L542).
|
* **iconCreateFunction**: Function used to create the cluster icon [See default as example](https://github.com/Leaflet/Leaflet.markercluster/blob/15ed12654acdc54a4521789c498e4603fe4bf781/src/MarkerClusterGroup.js#L542).
|
||||||
|
|
||||||
|
#### Chunked addLayers options
|
||||||
|
Options for the [addLayers](#bulk-adding-and-removing-markers) method. See [#357](https://github.com/Leaflet/Leaflet.markercluster/issues/357) for explanation on how the chunking works.
|
||||||
|
* **chunkedLoading**: Boolean to split the addLayer**s** processing in to small intervals so that the page does not freeze.
|
||||||
|
* **chunkInterval**: Time interval (in ms) during which addLayers works before pausing to let the rest of the page process. In particular, this prevents the page from freezing while adding a lot of markers. Defaults to 200ms.
|
||||||
|
* **chunkDelay**: Time delay (in ms) between consecutive periods of processing for addLayers. Default to 50ms.
|
||||||
|
* **chunkProgress**: Callback function that is called at the end of each chunkInterval. Typically used to implement a progress indicator, e.g. [code in RealWorld 50k](https://github.com/Leaflet/Leaflet.markercluster/blob/master/example/marker-clustering-realworld.50000.html#L33-L49). Defaults to null. Arguments:
|
||||||
|
1. Number of processed markers
|
||||||
|
2. Total number of markers being added
|
||||||
|
3. Elapsed time (in ms)
|
||||||
|
|
||||||
## Events
|
## Events
|
||||||
If you register for click, mouseover, etc events just related to Markers in the cluster.
|
Leaflet events like `click`, `mouseover`, etc. are just related to _Markers_ in the cluster.
|
||||||
To receive events for clusters listen to 'cluster' + 'eventIWant', ex: 'clusterclick', 'clustermouseover'.
|
To receive events for clusters, listen to `'cluster' + '<eventName>'`, ex: `clusterclick`, `clustermouseover`, `clustermouseout`.
|
||||||
|
|
||||||
Set your callback up as follows to handle both cases:
|
Set your callback up as follows to handle both cases:
|
||||||
|
|
||||||
@@ -83,68 +154,135 @@ markers.on('click', function (a) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
markers.on('clusterclick', function (a) {
|
markers.on('clusterclick', function (a) {
|
||||||
|
// a.layer is actually a cluster
|
||||||
console.log('cluster ' + a.layer.getAllChildMarkers().length);
|
console.log('cluster ' + a.layer.getAllChildMarkers().length);
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Additional MarkerClusterGroup Events
|
### Additional MarkerClusterGroup Events
|
||||||
|
|
||||||
- **animationend**: Fires when marker clustering/unclustering animation has completed
|
- **animationend**: Fires when marker clustering/unclustering animation has completed
|
||||||
- **spiderfied**: Fires when overlapping markers get spiderified
|
- **spiderfied**: Fires when overlapping markers get spiderified (Contains ```cluster``` and ```markers``` attributes)
|
||||||
|
- **unspiderfied**: Fires when overlapping markers get unspiderified (Contains ```cluster``` and ```markers``` attributes)
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
### Getting the bounds of a cluster
|
### Group methods
|
||||||
|
|
||||||
|
#### Adding and removing Markers
|
||||||
|
`addLayer`, `removeLayer` and `clearLayers` are supported and they should work for most uses.
|
||||||
|
|
||||||
|
#### Bulk adding and removing Markers
|
||||||
|
`addLayers` and `removeLayers` are bulk methods for adding and removing markers and should be favoured over the single versions when doing bulk addition/removal of markers. Each takes an array of markers. You can use [dedicated options](#chunked-addlayers-options) to fine-tune the behaviour of `addLayers`.
|
||||||
|
|
||||||
|
These methods extract non-group layer children from Layer Group types, even deeply nested. _However_, be noted that:
|
||||||
|
- `chunkProgress` jumps backward when `addLayers` finds a group (since appending its children to the input array makes the total increase).
|
||||||
|
- Groups are not actually added into the MarkerClusterGroup, only their non-group child layers. Therfore, `hasLayer` method will return `true` for non-group child layers, but `false` on any (possibly parent) Layer Group types.
|
||||||
|
|
||||||
|
If you are removing a lot of markers it will almost definitely be better to call `clearLayers` then call `addLayers` to add the markers you don't want to remove back in. See [#59](https://github.com/Leaflet/Leaflet.markercluster/issues/59#issuecomment-9320628) for details.
|
||||||
|
|
||||||
|
#### Getting the visible parent of a marker
|
||||||
|
If you have a marker in your MarkerClusterGroup and you want to get the visible parent of it (Either itself or a cluster it is contained in that is currently visible on the map).
|
||||||
|
This will return null if the marker and its parent clusters are not visible currently (they are not near the visible viewpoint)
|
||||||
|
```javascript
|
||||||
|
var visibleOne = markerClusterGroup.getVisibleParent(myMarker);
|
||||||
|
console.log(visibleOne.getLatLng());
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Refreshing the clusters icon
|
||||||
|
If you have [customized](#customising-the-clustered-markers) the clusters icon to use some data from the contained markers, and later that data changes, use this method to force a refresh of the cluster icons.
|
||||||
|
You can use the method:
|
||||||
|
- without arguments to force all cluster icons in the Marker Cluster Group to be re-drawn.
|
||||||
|
- with an array or a mapping of markers to force only their parent clusters to be re-drawn.
|
||||||
|
- with an L.LayerGroup. The method will look for all markers in it. Make sure it contains only markers which are also within this Marker Cluster Group.
|
||||||
|
- with a single marker.
|
||||||
|
```javascript
|
||||||
|
markers.refreshClusters();
|
||||||
|
markers.refreshClusters([myMarker0, myMarker33]);
|
||||||
|
markers.refreshClusters({id_0: myMarker0, id_any: myMarker33});
|
||||||
|
markers.refreshClusters(myLayerGroup);
|
||||||
|
markers.refreshClusters(myMarker);
|
||||||
|
```
|
||||||
|
|
||||||
|
The plugin also adds a method on L.Marker to easily update the underlying icon options and refresh the icon.
|
||||||
|
If passing a second argument that evaluates to `true`, the method will also trigger a `refreshCluster` on the parent MarkerClusterGroup for that single marker.
|
||||||
|
```javascript
|
||||||
|
// Use as many times as required to update markers,
|
||||||
|
// then call refreshClusters once finished.
|
||||||
|
for (i in markersSubArray) {
|
||||||
|
markersSubArray[i].refreshIconOptions(newOptionsMappingArray[i]);
|
||||||
|
}
|
||||||
|
markers.refreshClusters(markersSubArray);
|
||||||
|
|
||||||
|
// If updating only one marker, pass true to
|
||||||
|
// refresh this marker's parent clusters right away.
|
||||||
|
myMarker.refreshIconOptions(optionsMap, true);
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Other Group Methods
|
||||||
|
* **hasLayer**(layer): Returns true if the given layer (marker) is in the MarkerClusterGroup.
|
||||||
|
* **zoomToShowLayer**(layer, callback): Zooms to show the given marker (spiderfying if required), calls the callback when the marker is visible on the map.
|
||||||
|
|
||||||
|
### Clusters methods
|
||||||
|
The following methods can be used with clusters (not the group). They are typically used for event handling.
|
||||||
|
|
||||||
|
#### Getting the bounds of a cluster
|
||||||
When you receive an event from a cluster you can query it for the bounds.
|
When you receive an event from a cluster you can query it for the bounds.
|
||||||
See [example/marker-clustering-convexhull.html](http://leaflet.github.com/Leaflet.markercluster/example/marker-clustering-convexhull.html) for a working example.
|
|
||||||
```javascript
|
```javascript
|
||||||
markers.on('clusterclick', function (a) {
|
markers.on('clusterclick', function (a) {
|
||||||
map.addLayer(new L.Polygon(a.layer.getConvexHull()));
|
var latLngBounds = a.layer.getBounds();
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
### Zooming to the bounds of a cluster
|
You can also query for the bounding convex polygon.
|
||||||
|
See [example/marker-clustering-convexhull.html](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-convexhull.html) for a working example.
|
||||||
|
```javascript
|
||||||
|
markers.on('clusterclick', function (a) {
|
||||||
|
map.addLayer(L.polygon(a.layer.getConvexHull()));
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Zooming to the bounds of a cluster
|
||||||
When you receive an event from a cluster you can zoom to its bounds in one easy step.
|
When you receive an event from a cluster you can zoom to its bounds in one easy step.
|
||||||
If all of the markers will appear at a higher zoom level, that zoom level is zoomed to instead.
|
If all of the markers will appear at a higher zoom level, that zoom level is zoomed to instead.
|
||||||
See [marker-clustering-zoomtobounds.html](http://leaflet.github.com/Leaflet.markercluster/example/marker-clustering-zoomtobounds.html) for a working example.
|
See [marker-clustering-zoomtobounds.html](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-zoomtobounds.html) for a working example.
|
||||||
```javascript
|
```javascript
|
||||||
markers.on('clusterclick', function (a) {
|
markers.on('clusterclick', function (a) {
|
||||||
a.layer.zoomToBounds();
|
a.layer.zoomToBounds();
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
### Getting the visible parent of a marker
|
#### Other clusters methods
|
||||||
If you have a marker in your MarkerClusterGroup and you want to get the visible parent of it (Either itself or a cluster it is contained in that is currently visible on the map).
|
* **getChildCount**: Returns the total number of markers contained within that cluster.
|
||||||
This will return null if the marker and its parent clusters are not visible currently (they are not near the visible viewpoint)
|
* **getAllChildMarkers**: Returns the array of total markers contained within that cluster.
|
||||||
```
|
* **spiderfy**: Spiderfies the child markers of this cluster
|
||||||
var visibleOne = markerClusterGroup.getVisibleParent(myMarker);
|
* **unspiderfy**: Unspiderfies a cluster (opposite of spiderfy)
|
||||||
console.log(visibleOne.getLatLng());
|
|
||||||
```
|
|
||||||
|
|
||||||
### Adding and removing Markers
|
|
||||||
addLayer, removeLayer and clearLayers are supported and they should work for most uses.
|
|
||||||
|
|
||||||
### Bulk adding and removing Markers
|
|
||||||
addLayers and removeLayers are bulk methods for adding and removing markers and should be favoured over the single versions when doing bulk addition/removal of markers. Each takes an array of markers
|
|
||||||
|
|
||||||
If you are removing a lot of markers it will almost definitely be better to call clearLayers then call addLayers to add the markers you don't want to remove back in. See [#59](https://github.com/Leaflet/Leaflet.markercluster/issues/59#issuecomment-9320628) for details.
|
|
||||||
|
|
||||||
### Other Methods
|
|
||||||
````
|
|
||||||
hasLayer(layer): Returns true if the given layer (marker) is in the MarkerClusterGroup
|
|
||||||
zoomToShowLayer(layer, callback): Zooms to show the given marker (spidifying if required), calls the callback when the marker is visible on the map
|
|
||||||
addLayers(layerArray): Adds the markers in the given array from the MarkerClusterGroup in an efficent bulk method.
|
|
||||||
removeLayers(layerArray): Removes the markers in the given array from the MarkerClusterGroup in an efficent bulk method.
|
|
||||||
````
|
|
||||||
|
|
||||||
## Handling LOTS of markers
|
## Handling LOTS of markers
|
||||||
The Clusterer can handle 10000 or even 50000 markers (in chrome). IE9 has some issues with 50000.
|
The Clusterer can handle 10,000 or even 50,000 markers (in chrome). IE9 has some issues with 50,000.
|
||||||
[realworld 10000 example](http://leaflet.github.com/Leaflet.markercluster/example/marker-clustering-realworld.10000.html)
|
- [realworld 10,000 example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.10000.html)
|
||||||
[realworld 50000 example](http://leaflet.github.com/Leaflet.markercluster/example/marker-clustering-realworld.50000.html)
|
- [realworld 50,000 example](http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.50000.html)
|
||||||
Performance optimizations could be done so these are handled more gracefully (Running the initial clustering over multiple JS calls rather than locking the browser for a long time)
|
|
||||||
|
|
||||||
### License
|
Note: these two examples use the `chunkedLoading` option set to true in order to avoid locking the browser for a long time.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
Leaflet.markercluster is free software, and may be redistributed under the MIT-LICENSE.
|
Leaflet.markercluster is free software, and may be redistributed under the MIT-LICENSE.
|
||||||
|
|
||||||
[](https://travis-ci.org/Leaflet/Leaflet.markercluster)
|
[](https://travis-ci.org/Leaflet/Leaflet.markercluster)
|
||||||
|
|
||||||
|
## Sub-plugins
|
||||||
|
Leaflet.markercluster plugin is very popular and as such it generates high and
|
||||||
|
diverse expectations for increased functionalities.
|
||||||
|
|
||||||
|
If you are in that case, be sure to have a look first at the repository
|
||||||
|
[issues](https://github.com/Leaflet/Leaflet.markercluster/issues) in case what
|
||||||
|
you are looking for would already be discussed, and some workarounds would be proposed.
|
||||||
|
|
||||||
|
Check also the below sub-plugins:
|
||||||
|
|
||||||
|
| Plugin | Description | Maintainer |
|
||||||
|
| :----- | :---------- | :--------- |
|
||||||
|
| [Leaflet.FeatureGroup.SubGroup](https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup) | Creates a Feature Group that adds its child layers into a parent group when added to a map (e.g. through L.Control.Layers). Typical usage is to dynamically add/remove groups of markers from Marker Cluster. | [ghybs](https://github.com/ghybs) |
|
||||||
|
| [Leaflet.MarkerCluster.LayerSupport](https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport) | Brings compatibility with L.Control.Layers and other Leaflet plugins. I.e. everything that uses direct calls to map.addLayer and map.removeLayer. | [ghybs](https://github.com/ghybs) |
|
||||||
|
| [Leaflet.MarkerCluster.Freezable](https://github.com/ghybs/Leaflet.MarkerCluster.Freezable) | Adds the ability to freeze clusters at a specified zoom. E.g. freezing at maxZoom + 1 makes as if clustering was programmatically disabled. | [ghybs](https://github.com/ghybs) |
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet.markercluster",
|
"name": "leaflet.markercluster",
|
||||||
"version": "0.4.0-hotfix.1",
|
"version": "1.0.2",
|
||||||
"homepage": "https://github.com/Leaflet/Leaflet.markercluster",
|
"homepage": "https://github.com/Leaflet/Leaflet.markercluster",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Dave Leaver <danzel@localhost.geek.nz>"
|
"Dave Leaver <danzel@localhost.geek.nz>"
|
||||||
@@ -22,6 +22,6 @@
|
|||||||
"tests"
|
"tests"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"leaflet": ">= 0.7.0"
|
"leaflet": ">= 1.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet.markercluster",
|
"name": "leaflet.markercluster",
|
||||||
"version": "0.4.0",
|
"repository": "https://github.com/Leaflet/Leaflet.markercluster",
|
||||||
|
"version": "1.0.2",
|
||||||
"description": "Provides Beautiful Animated Marker Clustering functionality for Leaflet",
|
"description": "Provides Beautiful Animated Marker Clustering functionality for Leaflet",
|
||||||
"dependencies": {
|
|
||||||
"leaflet": "~0.7.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jshint": "~2.1.3",
|
"jshint": "~2.1.3",
|
||||||
"mocha": "~1.10.0",
|
"mocha": "~1.10.0",
|
||||||
"karma": "~0.8.5",
|
"karma": "~0.8.5",
|
||||||
"uglify-js": "~2.3.6",
|
"uglify-js": "~2.3.6",
|
||||||
"jake": "~0.5.16"
|
"jake": "~0.5.16",
|
||||||
|
"magic-string": "^0.7.0",
|
||||||
|
"leaflet": "~1.0.3"
|
||||||
},
|
},
|
||||||
"main": "dist/leaflet.markercluster.js",
|
"main": "dist/leaflet.markercluster.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jake test",
|
"test": "jake test",
|
||||||
"prepublish": "jake"
|
"prepublish": "jake"
|
||||||
},
|
},
|
||||||
"keywords": ["gis", "map"]
|
"keywords": ["gis", "map"],
|
||||||
}
|
"license": "MIT"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
## 0.3.4
|
||||||
|
|
||||||
|
* From now on, the repository doesn't contain leaflet-omnivore.js or leaflet-omnivore.min.js. Those
|
||||||
|
files will be in the npm package and you can use unpkg.com to get them.
|
||||||
|
|
||||||
|
## 0.3.3
|
||||||
|
|
||||||
|
* Call either `setGeoJSON` or `addData` on GeoJSON layers, not both.
|
||||||
|
|
||||||
## 0.3.2
|
## 0.3.2
|
||||||
|
|
||||||
* Move `brfs` and `hintify` to dependencies.
|
* Move `brfs` and `hintify` to dependencies.
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
[](https://travis-ci.org/mapbox/leaflet-omnivore)
|
|
||||||
|
|
||||||
# leaflet-omnivore
|
# leaflet-omnivore
|
||||||
|
|
||||||

|

|
||||||
@@ -24,7 +22,7 @@ so you can specify what you want to add to the map with just a URL.
|
|||||||
use it easily with the [Mapbox Plugins CDN](http://mapbox.com/mapbox.js/plugins/#leaflet-omnivore):
|
use it easily with the [Mapbox Plugins CDN](http://mapbox.com/mapbox.js/plugins/#leaflet-omnivore):
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.2.0/leaflet-omnivore.min.js'></script>
|
<script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.3.1/leaflet-omnivore.min.js'></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -43,7 +41,7 @@ Live examples:
|
|||||||
* [CSV](https://www.mapbox.com/mapbox.js/example/v1.0.0/markers-from-csv/)
|
* [CSV](https://www.mapbox.com/mapbox.js/example/v1.0.0/markers-from-csv/)
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var map = L.mapbox.map('map', 'examples.map-9ijuk24y')
|
var map = L.mapbox.map('map', 'mapbox.streets')
|
||||||
.setView([38, -102.0], 5);
|
.setView([38, -102.0], 5);
|
||||||
|
|
||||||
omnivore.csv('a.csv').addTo(map);
|
omnivore.csv('a.csv').addTo(map);
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "leaflet-omnivore",
|
|
||||||
"version": "0.3.0",
|
|
||||||
"description": "a geospatial format parser for Leaflet"
|
|
||||||
}
|
|
||||||
@@ -1,22 +1,26 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet-omnivore",
|
"name": "leaflet-omnivore",
|
||||||
"version": "0.3.2",
|
"version": "0.3.4",
|
||||||
"description": "a geospatial format parser for Leaflet",
|
"description": "a geospatial format parser for Leaflet",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "zuul --local -- test/test.js",
|
"test": "zuul --local -- test/test.js",
|
||||||
"test-remote": "zuul -- test/test.js",
|
"test-remote": "zuul -- test/test.js",
|
||||||
"test-headless": "zuul --phantom test/test.js",
|
"test-headless": "zuul --phantom -- test/test.js",
|
||||||
"build": "browserify -s omnivore index.js > leaflet-omnivore.js && uglifyjs leaflet-omnivore.js -c -m > leaflet-omnivore.min.js"
|
"prepublish": "browserify -s omnivore index.js > leaflet-omnivore.js && uglifyjs leaflet-omnivore.js -c -m > leaflet-omnivore.min.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git@github.com:mapbox/leaflet-omnivore.git"
|
"url": "git@github.com:mapbox/leaflet-omnivore.git"
|
||||||
},
|
},
|
||||||
|
"files": [
|
||||||
|
"index.js",
|
||||||
|
"leaflet-omnivore.js",
|
||||||
|
"leaflet-omnivore.min.js"
|
||||||
|
],
|
||||||
"browserify": {
|
"browserify": {
|
||||||
"transform": [
|
"transform": [
|
||||||
"brfs",
|
"brfs"
|
||||||
"hintify"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -38,30 +42,29 @@
|
|||||||
"converter"
|
"converter"
|
||||||
],
|
],
|
||||||
"author": "Tom MacWright",
|
"author": "Tom MacWright",
|
||||||
"license": "BSD",
|
"license": "BSD-3-Clause",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/mapbox/leaflet-omnivore/issues"
|
"url": "https://github.com/mapbox/leaflet-omnivore/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/mapbox/leaflet-omnivore",
|
"homepage": "https://github.com/mapbox/leaflet-omnivore",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"csv2geojson": "~3.6.1",
|
"csv2geojson": "~5.0.0",
|
||||||
"togeojson": "0.10.1",
|
"togeojson": "0.13.0",
|
||||||
"corslite": "0.0.6",
|
"corslite": "0.0.7",
|
||||||
"wellknown": "0.3.0",
|
"wellknown": "0.4.2",
|
||||||
"hintify": "~0.1.0",
|
"brfs": "1.4.3",
|
||||||
"brfs": "0.2.1",
|
"topojson": "1.6.26",
|
||||||
"topojson": "1.6.8",
|
"polyline": "0.2.0"
|
||||||
"polyline": "0.0.3"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"browserify": "7.0.2",
|
"browserify": "13.0.1",
|
||||||
"tape": "2.4.2",
|
"tape": "4.5.1",
|
||||||
"uglify-js": "2.4.16",
|
"uglify-js": "^2.6.2",
|
||||||
"jshint": "2.5.0",
|
"jshint": "2.9.2",
|
||||||
"mocha": "~1.20.1",
|
"mocha": "~2.5.3",
|
||||||
"zuul": "~1.7.0",
|
"zuul": "~3.10.1",
|
||||||
"st": "0.5.1",
|
"st": "1.1.0",
|
||||||
"mapbox.js": "1.6.4",
|
"mapbox.js": "2.4.0",
|
||||||
"phantomjs": "~1.9.7-15"
|
"phantomjs-prebuilt": "2.1.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
46
assets/leaflet-providers/CHANGELOG.md
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
# Leaflet-providers changelog
|
||||||
|
|
||||||
|
## 1.1.14 (2016-07-15)
|
||||||
|
- Remove MapQuest, fixes #219
|
||||||
|
- Accidently skipped v1.1.12 and v1.1.13
|
||||||
|
|
||||||
|
## 1.1.11 (2016-06-04)
|
||||||
|
- Added protocol relativity to OSM FR, OSM HOT and Hydda providers (#214, #215).
|
||||||
|
|
||||||
|
## 1.1.9 (2016-03-23)
|
||||||
|
- Re-added HERE layers #209, discussion in #206.
|
||||||
|
|
||||||
|
## 1.1.8 (2016-03-22)
|
||||||
|
- Removed HERE layers #206
|
||||||
|
|
||||||
|
## 1.1.7 (2015-12-16)
|
||||||
|
- Removed Acetate tile layers #198
|
||||||
|
|
||||||
|
## 1.1.6 (2015-11-03)
|
||||||
|
- Removed most of the NLS layers per NLS request #193, fixes #178
|
||||||
|
- Added new variants to the HERE provider #183 by [@andreaswc](https://github.com/andreaswc)
|
||||||
|
- Added some tests to make sure all the placeholders in the url template are replaced #188
|
||||||
|
|
||||||
|
## 1.1.5 (2015-10-01)
|
||||||
|
- Improvements for the NLS layers #182 by [@tomhughes](https://github.com/tomhughes)
|
||||||
|
- Check for valid bounds before fitting the preview map to undefined (fixes #185)
|
||||||
|
- Add bounds for FreeMapSK (fixes #184)
|
||||||
|
- Fix Stamen layers with `.jpg` extension (#187, fixes #184)
|
||||||
|
|
||||||
|
## 1.1.4 (2015-09-27)
|
||||||
|
- Only include the interesting files in the npm package #180
|
||||||
|
- Add GSGS_Ireland to NLS provider with `tms:true` to invert y-axis #181
|
||||||
|
|
||||||
|
## 1.1.3 (2015-09-26)
|
||||||
|
- Add various historical layers of the Natioanal library of Scotland (NLS) #179
|
||||||
|
- Add a page to visually check bounds #179
|
||||||
|
|
||||||
|
## 1.1.2 (2015-09-05)
|
||||||
|
- Add CartoDB labels-only styles #170 by [@almccon](https://github.com/almccon)
|
||||||
|
- Implement commonjs module #172
|
||||||
|
- Added retina URL option #177, [@routexl](https://github.com/routexl)
|
||||||
|
|
||||||
|
## 1.1.1 (2015-06-22)
|
||||||
|
- Update Mapbox API to v4 #167 by [@gutenye](https://github.com/gutenye)
|
||||||
|
- Started maintaining a changelog in CHANGELOG.md.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
Leaflet-providers
|
Leaflet-providers
|
||||||
=================
|
=================
|
||||||
An extension to [Leaflet](http://leafletjs.com/) that contains configurations for various free tile providers.
|
An extension to [Leaflet](http://leafletjs.com/) that contains configurations for various free<sup>[1](#what-is-free)</sup> tile providers.
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
Leaflet-providers [providers](#providers) are refered to with a `provider[.<variant>]`-string. Let's say you want to add the nice [Watercolor](http://maps.stamen.com/#watercolor/) style from Stamen to your map, you pass `Stamen.Watercolor` to the `L.tileLayer.provider`-constructor, which will return a [L.TileLayer](http://leafletjs.com/reference.html#tilelayer) instance for Stamens Watercolor tile layer.
|
Leaflet-providers [providers](#providers) are refered to with a `provider[.<variant>]`-string. Let's say you want to add the nice [Watercolor](http://maps.stamen.com/#watercolor/) style from Stamen to your map, you pass `Stamen.Watercolor` to the `L.tileLayer.provider`-constructor, which will return a [L.TileLayer](http://leafletjs.com/reference.html#tilelayer) instance for Stamens Watercolor tile layer.
|
||||||
@@ -15,13 +15,17 @@ L.tileLayer.provider('Stamen.Watercolor').addTo(map);
|
|||||||
Leaflet-providers tries to use `https://` if the page uses `https://` and the provider supports it.
|
Leaflet-providers tries to use `https://` if the page uses `https://` and the provider supports it.
|
||||||
You can force the use of `http://` by passing `force_http: true` in the options argument.
|
You can force the use of `http://` by passing `force_http: true` in the options argument.
|
||||||
|
|
||||||
|
## Retina tiles
|
||||||
|
|
||||||
|
Some providers have retina tiles for which the URL only needs to be slightly adjusted, e.g. `-----@2x.png`. For this, add the retina option in the URL, e.g. `-----{retina}.png`, and set a retina value in the options, e.g. `retina: '@2x'`. If Leaflet detects a retina screen (`L.Browser.retina`), the retina option passed to the tileLayer is set to the value supplied, otherwise it's replaced by an empty string.
|
||||||
|
|
||||||
# Providers
|
# Providers
|
||||||
|
|
||||||
Leaflet-providers provides tile layers from different providers, including *OpenStreetMap*, *MapQuestOpen*, *Stamen*, *Esri* and *OpenWeatherMap*. The full listing of free to use layers can be [previewed](http://leaflet-extras.github.io/leaflet-providers/preview/index.html). The page will show you the name to use with `leaflet-providers.js` and the code to use it without dependencies.
|
Leaflet-providers provides tile layers from different providers, including *OpenStreetMap*, *Stamen*, *Esri* and *OpenWeatherMap*. The full listing of free to use layers can be [previewed](http://leaflet-extras.github.io/leaflet-providers/preview/index.html). The page will show you the name to use with `leaflet-providers.js` and the code to use it without dependencies.
|
||||||
|
|
||||||
## Providers requiring registration
|
## Providers requiring registration
|
||||||
|
|
||||||
In addition to the providers you are free to use, we support some layers which require registration.
|
In addition to the providers you are free<b id="what-is-free">1</b> to use, we support some layers which require registration.
|
||||||
|
|
||||||
### HERE (formerly Nokia).
|
### HERE (formerly Nokia).
|
||||||
|
|
||||||
@@ -38,9 +42,9 @@ L.tileLayer.provider('HERE.terrainDay', {
|
|||||||
|
|
||||||
### Mapbox
|
### Mapbox
|
||||||
|
|
||||||
In order to use Mapbox maps, you must [register](https://tiles.mapbox.com/signup). If your user name is `YourName` and your map is called `MyMap` you can add it with:
|
In order to use Mapbox maps, you must [register](https://tiles.mapbox.com/signup). You can get map ID and ACCESS_TOKEN from [Mapbox projects](https://www.mapbox.com/projects):
|
||||||
```JavaScript
|
```JavaScript
|
||||||
L.tileLayer.provider('MapBox.YourName.MyMap');
|
L.tileLayer.provider('MapBox', {id: 'ID', accessToken: 'ACCESS_TOKEN'}).addTo(map);
|
||||||
```
|
```
|
||||||
|
|
||||||
### Esri/ArcGIS
|
### Esri/ArcGIS
|
||||||
@@ -52,3 +56,8 @@ In order to use ArcGIS maps, you must [register](https://developers.arcgis.com/e
|
|||||||
# Attribution
|
# Attribution
|
||||||
|
|
||||||
This work was inspired from <https://gist.github.com/1804938>, and originally created by [Stefan Seelmann](https://github.com/seelmann).
|
This work was inspired from <https://gist.github.com/1804938>, and originally created by [Stefan Seelmann](https://github.com/seelmann).
|
||||||
|
|
||||||
|
### What do we mean by *free*?
|
||||||
|
<b id="what-is-free">1</b>
|
||||||
|
We try to maintain leaflet-providers in such a way that you'll be able to use the layers we include without paying money.
|
||||||
|
This doesn't mean no limits apply, you should always check before using these layers for anything serious.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet-providers",
|
"name": "leaflet-providers",
|
||||||
"version": "1.1.0",
|
"version": "1.1.15",
|
||||||
"homepage": "https://github.com/leaflet-extras/leaflet-providers",
|
"homepage": "https://github.com/leaflet-extras/leaflet-providers",
|
||||||
"description": "An extension to Leaflet that contains configurations for various free tile providers.",
|
"description": "An extension to Leaflet that contains configurations for various free tile providers.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
<!-- Leaflet style. REQUIRED! -->
|
<!-- Leaflet style. REQUIRED! -->
|
||||||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
|
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-rc.1/leaflet.css" />
|
||||||
<style>
|
<style>
|
||||||
html { height: 100% }
|
html { height: 100% }
|
||||||
body { height: 100%; margin: 0; padding: 0;}
|
body { height: 100%; margin: 0; padding: 0;}
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="map" class="map"></div>
|
<div id="map" class="map"></div>
|
||||||
|
|
||||||
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet-src.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-rc.1/leaflet.js"></script>
|
||||||
<script src="leaflet-providers.js"></script>
|
<script src="leaflet-providers.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var map = L.map('map', {
|
var map = L.map('map', {
|
||||||
@@ -46,9 +46,7 @@
|
|||||||
'Thunderforest Transport': L.tileLayer.provider('Thunderforest.Transport'),
|
'Thunderforest Transport': L.tileLayer.provider('Thunderforest.Transport'),
|
||||||
'Thunderforest Landscape': L.tileLayer.provider('Thunderforest.Landscape'),
|
'Thunderforest Landscape': L.tileLayer.provider('Thunderforest.Landscape'),
|
||||||
'Hydda Full': L.tileLayer.provider('Hydda.Full'),
|
'Hydda Full': L.tileLayer.provider('Hydda.Full'),
|
||||||
'MapQuest OSM': L.tileLayer.provider('MapQuestOpen.OSM'),
|
'MapBox Example': L.tileLayer.provider('MapBox', {id: 'mapbox.streets', accessToken: 'pk.eyJ1IjoiZ3V0ZW55ZSIsImEiOiJmNjJlMDNmYTUyMzNjMzQxZmY4Mzc1ZmFiYmExNjMxOSJ9.xgl1PBwQV9CtwW-usedrcQ'}),
|
||||||
'MapQuest Aerial': L.tileLayer.provider('MapQuestOpen.Aerial'),
|
|
||||||
'MapBox Example': L.tileLayer.provider('MapBox.examples.map-zr0njcqy'),
|
|
||||||
'Stamen Toner': L.tileLayer.provider('Stamen.Toner'),
|
'Stamen Toner': L.tileLayer.provider('Stamen.Toner'),
|
||||||
'Stamen Terrain': L.tileLayer.provider('Stamen.Terrain'),
|
'Stamen Terrain': L.tileLayer.provider('Stamen.Terrain'),
|
||||||
'Stamen Watercolor': L.tileLayer.provider('Stamen.Watercolor'),
|
'Stamen Watercolor': L.tileLayer.provider('Stamen.Watercolor'),
|
||||||
@@ -61,8 +59,7 @@
|
|||||||
'Esri WorldPhysical': L.tileLayer.provider('Esri.WorldPhysical'),
|
'Esri WorldPhysical': L.tileLayer.provider('Esri.WorldPhysical'),
|
||||||
'Esri OceanBasemap': L.tileLayer.provider('Esri.OceanBasemap'),
|
'Esri OceanBasemap': L.tileLayer.provider('Esri.OceanBasemap'),
|
||||||
'Esri NatGeoWorldMap': L.tileLayer.provider('Esri.NatGeoWorldMap'),
|
'Esri NatGeoWorldMap': L.tileLayer.provider('Esri.NatGeoWorldMap'),
|
||||||
'Esri WorldGrayCanvas': L.tileLayer.provider('Esri.WorldGrayCanvas'),
|
'Esri WorldGrayCanvas': L.tileLayer.provider('Esri.WorldGrayCanvas')
|
||||||
'Acetate': L.tileLayer.provider('Acetate')
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var overlayLayers = {
|
var overlayLayers = {
|
||||||
@@ -80,10 +77,10 @@
|
|||||||
'OpenWeatherMap Snow': L.tileLayer.provider('OpenWeatherMap.Snow')
|
'OpenWeatherMap Snow': L.tileLayer.provider('OpenWeatherMap.Snow')
|
||||||
};
|
};
|
||||||
|
|
||||||
var layerControl = L.control.layers(baseLayers, overlayLayers, {collapsed: false}).addTo(map);
|
L.control.layers(baseLayers, overlayLayers, {collapsed: false}).addTo(map);
|
||||||
|
|
||||||
// resize layers control to fit into view.
|
// resize layers control to fit into view.
|
||||||
function resizeLayerControl() {
|
function resizeLayerControl () {
|
||||||
var layerControlHeight = document.body.clientHeight - (10 + 50);
|
var layerControlHeight = document.body.clientHeight - (10 + 50);
|
||||||
var layerControl = document.getElementsByClassName('leaflet-control-layers-expanded')[0];
|
var layerControl = document.getElementsByClassName('leaflet-control-layers-expanded')[0];
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
(function (root, factory) {
|
(function (root, factory) {
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
// AMD. Register as an anonymous module.
|
// AMD. Register as an anonymous module.
|
||||||
define(['leaflet'], factory);
|
define(['leaflet'], factory);
|
||||||
} else {
|
} else if (typeof modules === 'object' && module.exports) {
|
||||||
// Assume leaflet is loaded into global object L already
|
// define a Common JS module that relies on 'leaflet'
|
||||||
factory(L);
|
module.exports = factory(require('leaflet'));
|
||||||
}
|
} else {
|
||||||
|
// Assume Leaflet is loaded into global object L already
|
||||||
|
factory(L);
|
||||||
|
}
|
||||||
}(this, function (L) {
|
}(this, function (L) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@@ -45,8 +48,6 @@
|
|||||||
url: variant.url || provider.url,
|
url: variant.url || provider.url,
|
||||||
options: L.Util.extend({}, provider.options, variantOptions)
|
options: L.Util.extend({}, provider.options, variantOptions)
|
||||||
};
|
};
|
||||||
} else if (typeof provider.url === 'function') {
|
|
||||||
provider.url = provider.url(parts.splice(1, parts.length - 1).join('.'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var forceHTTP = window.location.protocol === 'file:' || provider.options.forceHTTP;
|
var forceHTTP = window.location.protocol === 'file:' || provider.options.forceHTTP;
|
||||||
@@ -54,6 +55,19 @@
|
|||||||
provider.url = 'http:' + provider.url;
|
provider.url = 'http:' + provider.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If retina option is set
|
||||||
|
if (provider.options.retina) {
|
||||||
|
// Check retina screen
|
||||||
|
if (options.detectRetina && L.Browser.retina) {
|
||||||
|
// The retina option will be active now
|
||||||
|
// But we need to prevent Leaflet retina mode
|
||||||
|
options.detectRetina = false;
|
||||||
|
} else {
|
||||||
|
// No retina, remove option
|
||||||
|
provider.options.retina = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// replace attribution placeholders with their values from toplevel provider attribution,
|
// replace attribution placeholders with their values from toplevel provider attribution,
|
||||||
// recursively
|
// recursively
|
||||||
var attributionReplacer = function (attr) {
|
var attributionReplacer = function (attr) {
|
||||||
@@ -102,13 +116,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
France: {
|
France: {
|
||||||
url: 'http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
|
url: '//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
|
||||||
options: {
|
options: {
|
||||||
|
maxZoom: 20,
|
||||||
attribution: '© Openstreetmap France | {attribution.OpenStreetMap}'
|
attribution: '© Openstreetmap France | {attribution.OpenStreetMap}'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
HOT: {
|
HOT: {
|
||||||
url: 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
|
url: '//{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
|
||||||
options: {
|
options: {
|
||||||
attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>'
|
attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>'
|
||||||
}
|
}
|
||||||
@@ -124,7 +139,7 @@
|
|||||||
OpenTopoMap: {
|
OpenTopoMap: {
|
||||||
url: '//{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
|
url: '//{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
|
||||||
options: {
|
options: {
|
||||||
maxZoom: 16,
|
maxZoom: 17,
|
||||||
attribution: 'Map data: {attribution.OpenStreetMap}, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
|
attribution: 'Map data: {attribution.OpenStreetMap}, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -132,7 +147,7 @@
|
|||||||
url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
|
url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
|
||||||
options: {
|
options: {
|
||||||
attribution:
|
attribution:
|
||||||
'© <a href="http://www.opencyclemap.org">OpenCycleMap</a>, {attribution.OpenStreetMap}',
|
'© <a href="http://www.thunderforest.com/">Thunderforest</a>, {attribution.OpenStreetMap}',
|
||||||
variant: 'cycle'
|
variant: 'cycle'
|
||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
@@ -149,12 +164,19 @@
|
|||||||
maxZoom: 19
|
maxZoom: 19
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
SpinalMap: {
|
||||||
|
options: {
|
||||||
|
variant: 'spinal-map',
|
||||||
|
maxZoom: 11
|
||||||
|
}
|
||||||
|
},
|
||||||
Landscape: 'landscape',
|
Landscape: 'landscape',
|
||||||
Outdoors: 'outdoors'
|
Outdoors: 'outdoors',
|
||||||
|
Pioneer: 'pioneer'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
OpenMapSurfer: {
|
OpenMapSurfer: {
|
||||||
url: 'http://openmapsurfer.uni-hd.de/tiles/{variant}/x={x}&y={y}&z={z}',
|
url: 'http://korona.geog.uni-heidelberg.de/tiles/{variant}/x={x}&y={y}&z={z}',
|
||||||
options: {
|
options: {
|
||||||
maxZoom: 20,
|
maxZoom: 20,
|
||||||
variant: 'roads',
|
variant: 'roads',
|
||||||
@@ -177,7 +199,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Hydda: {
|
Hydda: {
|
||||||
url: 'http://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
|
url: '//{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
|
||||||
options: {
|
options: {
|
||||||
variant: 'full',
|
variant: 'full',
|
||||||
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> — Map data {attribution.OpenStreetMap}'
|
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> — Map data {attribution.OpenStreetMap}'
|
||||||
@@ -188,43 +210,8 @@
|
|||||||
RoadsAndLabels: 'roads_and_labels'
|
RoadsAndLabels: 'roads_and_labels'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
MapQuestOpen: {
|
|
||||||
/* Mapquest does support https, but with a different subdomain:
|
|
||||||
* https://otile{s}-s.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}
|
|
||||||
* which makes implementing protocol relativity impossible.
|
|
||||||
*/
|
|
||||||
url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}',
|
|
||||||
options: {
|
|
||||||
type: 'map',
|
|
||||||
ext: 'jpg',
|
|
||||||
attribution:
|
|
||||||
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> — ' +
|
|
||||||
'Map data {attribution.OpenStreetMap}',
|
|
||||||
subdomains: '1234'
|
|
||||||
},
|
|
||||||
variants: {
|
|
||||||
OSM: {},
|
|
||||||
Aerial: {
|
|
||||||
options: {
|
|
||||||
type: 'sat',
|
|
||||||
attribution:
|
|
||||||
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> — ' +
|
|
||||||
'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
HybridOverlay: {
|
|
||||||
options: {
|
|
||||||
type: 'hyb',
|
|
||||||
ext: 'png',
|
|
||||||
opacity: 0.9
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
MapBox: {
|
MapBox: {
|
||||||
url: function (id) {
|
url: '//api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}',
|
||||||
return '//{s}.tiles.mapbox.com/v3/' + id + '/{z}/{x}/{y}.png';
|
|
||||||
},
|
|
||||||
options: {
|
options: {
|
||||||
attribution:
|
attribution:
|
||||||
'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> — ' +
|
'Imagery from <a href="http://mapbox.com/about/maps/">MapBox</a> — ' +
|
||||||
@@ -233,7 +220,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Stamen: {
|
Stamen: {
|
||||||
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.png',
|
url: '//stamen-tiles-{s}.a.ssl.fastly.net/{variant}/{z}/{x}/{y}.{ext}',
|
||||||
options: {
|
options: {
|
||||||
attribution:
|
attribution:
|
||||||
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
|
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
|
||||||
@@ -262,17 +249,15 @@
|
|||||||
Terrain: {
|
Terrain: {
|
||||||
options: {
|
options: {
|
||||||
variant: 'terrain',
|
variant: 'terrain',
|
||||||
minZoom: 4,
|
minZoom: 0,
|
||||||
maxZoom: 18,
|
maxZoom: 18
|
||||||
bounds: [[22, -132], [70, -56]]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
TerrainBackground: {
|
TerrainBackground: {
|
||||||
options: {
|
options: {
|
||||||
variant: 'terrain-background',
|
variant: 'terrain-background',
|
||||||
minZoom: 4,
|
minZoom: 0,
|
||||||
maxZoom: 18,
|
maxZoom: 18
|
||||||
bounds: [[22, -132], [70, -56]]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
TopOSMRelief: {
|
TopOSMRelief: {
|
||||||
@@ -408,8 +393,8 @@
|
|||||||
*/
|
*/
|
||||||
url:
|
url:
|
||||||
'//{s}.{base}.maps.cit.api.here.com/maptile/2.1/' +
|
'//{s}.{base}.maps.cit.api.here.com/maptile/2.1/' +
|
||||||
'maptile/{mapID}/{variant}/{z}/{x}/{y}/256/png8?' +
|
'{type}/{mapID}/{variant}/{z}/{x}/{y}/{size}/{format}?' +
|
||||||
'app_id={app_id}&app_code={app_code}',
|
'app_id={app_id}&app_code={app_code}&lg={language}',
|
||||||
options: {
|
options: {
|
||||||
attribution:
|
attribution:
|
||||||
'Map © 1987-2014 <a href="http://developer.here.com">HERE</a>',
|
'Map © 1987-2014 <a href="http://developer.here.com">HERE</a>',
|
||||||
@@ -419,7 +404,11 @@
|
|||||||
'app_code': '<insert your app_code here>',
|
'app_code': '<insert your app_code here>',
|
||||||
base: 'base',
|
base: 'base',
|
||||||
variant: 'normal.day',
|
variant: 'normal.day',
|
||||||
maxZoom: 20
|
maxZoom: 20,
|
||||||
|
type: 'maptile',
|
||||||
|
language: 'eng',
|
||||||
|
format: 'png8',
|
||||||
|
size: '256'
|
||||||
},
|
},
|
||||||
variants: {
|
variants: {
|
||||||
normalDay: 'normal.day',
|
normalDay: 'normal.day',
|
||||||
@@ -434,6 +423,23 @@
|
|||||||
normalNightGrey: 'normal.night.grey',
|
normalNightGrey: 'normal.night.grey',
|
||||||
normalNightGreyMobile: 'normal.night.grey.mobile',
|
normalNightGreyMobile: 'normal.night.grey.mobile',
|
||||||
|
|
||||||
|
basicMap: {
|
||||||
|
options: {
|
||||||
|
type: 'basetile'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mapLabels: {
|
||||||
|
options: {
|
||||||
|
type: 'labeltile',
|
||||||
|
format: 'png'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trafficFlow: {
|
||||||
|
options: {
|
||||||
|
base: 'traffic',
|
||||||
|
type: 'flowtile'
|
||||||
|
}
|
||||||
|
},
|
||||||
carnavDayGrey: 'carnav.day.grey',
|
carnavDayGrey: 'carnav.day.grey',
|
||||||
hybridDay: {
|
hybridDay: {
|
||||||
options: {
|
options: {
|
||||||
@@ -469,32 +475,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Acetate: {
|
|
||||||
url: 'http://a{s}.acetate.geoiq.com/tiles/{variant}/{z}/{x}/{y}.png',
|
|
||||||
options: {
|
|
||||||
attribution:
|
|
||||||
'©2012 Esri & Stamen, Data from OSM and Natural Earth',
|
|
||||||
subdomains: '0123',
|
|
||||||
minZoom: 2,
|
|
||||||
maxZoom: 18,
|
|
||||||
variant: 'acetate-base'
|
|
||||||
},
|
|
||||||
variants: {
|
|
||||||
basemap: 'acetate-base',
|
|
||||||
terrain: 'terrain',
|
|
||||||
all: 'acetate-hillshading',
|
|
||||||
foreground: 'acetate-fg',
|
|
||||||
roads: 'acetate-roads',
|
|
||||||
labels: 'acetate-labels',
|
|
||||||
hillshading: 'hillshading'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
FreeMapSK: {
|
FreeMapSK: {
|
||||||
url: 'http://{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
|
url: 'http://t{s}.freemap.sk/T/{z}/{x}/{y}.jpeg',
|
||||||
options: {
|
options: {
|
||||||
minZoom: 8,
|
minZoom: 8,
|
||||||
maxZoom: 16,
|
maxZoom: 16,
|
||||||
subdomains: ['t1', 't2', 't3', 't4'],
|
subdomains: '1234',
|
||||||
|
bounds: [[47.204642, 15.996093], [49.830896, 22.576904]],
|
||||||
attribution:
|
attribution:
|
||||||
'{attribution.OpenStreetMap}, vizualization CC-By-SA 2.0 <a href="http://freemap.sk">Freemap.sk</a>'
|
'{attribution.OpenStreetMap}, vizualization CC-By-SA 2.0 <a href="http://freemap.sk">Freemap.sk</a>'
|
||||||
}
|
}
|
||||||
@@ -517,8 +504,10 @@
|
|||||||
variants: {
|
variants: {
|
||||||
Positron: 'light_all',
|
Positron: 'light_all',
|
||||||
PositronNoLabels: 'light_nolabels',
|
PositronNoLabels: 'light_nolabels',
|
||||||
|
PositronOnlyLabels: 'light_only_labels',
|
||||||
DarkMatter: 'dark_all',
|
DarkMatter: 'dark_all',
|
||||||
DarkMatterNoLabels: 'dark_nolabels'
|
DarkMatterNoLabels: 'dark_nolabels',
|
||||||
|
DarkMatterOnlyLabels: 'dark_only_labels'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
HikeBike: {
|
HikeBike: {
|
||||||
@@ -621,6 +610,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
NLS: {
|
||||||
|
// NLS maps are copyright National library of Scotland.
|
||||||
|
// http://maps.nls.uk/projects/api/index.html
|
||||||
|
// Please contact NLS for anything other than non-commercial low volume usage
|
||||||
|
//
|
||||||
|
// Map sources: Ordnance Survey 1:1m to 1:63K, 1920s-1940s
|
||||||
|
// z0-9 - 1:1m
|
||||||
|
// z10-11 - quarter inch (1:253440)
|
||||||
|
// z12-18 - one inch (1:63360)
|
||||||
|
url: '//nls-{s}.tileserver.com/nls/{z}/{x}/{y}.jpg',
|
||||||
|
options: {
|
||||||
|
attribution: '<a href="http://geo.nls.uk/maps/">National Library of Scotland Historic Maps</a>',
|
||||||
|
bounds: [[49.6, -12], [61.7, 3]],
|
||||||
|
minZoom: 1,
|
||||||
|
maxZoom: 18,
|
||||||
|
subdomains: '0123',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "leaflet-providers",
|
"name": "leaflet-providers",
|
||||||
"version": "1.1.0",
|
"version": "1.1.15",
|
||||||
"description": "An extension to Leaflet that contains configurations for various free tile providers.",
|
"description": "An extension to Leaflet that contains configurations for various free tile providers.",
|
||||||
"main": "leaflet-providers.js",
|
"main": "leaflet-providers.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm run lint && npm run testsuite",
|
"test": "npm run lint && npm run testsuite",
|
||||||
"testsuite": "mocha-phantomjs tests/index.html",
|
"testsuite": "mocha-phantomjs tests/index.html",
|
||||||
"lint": "eslint --config .eslintrc leaflet-providers.js preview/preview.js preview/shared.js preview/https-support.js tests/test.js",
|
"lint": "eslint --config .eslintrc leaflet-providers.js index.html preview/*.js preview/*.html tests/*",
|
||||||
"min": "uglifyjs leaflet-providers.js -mc -o leaflet-providers.min.js",
|
"min": "uglifyjs leaflet-providers.js -mc -o leaflet-providers.min.js",
|
||||||
"release": "mversion patch -m"
|
"release": "mversion patch -m"
|
||||||
},
|
},
|
||||||
@@ -18,14 +18,21 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/leaflet-extras/leaflet-providers/issues"
|
"url": "https://github.com/leaflet-extras/leaflet-providers/issues"
|
||||||
},
|
},
|
||||||
|
"files": [
|
||||||
|
"leaflet-providers.js",
|
||||||
|
"README.md",
|
||||||
|
"CHANGELOG.md",
|
||||||
|
"licence.md"
|
||||||
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^2.3.0",
|
"chai": "^2.3.0",
|
||||||
"eslint": "^0.15.0",
|
"eslint": "^2.7.0",
|
||||||
|
"eslint-plugin-html": "^1.4.0",
|
||||||
"mocha": "^2.2.4",
|
"mocha": "^2.2.4",
|
||||||
"mocha-phantomjs": "^3.5.3",
|
"mocha-phantomjs": "^3.5.3",
|
||||||
"mversion": "^1.3.0",
|
"mversion": "^1.3.0",
|
||||||
"uglify-js": "^2.4.15",
|
"phantomjs": "1.9.7-15",
|
||||||
"phantomjs": "^1.9.16"
|
"uglify-js": "^2.4.15"
|
||||||
},
|
},
|
||||||
"autoupdate": {
|
"autoupdate": {
|
||||||
"source": "git",
|
"source": "git",
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 696 B |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 797 B After Width: | Height: | Size: 618 B |
1
assets/leaflet/leaflet-src.map
Normal file
@@ -1,16 +1,12 @@
|
|||||||
/* required styles */
|
/* required styles */
|
||||||
|
|
||||||
.leaflet-map-pane,
|
.leaflet-pane,
|
||||||
.leaflet-tile,
|
.leaflet-tile,
|
||||||
.leaflet-marker-icon,
|
.leaflet-marker-icon,
|
||||||
.leaflet-marker-shadow,
|
.leaflet-marker-shadow,
|
||||||
.leaflet-tile-pane,
|
|
||||||
.leaflet-tile-container,
|
.leaflet-tile-container,
|
||||||
.leaflet-overlay-pane,
|
.leaflet-pane > svg,
|
||||||
.leaflet-shadow-pane,
|
.leaflet-pane > canvas,
|
||||||
.leaflet-marker-pane,
|
|
||||||
.leaflet-popup-pane,
|
|
||||||
.leaflet-overlay-pane svg,
|
|
||||||
.leaflet-zoom-box,
|
.leaflet-zoom-box,
|
||||||
.leaflet-image-layer,
|
.leaflet-image-layer,
|
||||||
.leaflet-layer {
|
.leaflet-layer {
|
||||||
@@ -20,7 +16,6 @@
|
|||||||
}
|
}
|
||||||
.leaflet-container {
|
.leaflet-container {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
-ms-touch-action: none;
|
|
||||||
}
|
}
|
||||||
.leaflet-tile,
|
.leaflet-tile,
|
||||||
.leaflet-marker-icon,
|
.leaflet-marker-icon,
|
||||||
@@ -28,20 +23,43 @@
|
|||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
-webkit-user-drag: none;
|
-webkit-user-drag: none;
|
||||||
|
}
|
||||||
|
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
|
||||||
|
.leaflet-safari .leaflet-tile {
|
||||||
|
image-rendering: -webkit-optimize-contrast;
|
||||||
|
}
|
||||||
|
/* hack that prevents hw layers "stretching" when loading new tiles */
|
||||||
|
.leaflet-safari .leaflet-tile-container {
|
||||||
|
width: 1600px;
|
||||||
|
height: 1600px;
|
||||||
|
-webkit-transform-origin: 0 0;
|
||||||
}
|
}
|
||||||
.leaflet-marker-icon,
|
.leaflet-marker-icon,
|
||||||
.leaflet-marker-shadow {
|
.leaflet-marker-shadow {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
/* map is broken in FF if you have max-width: 100% on tiles */
|
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
|
||||||
.leaflet-container img {
|
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
|
||||||
|
.leaflet-container .leaflet-overlay-pane svg,
|
||||||
|
.leaflet-container .leaflet-marker-pane img,
|
||||||
|
.leaflet-container .leaflet-shadow-pane img,
|
||||||
|
.leaflet-container .leaflet-tile-pane img,
|
||||||
|
.leaflet-container img.leaflet-image-layer {
|
||||||
max-width: none !important;
|
max-width: none !important;
|
||||||
}
|
}
|
||||||
/* stupid Android 2 doesn't understand "max-width: none" properly */
|
|
||||||
.leaflet-container img.leaflet-image-layer {
|
.leaflet-container.leaflet-touch-zoom {
|
||||||
max-width: 15000px !important;
|
-ms-touch-action: pan-x pan-y;
|
||||||
|
touch-action: pan-x pan-y;
|
||||||
}
|
}
|
||||||
|
.leaflet-container.leaflet-touch-drag {
|
||||||
|
-ms-touch-action: pinch-zoom;
|
||||||
|
}
|
||||||
|
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
|
||||||
|
-ms-touch-action: none;
|
||||||
|
touch-action: none;
|
||||||
|
}
|
||||||
.leaflet-tile {
|
.leaflet-tile {
|
||||||
filter: inherit;
|
filter: inherit;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
@@ -52,18 +70,26 @@
|
|||||||
.leaflet-zoom-box {
|
.leaflet-zoom-box {
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
z-index: 800;
|
||||||
}
|
}
|
||||||
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
|
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
|
||||||
.leaflet-overlay-pane svg {
|
.leaflet-overlay-pane svg {
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-tile-pane { z-index: 2; }
|
.leaflet-pane { z-index: 400; }
|
||||||
.leaflet-objects-pane { z-index: 3; }
|
|
||||||
.leaflet-overlay-pane { z-index: 4; }
|
.leaflet-tile-pane { z-index: 200; }
|
||||||
.leaflet-shadow-pane { z-index: 5; }
|
.leaflet-overlay-pane { z-index: 400; }
|
||||||
.leaflet-marker-pane { z-index: 6; }
|
.leaflet-shadow-pane { z-index: 500; }
|
||||||
.leaflet-popup-pane { z-index: 7; }
|
.leaflet-marker-pane { z-index: 600; }
|
||||||
|
.leaflet-tooltip-pane { z-index: 650; }
|
||||||
|
.leaflet-popup-pane { z-index: 700; }
|
||||||
|
|
||||||
|
.leaflet-map-pane canvas { z-index: 100; }
|
||||||
|
.leaflet-map-pane svg { z-index: 200; }
|
||||||
|
|
||||||
.leaflet-vml-shape {
|
.leaflet-vml-shape {
|
||||||
width: 1px;
|
width: 1px;
|
||||||
@@ -80,7 +106,8 @@
|
|||||||
|
|
||||||
.leaflet-control {
|
.leaflet-control {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 7;
|
z-index: 800;
|
||||||
|
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
.leaflet-top,
|
.leaflet-top,
|
||||||
@@ -124,7 +151,9 @@
|
|||||||
|
|
||||||
/* zoom and fade animations */
|
/* zoom and fade animations */
|
||||||
|
|
||||||
.leaflet-fade-anim .leaflet-tile,
|
.leaflet-fade-anim .leaflet-tile {
|
||||||
|
will-change: opacity;
|
||||||
|
}
|
||||||
.leaflet-fade-anim .leaflet-popup {
|
.leaflet-fade-anim .leaflet-popup {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
-webkit-transition: opacity 0.2s linear;
|
-webkit-transition: opacity 0.2s linear;
|
||||||
@@ -132,11 +161,17 @@
|
|||||||
-o-transition: opacity 0.2s linear;
|
-o-transition: opacity 0.2s linear;
|
||||||
transition: opacity 0.2s linear;
|
transition: opacity 0.2s linear;
|
||||||
}
|
}
|
||||||
.leaflet-fade-anim .leaflet-tile-loaded,
|
|
||||||
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
|
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
.leaflet-zoom-animated {
|
||||||
|
-webkit-transform-origin: 0 0;
|
||||||
|
-ms-transform-origin: 0 0;
|
||||||
|
transform-origin: 0 0;
|
||||||
|
}
|
||||||
|
.leaflet-zoom-anim .leaflet-zoom-animated {
|
||||||
|
will-change: transform;
|
||||||
|
}
|
||||||
.leaflet-zoom-anim .leaflet-zoom-animated {
|
.leaflet-zoom-anim .leaflet-zoom-animated {
|
||||||
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
|
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||||
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
|
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||||
@@ -144,8 +179,7 @@
|
|||||||
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
|
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||||
}
|
}
|
||||||
.leaflet-zoom-anim .leaflet-tile,
|
.leaflet-zoom-anim .leaflet-tile,
|
||||||
.leaflet-pan-anim .leaflet-tile,
|
.leaflet-pan-anim .leaflet-tile {
|
||||||
.leaflet-touching .leaflet-zoom-animated {
|
|
||||||
-webkit-transition: none;
|
-webkit-transition: none;
|
||||||
-moz-transition: none;
|
-moz-transition: none;
|
||||||
-o-transition: none;
|
-o-transition: none;
|
||||||
@@ -159,24 +193,44 @@
|
|||||||
|
|
||||||
/* cursors */
|
/* cursors */
|
||||||
|
|
||||||
.leaflet-clickable {
|
.leaflet-interactive {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.leaflet-container {
|
.leaflet-grab {
|
||||||
cursor: -webkit-grab;
|
cursor: -webkit-grab;
|
||||||
cursor: -moz-grab;
|
cursor: -moz-grab;
|
||||||
}
|
}
|
||||||
|
.leaflet-crosshair,
|
||||||
|
.leaflet-crosshair .leaflet-interactive {
|
||||||
|
cursor: crosshair;
|
||||||
|
}
|
||||||
.leaflet-popup-pane,
|
.leaflet-popup-pane,
|
||||||
.leaflet-control {
|
.leaflet-control {
|
||||||
cursor: auto;
|
cursor: auto;
|
||||||
}
|
}
|
||||||
.leaflet-dragging .leaflet-container,
|
.leaflet-dragging .leaflet-grab,
|
||||||
.leaflet-dragging .leaflet-clickable {
|
.leaflet-dragging .leaflet-grab .leaflet-interactive,
|
||||||
|
.leaflet-dragging .leaflet-marker-draggable {
|
||||||
cursor: move;
|
cursor: move;
|
||||||
cursor: -webkit-grabbing;
|
cursor: -webkit-grabbing;
|
||||||
cursor: -moz-grabbing;
|
cursor: -moz-grabbing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* marker & overlays interactivity */
|
||||||
|
.leaflet-marker-icon,
|
||||||
|
.leaflet-marker-shadow,
|
||||||
|
.leaflet-image-layer,
|
||||||
|
.leaflet-pane > svg path,
|
||||||
|
.leaflet-tile-container {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leaflet-marker-icon.leaflet-interactive,
|
||||||
|
.leaflet-image-layer.leaflet-interactive,
|
||||||
|
.leaflet-pane > svg path.leaflet-interactive {
|
||||||
|
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|
||||||
/* visual tweaks */
|
/* visual tweaks */
|
||||||
|
|
||||||
@@ -303,6 +357,10 @@
|
|||||||
color: #333;
|
color: #333;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
.leaflet-control-layers-scrollbar {
|
||||||
|
overflow-y: scroll;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
.leaflet-control-layers-selector {
|
.leaflet-control-layers-selector {
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -317,6 +375,11 @@
|
|||||||
margin: 5px -10px 5px -6px;
|
margin: 5px -10px 5px -6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Default icon URLs */
|
||||||
|
.leaflet-default-icon-path {
|
||||||
|
background-image: url(images/marker-icon.png);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* attribution and scale controls */
|
/* attribution and scale controls */
|
||||||
|
|
||||||
@@ -354,8 +417,8 @@
|
|||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
-moz-box-sizing: content-box;
|
-moz-box-sizing: border-box;
|
||||||
box-sizing: content-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
background: rgba(255, 255, 255, 0.5);
|
background: rgba(255, 255, 255, 0.5);
|
||||||
@@ -386,6 +449,7 @@
|
|||||||
.leaflet-popup {
|
.leaflet-popup {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
.leaflet-popup-content-wrapper {
|
.leaflet-popup-content-wrapper {
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
@@ -400,11 +464,13 @@
|
|||||||
margin: 18px 0;
|
margin: 18px 0;
|
||||||
}
|
}
|
||||||
.leaflet-popup-tip-container {
|
.leaflet-popup-tip-container {
|
||||||
margin: 0 auto;
|
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
position: relative;
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -20px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.leaflet-popup-tip {
|
.leaflet-popup-tip {
|
||||||
width: 17px;
|
width: 17px;
|
||||||
@@ -422,7 +488,7 @@
|
|||||||
.leaflet-popup-content-wrapper,
|
.leaflet-popup-content-wrapper,
|
||||||
.leaflet-popup-tip {
|
.leaflet-popup-tip {
|
||||||
background: white;
|
background: white;
|
||||||
|
color: #333;
|
||||||
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
|
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
|
||||||
}
|
}
|
||||||
.leaflet-container a.leaflet-popup-close-button {
|
.leaflet-container a.leaflet-popup-close-button {
|
||||||
@@ -430,6 +496,7 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
padding: 4px 4px 0 0;
|
padding: 4px 4px 0 0;
|
||||||
|
border: none;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 18px;
|
width: 18px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
@@ -476,3 +543,82 @@
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
border: 1px solid #666;
|
border: 1px solid #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Tooltip */
|
||||||
|
/* Base styles for the element that has a tooltip */
|
||||||
|
.leaflet-tooltip {
|
||||||
|
position: absolute;
|
||||||
|
padding: 6px;
|
||||||
|
background-color: #fff;
|
||||||
|
border: 1px solid #fff;
|
||||||
|
border-radius: 3px;
|
||||||
|
color: #222;
|
||||||
|
white-space: nowrap;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
pointer-events: none;
|
||||||
|
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
|
||||||
|
}
|
||||||
|
.leaflet-tooltip.leaflet-clickable {
|
||||||
|
cursor: pointer;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.leaflet-tooltip-top:before,
|
||||||
|
.leaflet-tooltip-bottom:before,
|
||||||
|
.leaflet-tooltip-left:before,
|
||||||
|
.leaflet-tooltip-right:before {
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
border: 6px solid transparent;
|
||||||
|
background: transparent;
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Directions */
|
||||||
|
|
||||||
|
.leaflet-tooltip-bottom {
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
.leaflet-tooltip-top {
|
||||||
|
margin-top: -6px;
|
||||||
|
}
|
||||||
|
.leaflet-tooltip-bottom:before,
|
||||||
|
.leaflet-tooltip-top:before {
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -6px;
|
||||||
|
}
|
||||||
|
.leaflet-tooltip-top:before {
|
||||||
|
bottom: 0;
|
||||||
|
margin-bottom: -12px;
|
||||||
|
border-top-color: #fff;
|
||||||
|
}
|
||||||
|
.leaflet-tooltip-bottom:before {
|
||||||
|
top: 0;
|
||||||
|
margin-top: -12px;
|
||||||
|
margin-left: -6px;
|
||||||
|
border-bottom-color: #fff;
|
||||||
|
}
|
||||||
|
.leaflet-tooltip-left {
|
||||||
|
margin-left: -6px;
|
||||||
|
}
|
||||||
|
.leaflet-tooltip-right {
|
||||||
|
margin-left: 6px;
|
||||||
|
}
|
||||||
|
.leaflet-tooltip-left:before,
|
||||||
|
.leaflet-tooltip-right:before {
|
||||||
|
top: 50%;
|
||||||
|
margin-top: -6px;
|
||||||
|
}
|
||||||
|
.leaflet-tooltip-left:before {
|
||||||
|
right: 0;
|
||||||
|
margin-right: -12px;
|
||||||
|
border-left-color: #fff;
|
||||||
|
}
|
||||||
|
.leaflet-tooltip-right:before {
|
||||||
|
left: 0;
|
||||||
|
margin-left: -12px;
|
||||||
|
border-right-color: #fff;
|
||||||
|
}
|
||||||
|
|||||||
2
assets/leaflet/leaflet.min.css
vendored
13
assets/osmtogeojson/.travis.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
sudo: false
|
||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- "iojs"
|
||||||
|
- "4.1"
|
||||||
|
- "4.0"
|
||||||
|
- "0.12"
|
||||||
|
- "0.10"
|
||||||
|
# whitelist
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- gh-pages
|
||||||
|
- /.*/
|
||||||
117
assets/osmtogeojson/CHANGELOG.md
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
2.2.12
|
||||||
|
------
|
||||||
|
backported from 3.0.0-dev: de-namespace full geometry content in output (internal state leak)
|
||||||
|
|
||||||
|
2.2.11
|
||||||
|
------
|
||||||
|
revert "use strict" because of some issues on older (0.…) nodejs
|
||||||
|
|
||||||
|
2.2.10
|
||||||
|
------
|
||||||
|
* fix another undeclared variable breaking the module in strict mode
|
||||||
|
* enable "use strict";
|
||||||
|
|
||||||
|
2.2.9
|
||||||
|
-----
|
||||||
|
split off polygon detection data: https://github.com/tyrasd/osm-polygon-features
|
||||||
|
|
||||||
|
2.2.8
|
||||||
|
-----
|
||||||
|
fix variable leaking into global scope
|
||||||
|
|
||||||
|
2.2.7
|
||||||
|
-----
|
||||||
|
fix a bug where loading certain complex `out geom` content resulted in invalid polygon geometries
|
||||||
|
|
||||||
|
2.2.6
|
||||||
|
-----
|
||||||
|
add bower support #45
|
||||||
|
|
||||||
|
2.2.5
|
||||||
|
-----
|
||||||
|
add `-m` parameter that minifies output json
|
||||||
|
|
||||||
|
2.2.4
|
||||||
|
-----
|
||||||
|
fixed a bug where full geometry information caused additional Point features in the output
|
||||||
|
|
||||||
|
2.2.3
|
||||||
|
-----
|
||||||
|
* updates to polygon detection: natural=cliff is not automatically an area, golf=* is rendered as polygons
|
||||||
|
* speed optimizations for xml input in CLI mode #34
|
||||||
|
|
||||||
|
2.2.1
|
||||||
|
-----
|
||||||
|
* fix bug with ref-less, clipped full geometry ways in JSON mode
|
||||||
|
|
||||||
|
2.2.0
|
||||||
|
-----
|
||||||
|
* support for Overpass API "full" geometry
|
||||||
|
|
||||||
|
2.1.0
|
||||||
|
-----
|
||||||
|
* implemented support for Overpass API geometry types "center" and "bounds"
|
||||||
|
* new command line option `-n` to make properties numeric
|
||||||
|
* added verbose option/mode that displays some debug info to the console/stderr
|
||||||
|
|
||||||
|
2.0.5
|
||||||
|
-----
|
||||||
|
* support input files larger than 256 MB. #17
|
||||||
|
|
||||||
|
2.0.4
|
||||||
|
-----
|
||||||
|
* fix unresolved xml entities in command line mode
|
||||||
|
|
||||||
|
2.0.2
|
||||||
|
-----
|
||||||
|
* fix a dangling dependency (which led fresh installations to crash prematurely)
|
||||||
|
|
||||||
|
2.0.0
|
||||||
|
-----
|
||||||
|
* simpler API (module exports as a plain function), old `.toGeojson` still available as a fallback
|
||||||
|
* output (multi)polygons with consistent winding orders
|
||||||
|
* improve handling of simple multipolygons
|
||||||
|
* use browserify for browser library (comes bundeled with dependencies)
|
||||||
|
* some minor speed improvements
|
||||||
|
|
||||||
|
1.4.0
|
||||||
|
-----
|
||||||
|
* fix various speed bottlenecks (xml parsing, geojson construction, …)
|
||||||
|
* better performance when handling large xml files with the cli tool: 
|
||||||
|
|
||||||
|
1.3.1
|
||||||
|
-----
|
||||||
|
* add --help and --version parameters to cli tool
|
||||||
|
* fix bug with not automatically detected file formats in pipe mode (cli tool)
|
||||||
|
|
||||||
|
1.3.0
|
||||||
|
-----
|
||||||
|
* more versatile cli tool (can read osm json, optionally enhanced output)
|
||||||
|
* many more unit tests
|
||||||
|
* fixed bugs with some partially incomplete data
|
||||||
|
|
||||||
|
1.2.1
|
||||||
|
-----
|
||||||
|
* fix wrong (inverse) logic in uninterestingTags callback evaluation (backported from master)
|
||||||
|
|
||||||
|
1.2.0
|
||||||
|
-----
|
||||||
|
* add [demo](http://tyrasd.github.io/osmtogeojson/) page
|
||||||
|
* support for pipes in cli tool: `echo '<osm><node lat="1.23" lon="3.21" id="-1" /></osm>' | osmtogeojson`
|
||||||
|
* add flat-properties output mode (default for the cli tool)
|
||||||
|
* add options to override default `uninterestingTags` and `polygonFeatures`
|
||||||
|
* better documentation
|
||||||
|
* more test cases
|
||||||
|
* further improvements in polygon feature detection
|
||||||
|
|
||||||
|
1.1.1
|
||||||
|
-----
|
||||||
|
* bugfix: remove unneeded debugging code
|
||||||
|
|
||||||
|
1.1.0
|
||||||
|
-----
|
||||||
|
* command line tool added
|
||||||
|
|
||||||
|
1.0.0
|
||||||
|
-----
|
||||||
|
* initial release
|
||||||
20
assets/osmtogeojson/LICENSE
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2013 Martin Raifer
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
6
assets/osmtogeojson/Makefile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
osmtogeojson.js: index.js package.json lodash.custom.js node_modules
|
||||||
|
browserify -s osmtogeojson index.js | uglifyjs -c -m -o osmtogeojson.js
|
||||||
|
coverage: .
|
||||||
|
istanbul cover _mocha -x lodash.custom.js -- -R spec
|
||||||
|
lodash: .
|
||||||
|
lodash exports=node include=clone,merge,isEmpty,isArray,compact,each -d
|
||||||
89
assets/osmtogeojson/README.md
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
osmtogeojson
|
||||||
|
============
|
||||||
|
|
||||||
|
Converts [OSM](http://openstreetmap.org) [data](http://wiki.openstreetmap.org/wiki/OSM_XML) to [GeoJSON](http://www.geojson.org/). Try the [demo](http://tyrasd.github.io/osmtogeojson/)!
|
||||||
|
|
||||||
|
* stable
|
||||||
|
* real OSM [polygon detection](https://wiki.openstreetmap.org/wiki/Overpass_turbo/Polygon_Features)
|
||||||
|
* proper OSM multipolygon support
|
||||||
|
* full support for extended Overpass API [geometry modes](http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Print_.28out.29)
|
||||||
|
* well [tested](https://github.com/tyrasd/osmtogeojson/tree/gh-pages/test/) and proven
|
||||||
|
* fast
|
||||||
|
|
||||||
|
This code is used in and maintained by the [overpass turbo](http://github.com/tyrasd/overpass-ide) project.
|
||||||
|
|
||||||
|
[](https://travis-ci.org/tyrasd/osmtogeojson)
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
|
|
||||||
|
### command line tool
|
||||||
|
|
||||||
|
Installation:
|
||||||
|
|
||||||
|
$ npm install -g osmtogeojson
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
$ osmtogeojson file.osm > file.geojson
|
||||||
|
|
||||||
|
Supported command line options are shown with:
|
||||||
|
|
||||||
|
$ osmtogeojson --help
|
||||||
|
|
||||||
|
When working with extra large data files (≳ 100 MB) it is recommended to run the programm with a little extra memory to avoid *process out of memory* errors. The easiest way to do this is by running the command as `node <path-to-osmtogeojson>` and setting the `--max_old_space_size=…` parameter to the available memory size in MB (osmtogeojson typically needs about 4-5 times the input data size):
|
||||||
|
|
||||||
|
$ node --max_old_space_size=8192 `which osmtogeojson` large.osm > large.geojson
|
||||||
|
|
||||||
|
### nodejs library
|
||||||
|
|
||||||
|
Installation:
|
||||||
|
|
||||||
|
$ npm install osmtogeojson
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
var osmtogeojson = require('osmtogeojson');
|
||||||
|
osmtogeojson(osm_data);
|
||||||
|
|
||||||
|
### browser library
|
||||||
|
|
||||||
|
<script src='osmtogeojson.js'></script>
|
||||||
|
|
||||||
|
osmtogeojson(osm_data);
|
||||||
|
|
||||||
|
API
|
||||||
|
---
|
||||||
|
|
||||||
|
### `osmtogeojson( data, options )`
|
||||||
|
|
||||||
|
Converts OSM data into GeoJSON.
|
||||||
|
|
||||||
|
* `data`: the OSM data. Either as a XML DOM or in [OSM JSON](http://overpass-api.de/output_formats.html#json).
|
||||||
|
* `options`: optional. The following options can be used:
|
||||||
|
* `flatProperties`: If true, the resulting GeoJSON feature's properties will be a simple key-value list instead of a structured json object (with separate tags and metadata). default: false
|
||||||
|
* `uninterestingTags`: Either a [blacklist](https://github.com/tyrasd/osmtogeojson/blob/2.0.0/index.js#L14-L24) of tag keys or a callback function. Will be used to decide if a feature is *interesting* enough for its own GeoJSON feature.
|
||||||
|
* `polygonFeatures`: Either a [json object](https://github.com/tyrasd/osmtogeojson/blob/2.0.0/polygon_features.json) or callback function that is used to determine if a closed way should be treated as a Polygon or LineString. [read more](https://wiki.openstreetmap.org/wiki/Overpass_turbo/Polygon_Features)
|
||||||
|
|
||||||
|
The result is a javascript object of GeoJSON data:
|
||||||
|
|
||||||
|
GeoJSON
|
||||||
|
-------
|
||||||
|
|
||||||
|
The GeoJSON produced by this library will include exactly one GeoJSON-feature for each of the following OSM objects (that is everything that is also visible in overpass turbo's map view):
|
||||||
|
|
||||||
|
* all unconnected or [*interesting*](#api) tagged nodes (POIs)
|
||||||
|
* all ways (except [*uninteresting*](#api) multipolygon outlines)
|
||||||
|
* all multipolygons (simple multipolygons with exactly one closed outer way are present via their outer way)
|
||||||
|
|
||||||
|
All data is given as a FeatureCollection. Each Feature in the collection has an `id` property that is formed from the type and id of the original OSM object (e.g. `node/123`) and has the member `properties` containing the following data:
|
||||||
|
|
||||||
|
* `type`: the OSM data type
|
||||||
|
* `id`: the OSM id
|
||||||
|
* `tags`: a collection of all tags
|
||||||
|
* `meta`: metainformaton about the feature (e.g. version, timestamp, user, etc.)
|
||||||
|
* `relations`: an array of relations the feature is member of. Each relation is encoded as an object literal containing the following properties: `role` (membership role), `rel` (the relation's id) and `reltags` (contains all tags of the relation)
|
||||||
|
* `tainted`: this flag is set when the feature's geometry is incomplete (e.g. missing nodes of a way or missing ways of a multipolygon)
|
||||||
|
|
||||||
|
If the [option](#api) `flatProperties` is set to true, the `properties` object will not contain any nested object literals, but directly provide a concise id, meta data and the tags of the respective OSM object.
|
||||||
|
|
||||||
26
assets/osmtogeojson/bower.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"name": "osmtogeojson",
|
||||||
|
"main": "osmtogeojson.js",
|
||||||
|
"version": "2.2.12",
|
||||||
|
"homepage": "http://tyrasd.github.io/osmtogeojson",
|
||||||
|
"authors": [
|
||||||
|
"Martin Raifer"
|
||||||
|
],
|
||||||
|
"description": "convert OSM to geojson",
|
||||||
|
"moduleType": [
|
||||||
|
"node"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"OSM",
|
||||||
|
"geoJSON",
|
||||||
|
"GIS"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"ignore": [
|
||||||
|
"**/.*",
|
||||||
|
"node_modules",
|
||||||
|
"bower_components",
|
||||||
|
"test",
|
||||||
|
"tests"
|
||||||
|
]
|
||||||
|
}
|
||||||
202
assets/osmtogeojson/index.html
Normal file
@@ -0,0 +1,202 @@
|
|||||||
|
<!--
|
||||||
|
demo page / introduction for osmtogeojson
|
||||||
|
https://tyrasd.github.io/osmtogeojson
|
||||||
|
https://github.com/tyrasd/osmtogeojson
|
||||||
|
this page is based on https://github.com/aaronlidman/osm-and-geojson (c)Aaron Lidman, WTFPL
|
||||||
|
-->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>osmtogeojson</title>
|
||||||
|
<script type="text/javascript" src="//code.jquery.com/jquery-1.10.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="osmtogeojson.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function toGeo(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var data = document.getElementById('osmxml').value || "<osm></osm>",
|
||||||
|
geojson;
|
||||||
|
try {
|
||||||
|
data = $.parseXML(data);
|
||||||
|
} catch(e) {
|
||||||
|
data = JSON.parse(data);
|
||||||
|
}
|
||||||
|
geojson = osmtogeojson(data);
|
||||||
|
document.getElementById('geojson').value = JSON.stringify(geojson, null, 4);
|
||||||
|
console.log(geojson);
|
||||||
|
}
|
||||||
|
$(function() {
|
||||||
|
$("#toGeo").click(toGeo);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
font-size: 18px;
|
||||||
|
background: white;
|
||||||
|
font-family: "Helvetica Neue", Helvetica, sans-serif;
|
||||||
|
width: 960px;
|
||||||
|
margin: 50px auto;
|
||||||
|
color: #222;
|
||||||
|
line-height: 1.7em
|
||||||
|
}
|
||||||
|
|
||||||
|
a { color: black; }
|
||||||
|
|
||||||
|
li {
|
||||||
|
line-height: 1.7em;
|
||||||
|
text-align: left;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea, input { outline: none; }
|
||||||
|
|
||||||
|
#left {
|
||||||
|
width: 49%;
|
||||||
|
float: left;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#osmxml, #geojson {
|
||||||
|
width: 100%;
|
||||||
|
background: white;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
height: 320px;
|
||||||
|
overflow: auto;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right {
|
||||||
|
width: 49%;
|
||||||
|
float: right;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
display: inline-block;
|
||||||
|
text-shadow: 0px 0px 1px black;
|
||||||
|
border-radius: 3px;
|
||||||
|
color: white;
|
||||||
|
background: #A33;
|
||||||
|
padding: 10px 15px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:hover {
|
||||||
|
background: #833;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:active {
|
||||||
|
box-shadow: inset 0 0 10px rgba(0,0,0,0.75);
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.5em;
|
||||||
|
padding: 7px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#top {
|
||||||
|
font-size: 22px;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#name {
|
||||||
|
font-size: 44px;
|
||||||
|
letter-spacing: -1px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#example {
|
||||||
|
clear: both;
|
||||||
|
width: 100%;
|
||||||
|
height: 500px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#about {
|
||||||
|
width: 720px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#download {
|
||||||
|
margin: 50px auto 0 auto;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#dl {
|
||||||
|
background: #569834;
|
||||||
|
padding: 7px 10px;
|
||||||
|
border-radius: 3px;
|
||||||
|
color: white;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
.disc { list-style: disc; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a href="https://github.com/tyrasd/osmtogeojson"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
|
||||||
|
<div id="top">
|
||||||
|
<span id="name">osmtogeojson</span> converts OSM data to GeoJSON.
|
||||||
|
</div>
|
||||||
|
<div id="example">
|
||||||
|
<div id="left">
|
||||||
|
<h3>OSM data</h3>
|
||||||
|
<textarea id="osmxml" contenteditable="true"></textarea>
|
||||||
|
</div>
|
||||||
|
<div id="right">
|
||||||
|
<h3>GeoJSON</h3>
|
||||||
|
<textarea id="geojson" contenteditable="true"></textarea>
|
||||||
|
</div>
|
||||||
|
<a class="button" href="" id="toGeo">convert to GeoJSON →</a>
|
||||||
|
</div>
|
||||||
|
<div id="about">
|
||||||
|
<p>osmtogeojson is a Javascript module for converting OSM data (OSM XML or Overpass JSON) to GeoJSON. It works in the browser, nodejs and can also be used as a command line tool. This OSM conversion code was written for and is maintained by the <a href="https://github.com/tyrasd/overpass-turbo">overpass-turbo</a> project.</p>
|
||||||
|
<span style="font-weight: bold;">Usage: </span>
|
||||||
|
<ul>
|
||||||
|
<li>In the browser:
|
||||||
|
<ul>
|
||||||
|
<li><code>
|
||||||
|
<script src='osmtogeojson.js'></script>
|
||||||
|
</code></li>
|
||||||
|
<li><code>
|
||||||
|
osmtogeojson(osm_data);
|
||||||
|
</code></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>As a nodejs library:
|
||||||
|
<ul>
|
||||||
|
<li><code>
|
||||||
|
$ npm install osmtogeojson
|
||||||
|
</code></li>
|
||||||
|
<li><code>
|
||||||
|
var osmtogeojson = require('osmtogeojson');<br>
|
||||||
|
osmtogeojson(xml_data);
|
||||||
|
</code></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>As a command line tool:
|
||||||
|
<ul>
|
||||||
|
<li><code>
|
||||||
|
$ npm install -g osmtogeojson
|
||||||
|
</code></li>
|
||||||
|
<li><code>
|
||||||
|
$ osmtogeojson file.osm > file.geojson
|
||||||
|
</code></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
Read more about the API in the official <a href="https://github.com/tyrasd/osmtogeojson#usage">documentation</a>.
|
||||||
|
<div id="download">
|
||||||
|
<p><a class="button" href="https://github.com/tyrasd/osmtogeojson/raw/gh-pages/osmtogeojson.js">download osmtogeojson.js</a><br/><br/>
|
||||||
|
github: <a href="https://github.com/tyrasd/osmtogeojson">tyrasd/osmtogeojson</a><br/>
|
||||||
|
npm: <a href="https://npmjs.org/package/osmtogeojson">osmtogeojson</a><br/>
|
||||||
|
license: <a href="https://github.com/tyrasd/osmtogeojson/blob/gh-pages/LICENSE">MIT</a><br/>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
945
assets/osmtogeojson/index.js
Normal file
@@ -0,0 +1,945 @@
|
|||||||
|
var _ = require("./lodash.custom.js");
|
||||||
|
var rewind = require("geojson-rewind");
|
||||||
|
|
||||||
|
// see https://wiki.openstreetmap.org/wiki/Overpass_turbo/Polygon_Features
|
||||||
|
var polygonFeatures = {};
|
||||||
|
require("osm-polygon-features").forEach(function(tags) {
|
||||||
|
if (tags.polygon === "all")
|
||||||
|
polygonFeatures[tags.key] = true;
|
||||||
|
else {
|
||||||
|
var list = (tags.polygon === "whitelist") ? "included_values" : "excluded_values",
|
||||||
|
tagValuesObj = {};
|
||||||
|
tags.values.forEach(function(value) { tagValuesObj[value] = true; });
|
||||||
|
polygonFeatures[tags.key] = {};
|
||||||
|
polygonFeatures[tags.key][list] = tagValuesObj;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var osmtogeojson = {};
|
||||||
|
|
||||||
|
osmtogeojson = function( data, options ) {
|
||||||
|
|
||||||
|
options = _.merge(
|
||||||
|
{
|
||||||
|
verbose: false,
|
||||||
|
flatProperties: false,
|
||||||
|
uninterestingTags: {
|
||||||
|
"source": true,
|
||||||
|
"source_ref": true,
|
||||||
|
"source:ref": true,
|
||||||
|
"history": true,
|
||||||
|
"attribution": true,
|
||||||
|
"created_by": true,
|
||||||
|
"tiger:county": true,
|
||||||
|
"tiger:tlid": true,
|
||||||
|
"tiger:upload_uuid": true
|
||||||
|
},
|
||||||
|
polygonFeatures: polygonFeatures,
|
||||||
|
},
|
||||||
|
options
|
||||||
|
);
|
||||||
|
|
||||||
|
var result;
|
||||||
|
if ( ((typeof XMLDocument !== "undefined") && data instanceof XMLDocument ||
|
||||||
|
(typeof XMLDocument === "undefined") && data.childNodes) )
|
||||||
|
result = _osmXML2geoJSON(data);
|
||||||
|
else
|
||||||
|
result = _overpassJSON2geoJSON(data);
|
||||||
|
return result;
|
||||||
|
|
||||||
|
function _overpassJSON2geoJSON(json) {
|
||||||
|
// sort elements
|
||||||
|
var nodes = new Array();
|
||||||
|
var ways = new Array();
|
||||||
|
var rels = new Array();
|
||||||
|
// helper functions
|
||||||
|
function centerGeometry(object) {
|
||||||
|
var pseudoNode = _.clone(object);
|
||||||
|
pseudoNode.lat = object.center.lat;
|
||||||
|
pseudoNode.lon = object.center.lon;
|
||||||
|
pseudoNode.__is_center_placeholder = true;
|
||||||
|
nodes.push(pseudoNode);
|
||||||
|
}
|
||||||
|
function boundsGeometry(object) {
|
||||||
|
var pseudoWay = _.clone(object);
|
||||||
|
pseudoWay.nodes = [];
|
||||||
|
function addPseudoNode(lat,lon,i) {
|
||||||
|
var pseudoNode = {
|
||||||
|
type:"node",
|
||||||
|
id: "_"+pseudoWay.type+"/"+pseudoWay.id+"bounds"+i,
|
||||||
|
lat: lat,
|
||||||
|
lon: lon
|
||||||
|
}
|
||||||
|
pseudoWay.nodes.push(pseudoNode.id);
|
||||||
|
nodes.push(pseudoNode);
|
||||||
|
}
|
||||||
|
addPseudoNode(pseudoWay.bounds.minlat,pseudoWay.bounds.minlon,1);
|
||||||
|
addPseudoNode(pseudoWay.bounds.maxlat,pseudoWay.bounds.minlon,2);
|
||||||
|
addPseudoNode(pseudoWay.bounds.maxlat,pseudoWay.bounds.maxlon,3);
|
||||||
|
addPseudoNode(pseudoWay.bounds.minlat,pseudoWay.bounds.maxlon,4);
|
||||||
|
pseudoWay.nodes.push(pseudoWay.nodes[0]);
|
||||||
|
pseudoWay.__is_bounds_placeholder = true;
|
||||||
|
ways.push(pseudoWay);
|
||||||
|
}
|
||||||
|
function fullGeometryWay(way) {
|
||||||
|
function addFullGeometryNode(lat,lon,id) {
|
||||||
|
var geometryNode = {
|
||||||
|
type:"node",
|
||||||
|
id: id,
|
||||||
|
lat: lat,
|
||||||
|
lon: lon,
|
||||||
|
__is_uninteresting: true
|
||||||
|
}
|
||||||
|
nodes.push(geometryNode);
|
||||||
|
}
|
||||||
|
if (!_.isArray(way.nodes)) {
|
||||||
|
way.nodes = way.geometry.map(function(nd) {
|
||||||
|
if (nd !== null) // have to skip ref-less nodes
|
||||||
|
return "_anonymous@"+nd.lat+"/"+nd.lon;
|
||||||
|
else
|
||||||
|
return "_anonymous@unknown_location";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
way.geometry.forEach(function(nd, i) {
|
||||||
|
if (nd) {
|
||||||
|
addFullGeometryNode(
|
||||||
|
nd.lat,
|
||||||
|
nd.lon,
|
||||||
|
way.nodes[i]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function fullGeometryRelation(rel) {
|
||||||
|
function addFullGeometryNode(lat,lon,id) {
|
||||||
|
var geometryNode = {
|
||||||
|
type:"node",
|
||||||
|
id: id,
|
||||||
|
lat: lat,
|
||||||
|
lon: lon
|
||||||
|
}
|
||||||
|
nodes.push(geometryNode);
|
||||||
|
}
|
||||||
|
function addFullGeometryWay(geometry,id) {
|
||||||
|
// shared multipolygon ways cannot be defined multiple times with the same id.
|
||||||
|
if (ways.some(function (way) { // todo: this is slow :(
|
||||||
|
return way.type == "way" && way.id == id;
|
||||||
|
})) return;
|
||||||
|
var geometryWay = {
|
||||||
|
type: "way",
|
||||||
|
id: id,
|
||||||
|
nodes:[]
|
||||||
|
}
|
||||||
|
function addFullGeometryWayPseudoNode(lat,lon) {
|
||||||
|
// todo? do not save the same pseudo node multiple times
|
||||||
|
var geometryPseudoNode = {
|
||||||
|
type:"node",
|
||||||
|
id: "_anonymous@"+lat+"/"+lon,
|
||||||
|
lat: lat,
|
||||||
|
lon: lon,
|
||||||
|
__is_uninteresting: true
|
||||||
|
}
|
||||||
|
geometryWay.nodes.push(geometryPseudoNode.id);
|
||||||
|
nodes.push(geometryPseudoNode);
|
||||||
|
}
|
||||||
|
geometry.forEach(function(nd) {
|
||||||
|
if (nd) {
|
||||||
|
addFullGeometryWayPseudoNode(
|
||||||
|
nd.lat,
|
||||||
|
nd.lon
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
geometryWay.nodes.push(undefined);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ways.push(geometryWay);
|
||||||
|
}
|
||||||
|
rel.members.forEach(function(member, i) {
|
||||||
|
if (member.type == "node") {
|
||||||
|
if (member.lat) {
|
||||||
|
addFullGeometryNode(
|
||||||
|
member.lat,
|
||||||
|
member.lon,
|
||||||
|
member.ref
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else if (member.type == "way") {
|
||||||
|
if (member.geometry) {
|
||||||
|
member.ref = "_fullGeom"+member.ref;
|
||||||
|
addFullGeometryWay(
|
||||||
|
member.geometry,
|
||||||
|
member.ref
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// create copies of individual json objects to make sure the original data doesn't get altered
|
||||||
|
// todo: cloning is slow: see if this can be done differently!
|
||||||
|
for (var i=0;i<json.elements.length;i++) {
|
||||||
|
switch (json.elements[i].type) {
|
||||||
|
case "node":
|
||||||
|
var node = json.elements[i];
|
||||||
|
nodes.push(node);
|
||||||
|
break;
|
||||||
|
case "way":
|
||||||
|
var way = _.clone(json.elements[i]);
|
||||||
|
way.nodes = _.clone(way.nodes);
|
||||||
|
ways.push(way);
|
||||||
|
if (way.center)
|
||||||
|
centerGeometry(way);
|
||||||
|
if (way.geometry)
|
||||||
|
fullGeometryWay(way);
|
||||||
|
else if (way.bounds)
|
||||||
|
boundsGeometry(way);
|
||||||
|
break;
|
||||||
|
case "relation":
|
||||||
|
var rel = _.clone(json.elements[i]);
|
||||||
|
rel.members = _.clone(rel.members);
|
||||||
|
rels.push(rel);
|
||||||
|
var has_full_geometry = rel.members && rel.members.some(function (member) {
|
||||||
|
return member.type == "node" && member.lat ||
|
||||||
|
member.type == "way" && member.geometry && member.geometry.length > 0
|
||||||
|
});
|
||||||
|
if (rel.center)
|
||||||
|
centerGeometry(rel);
|
||||||
|
if (has_full_geometry)
|
||||||
|
fullGeometryRelation(rel);
|
||||||
|
else if (rel.bounds)
|
||||||
|
boundsGeometry(rel);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// type=area (from coord-query) is an example for this case.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _convert2geoJSON(nodes,ways,rels);
|
||||||
|
}
|
||||||
|
function _osmXML2geoJSON(xml) {
|
||||||
|
// sort elements
|
||||||
|
var nodes = new Array();
|
||||||
|
var ways = new Array();
|
||||||
|
var rels = new Array();
|
||||||
|
// helper function
|
||||||
|
function copy_attribute( x, o, attr ) {
|
||||||
|
if (x.hasAttribute(attr))
|
||||||
|
o[attr] = x.getAttribute(attr);
|
||||||
|
}
|
||||||
|
function centerGeometry(object, centroid) {
|
||||||
|
var pseudoNode = _.clone(object);
|
||||||
|
copy_attribute(centroid, pseudoNode, 'lat');
|
||||||
|
copy_attribute(centroid, pseudoNode, 'lon');
|
||||||
|
pseudoNode.__is_center_placeholder = true;
|
||||||
|
nodes.push(pseudoNode);
|
||||||
|
}
|
||||||
|
function boundsGeometry(object, bounds) {
|
||||||
|
var pseudoWay = _.clone(object);
|
||||||
|
pseudoWay.nodes = [];
|
||||||
|
function addPseudoNode(lat,lon,i) {
|
||||||
|
var pseudoNode = {
|
||||||
|
type:"node",
|
||||||
|
id: "_"+pseudoWay.type+"/"+pseudoWay.id+"bounds"+i,
|
||||||
|
lat: lat,
|
||||||
|
lon: lon
|
||||||
|
}
|
||||||
|
pseudoWay.nodes.push(pseudoNode.id);
|
||||||
|
nodes.push(pseudoNode);
|
||||||
|
}
|
||||||
|
addPseudoNode(bounds.getAttribute('minlat'),bounds.getAttribute('minlon'),1);
|
||||||
|
addPseudoNode(bounds.getAttribute('maxlat'),bounds.getAttribute('minlon'),2);
|
||||||
|
addPseudoNode(bounds.getAttribute('maxlat'),bounds.getAttribute('maxlon'),3);
|
||||||
|
addPseudoNode(bounds.getAttribute('minlat'),bounds.getAttribute('maxlon'),4);
|
||||||
|
pseudoWay.nodes.push(pseudoWay.nodes[0]);
|
||||||
|
pseudoWay.__is_bounds_placeholder = true;
|
||||||
|
ways.push(pseudoWay);
|
||||||
|
}
|
||||||
|
function fullGeometryWay(way, nds) {
|
||||||
|
function addFullGeometryNode(lat,lon,id) {
|
||||||
|
var geometryNode = {
|
||||||
|
type:"node",
|
||||||
|
id: id,
|
||||||
|
lat: lat,
|
||||||
|
lon: lon,
|
||||||
|
__is_uninteresting: true
|
||||||
|
}
|
||||||
|
nodes.push(geometryNode);
|
||||||
|
return geometryNode.id;
|
||||||
|
}
|
||||||
|
if (!_.isArray(way.nodes)) {
|
||||||
|
way.nodes = [];
|
||||||
|
_.each( nds, function( nd, i ) {
|
||||||
|
way.nodes.push("_anonymous@"+nd.getAttribute('lat')+"/"+nd.getAttribute('lon'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_.each( nds, function( nd, i ) {
|
||||||
|
if (nd.getAttribute('lat')) {
|
||||||
|
addFullGeometryNode(
|
||||||
|
nd.getAttribute('lat'),
|
||||||
|
nd.getAttribute('lon'),
|
||||||
|
way.nodes[i]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function fullGeometryRelation(rel, members) {
|
||||||
|
function addFullGeometryNode(lat,lon,id) {
|
||||||
|
var geometryNode = {
|
||||||
|
type:"node",
|
||||||
|
id: id,
|
||||||
|
lat: lat,
|
||||||
|
lon: lon
|
||||||
|
}
|
||||||
|
nodes.push(geometryNode);
|
||||||
|
}
|
||||||
|
function addFullGeometryWay(nds,id) {
|
||||||
|
// shared multipolygon ways cannot be defined multiple times with the same id.
|
||||||
|
if (ways.some(function (way) { // todo: this is slow :(
|
||||||
|
return way.type == "way" && way.id == id;
|
||||||
|
})) return;
|
||||||
|
var geometryWay = {
|
||||||
|
type: "way",
|
||||||
|
id: id,
|
||||||
|
nodes:[]
|
||||||
|
}
|
||||||
|
function addFullGeometryWayPseudoNode(lat,lon) {
|
||||||
|
// todo? do not save the same pseudo node multiple times
|
||||||
|
var geometryPseudoNode = {
|
||||||
|
type:"node",
|
||||||
|
id: "_anonymous@"+lat+"/"+lon,
|
||||||
|
lat: lat,
|
||||||
|
lon: lon,
|
||||||
|
__is_uninteresting: true
|
||||||
|
}
|
||||||
|
geometryWay.nodes.push(geometryPseudoNode.id);
|
||||||
|
nodes.push(geometryPseudoNode);
|
||||||
|
}
|
||||||
|
_.each(nds, function(nd) {
|
||||||
|
if (nd.getAttribute('lat')) {
|
||||||
|
addFullGeometryWayPseudoNode(
|
||||||
|
nd.getAttribute('lat'),
|
||||||
|
nd.getAttribute('lon')
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
geometryWay.nodes.push(undefined);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ways.push(geometryWay);
|
||||||
|
}
|
||||||
|
_.each( members, function( member, i ) {
|
||||||
|
if (rel.members[i].type == "node") {
|
||||||
|
if (member.getAttribute('lat')) {
|
||||||
|
addFullGeometryNode(
|
||||||
|
member.getAttribute('lat'),
|
||||||
|
member.getAttribute('lon'),
|
||||||
|
rel.members[i].ref
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else if (rel.members[i].type == "way") {
|
||||||
|
if (member.getElementsByTagName('nd').length > 0) {
|
||||||
|
rel.members[i].ref = "_fullGeom"+rel.members[i].ref;
|
||||||
|
addFullGeometryWay(
|
||||||
|
member.getElementsByTagName('nd'),
|
||||||
|
rel.members[i].ref
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// nodes
|
||||||
|
_.each( xml.getElementsByTagName('node'), function( node, i ) {
|
||||||
|
var tags = {};
|
||||||
|
_.each( node.getElementsByTagName('tag'), function( tag ) {
|
||||||
|
tags[tag.getAttribute('k')] = tag.getAttribute('v');
|
||||||
|
});
|
||||||
|
var nodeObject = {
|
||||||
|
'type': 'node'
|
||||||
|
};
|
||||||
|
copy_attribute( node, nodeObject, 'id' );
|
||||||
|
copy_attribute( node, nodeObject, 'lat' );
|
||||||
|
copy_attribute( node, nodeObject, 'lon' );
|
||||||
|
copy_attribute( node, nodeObject, 'version' );
|
||||||
|
copy_attribute( node, nodeObject, 'timestamp' );
|
||||||
|
copy_attribute( node, nodeObject, 'changeset' );
|
||||||
|
copy_attribute( node, nodeObject, 'uid' );
|
||||||
|
copy_attribute( node, nodeObject, 'user' );
|
||||||
|
if (!_.isEmpty(tags))
|
||||||
|
nodeObject.tags = tags;
|
||||||
|
nodes.push(nodeObject);
|
||||||
|
});
|
||||||
|
// ways
|
||||||
|
var centroid,bounds;
|
||||||
|
_.each( xml.getElementsByTagName('way'), function( way, i ) {
|
||||||
|
var tags = {};
|
||||||
|
var wnodes = [];
|
||||||
|
_.each( way.getElementsByTagName('tag'), function( tag ) {
|
||||||
|
tags[tag.getAttribute('k')] = tag.getAttribute('v');
|
||||||
|
});
|
||||||
|
var has_full_geometry = false;
|
||||||
|
_.each( way.getElementsByTagName('nd'), function( nd, i ) {
|
||||||
|
var id;
|
||||||
|
if (id = nd.getAttribute('ref'))
|
||||||
|
wnodes[i] = id;
|
||||||
|
if (!has_full_geometry && nd.getAttribute('lat'))
|
||||||
|
has_full_geometry = true;
|
||||||
|
});
|
||||||
|
var wayObject = {
|
||||||
|
"type": "way"
|
||||||
|
};
|
||||||
|
copy_attribute( way, wayObject, 'id' );
|
||||||
|
copy_attribute( way, wayObject, 'version' );
|
||||||
|
copy_attribute( way, wayObject, 'timestamp' );
|
||||||
|
copy_attribute( way, wayObject, 'changeset' );
|
||||||
|
copy_attribute( way, wayObject, 'uid' );
|
||||||
|
copy_attribute( way, wayObject, 'user' );
|
||||||
|
if (wnodes.length > 0)
|
||||||
|
wayObject.nodes = wnodes;
|
||||||
|
if (!_.isEmpty(tags))
|
||||||
|
wayObject.tags = tags;
|
||||||
|
if (centroid = way.getElementsByTagName('center')[0])
|
||||||
|
centerGeometry(wayObject,centroid);
|
||||||
|
if (has_full_geometry)
|
||||||
|
fullGeometryWay(wayObject, way.getElementsByTagName('nd'));
|
||||||
|
else if (bounds = way.getElementsByTagName('bounds')[0])
|
||||||
|
boundsGeometry(wayObject,bounds);
|
||||||
|
ways.push(wayObject);
|
||||||
|
});
|
||||||
|
// relations
|
||||||
|
_.each( xml.getElementsByTagName('relation'), function( relation, i ) {
|
||||||
|
var tags = {};
|
||||||
|
var members = [];
|
||||||
|
_.each( relation.getElementsByTagName('tag'), function( tag ) {
|
||||||
|
tags[tag.getAttribute('k')] = tag.getAttribute('v');
|
||||||
|
});
|
||||||
|
var has_full_geometry = false;
|
||||||
|
_.each( relation.getElementsByTagName('member'), function( member, i ) {
|
||||||
|
members[i] = {};
|
||||||
|
copy_attribute( member, members[i], 'ref' );
|
||||||
|
copy_attribute( member, members[i], 'role' );
|
||||||
|
copy_attribute( member, members[i], 'type' );
|
||||||
|
if (!has_full_geometry &&
|
||||||
|
(members[i].type == 'node' && member.getAttribute('lat')) ||
|
||||||
|
(members[i].type == 'way' && member.getElementsByTagName('nd').length>0) )
|
||||||
|
has_full_geometry = true;
|
||||||
|
});
|
||||||
|
var relObject = {
|
||||||
|
"type": "relation"
|
||||||
|
}
|
||||||
|
copy_attribute( relation, relObject, 'id' );
|
||||||
|
copy_attribute( relation, relObject, 'version' );
|
||||||
|
copy_attribute( relation, relObject, 'timestamp' );
|
||||||
|
copy_attribute( relation, relObject, 'changeset' );
|
||||||
|
copy_attribute( relation, relObject, 'uid' );
|
||||||
|
copy_attribute( relation, relObject, 'user' );
|
||||||
|
if (members.length > 0)
|
||||||
|
relObject.members = members;
|
||||||
|
if (!_.isEmpty(tags))
|
||||||
|
relObject.tags = tags;
|
||||||
|
if (centroid = relation.getElementsByTagName('center')[0])
|
||||||
|
centerGeometry(relObject,centroid);
|
||||||
|
if (has_full_geometry)
|
||||||
|
fullGeometryRelation(relObject, relation.getElementsByTagName('member'));
|
||||||
|
else if (bounds = relation.getElementsByTagName('bounds')[0])
|
||||||
|
boundsGeometry(relObject,bounds);
|
||||||
|
rels.push(relObject);
|
||||||
|
});
|
||||||
|
return _convert2geoJSON(nodes,ways,rels);
|
||||||
|
}
|
||||||
|
function _convert2geoJSON(nodes,ways,rels) {
|
||||||
|
|
||||||
|
// helper function that checks if there are any tags other than "created_by", "source", etc. or any tag provided in ignore_tags
|
||||||
|
function has_interesting_tags(t, ignore_tags) {
|
||||||
|
if (typeof ignore_tags !== "object")
|
||||||
|
ignore_tags={};
|
||||||
|
if (typeof options.uninterestingTags === "function")
|
||||||
|
return !options.uninterestingTags(t, ignore_tags);
|
||||||
|
for (var k in t)
|
||||||
|
if (!(options.uninterestingTags[k]===true) &&
|
||||||
|
!(ignore_tags[k]===true || ignore_tags[k]===t[k]))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
// helper function to extract meta information
|
||||||
|
function build_meta_information(object) {
|
||||||
|
var res = {
|
||||||
|
"timestamp": object.timestamp,
|
||||||
|
"version": object.version,
|
||||||
|
"changeset": object.changeset,
|
||||||
|
"user": object.user,
|
||||||
|
"uid": object.uid
|
||||||
|
};
|
||||||
|
for (var k in res)
|
||||||
|
if (res[k] === undefined)
|
||||||
|
delete res[k];
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
// some data processing (e.g. filter nodes only used for ways)
|
||||||
|
var nodeids = new Object();
|
||||||
|
for (var i=0;i<nodes.length;i++) {
|
||||||
|
if (nodes[i].lat === undefined) {
|
||||||
|
if (options.verbose) console.warn('Node',nodes[i].type+'/'+nodes[i].id,'ignored because it has no coordinates');
|
||||||
|
continue; // ignore nodes without coordinates (e.g. returned by an ids_only query)
|
||||||
|
}
|
||||||
|
nodeids[nodes[i].id] = nodes[i];
|
||||||
|
}
|
||||||
|
var poinids = new Object();
|
||||||
|
for (var i=0;i<nodes.length;i++) {
|
||||||
|
if (typeof nodes[i].tags != 'undefined' &&
|
||||||
|
has_interesting_tags(nodes[i].tags)) // this checks if the node has any tags other than "created_by"
|
||||||
|
poinids[nodes[i].id] = true;
|
||||||
|
}
|
||||||
|
for (var i=0;i<rels.length;i++) {
|
||||||
|
if (!_.isArray(rels[i].members)) {
|
||||||
|
if (options.verbose) console.warn('Relation',rels[i].type+'/'+rels[i].id,'ignored because it has no members');
|
||||||
|
continue; // ignore relations without members (e.g. returned by an ids_only query)
|
||||||
|
}
|
||||||
|
for (var j=0;j<rels[i].members.length;j++) {
|
||||||
|
if (rels[i].members[j].type == "node")
|
||||||
|
poinids[rels[i].members[j].ref] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var wayids = new Object();
|
||||||
|
var waynids = new Object();
|
||||||
|
for (var i=0;i<ways.length;i++) {
|
||||||
|
if (!_.isArray(ways[i].nodes)) {
|
||||||
|
if (options.verbose) console.warn('Way',ways[i].type+'/'+ways[i].id,'ignored because it has no nodes');
|
||||||
|
continue; // ignore ways without nodes (e.g. returned by an ids_only query)
|
||||||
|
}
|
||||||
|
wayids[ways[i].id] = ways[i];
|
||||||
|
for (var j=0;j<ways[i].nodes.length;j++) {
|
||||||
|
waynids[ways[i].nodes[j]] = true;
|
||||||
|
ways[i].nodes[j] = nodeids[ways[i].nodes[j]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var pois = new Array();
|
||||||
|
for (var i=0;i<nodes.length;i++) {
|
||||||
|
if (((!waynids[nodes[i].id]) ||
|
||||||
|
(poinids[nodes[i].id])) &&
|
||||||
|
!nodes[i].__is_uninteresting)
|
||||||
|
pois.push(nodes[i]);
|
||||||
|
}
|
||||||
|
var relids = new Array();
|
||||||
|
for (var i=0;i<rels.length;i++) {
|
||||||
|
if (!_.isArray(rels[i].members)) {
|
||||||
|
if (options.verbose) console.warn('Relation',rels[i].type+'/'+rels[i].id,'ignored because it has no members');
|
||||||
|
continue; // ignore relations without members (e.g. returned by an ids_only query)
|
||||||
|
}
|
||||||
|
relids[rels[i].id] = rels[i];
|
||||||
|
}
|
||||||
|
var relsmap = {node: {}, way: {}, relation: {}};
|
||||||
|
for (var i=0;i<rels.length;i++) {
|
||||||
|
if (!_.isArray(rels[i].members)) {
|
||||||
|
if (options.verbose) console.warn('Relation',rels[i].type+'/'+rels[i].id,'ignored because it has no members');
|
||||||
|
continue; // ignore relations without members (e.g. returned by an ids_only query)
|
||||||
|
}
|
||||||
|
for (var j=0;j<rels[i].members.length;j++) {
|
||||||
|
var m_type = rels[i].members[j].type;
|
||||||
|
var m_ref = rels[i].members[j].ref;
|
||||||
|
if (typeof m_ref !== "number") {
|
||||||
|
// de-namespace full geometry content
|
||||||
|
m_ref = m_ref.replace("_fullGeom", "");
|
||||||
|
}
|
||||||
|
if (!relsmap[m_type]) {
|
||||||
|
if (options.verbose) console.warn('Relation',rels[i].type+'/'+rels[i].id,'member',m_type+'/'+m_ref,'ignored because it has an invalid type');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (typeof relsmap[m_type][m_ref] === "undefined")
|
||||||
|
relsmap[m_type][m_ref] = [];
|
||||||
|
relsmap[m_type][m_ref].push({
|
||||||
|
"role" : rels[i].members[j].role,
|
||||||
|
"rel" : rels[i].id,
|
||||||
|
"reltags" : rels[i].tags,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// construct geojson
|
||||||
|
var geojson;
|
||||||
|
var geojsonnodes = {
|
||||||
|
"type" : "FeatureCollection",
|
||||||
|
"features" : new Array()};
|
||||||
|
for (i=0;i<pois.length;i++) {
|
||||||
|
if (typeof pois[i].lon == "undefined" || typeof pois[i].lat == "undefined") {
|
||||||
|
if (options.verbose) console.warn('POI',pois[i].type+'/'+pois[i].id,'ignored because it lacks coordinates');
|
||||||
|
continue; // lon and lat are required for showing a point
|
||||||
|
}
|
||||||
|
var feature = {
|
||||||
|
"type" : "Feature",
|
||||||
|
"id" : pois[i].type+"/"+pois[i].id,
|
||||||
|
"properties" : {
|
||||||
|
"type" : pois[i].type,
|
||||||
|
"id" : pois[i].id,
|
||||||
|
"tags" : pois[i].tags || {},
|
||||||
|
"relations" : relsmap["node"][pois[i].id] || [],
|
||||||
|
"meta": build_meta_information(pois[i])
|
||||||
|
},
|
||||||
|
"geometry" : {
|
||||||
|
"type" : "Point",
|
||||||
|
"coordinates" : [+pois[i].lon, +pois[i].lat],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (pois[i].__is_center_placeholder)
|
||||||
|
feature.properties["geometry"] = "center";
|
||||||
|
geojsonnodes.features.push(feature);
|
||||||
|
}
|
||||||
|
var geojsonlines = {
|
||||||
|
"type" : "FeatureCollection",
|
||||||
|
"features" : new Array()};
|
||||||
|
var geojsonpolygons = {
|
||||||
|
"type" : "FeatureCollection",
|
||||||
|
"features" : new Array()};
|
||||||
|
// process multipolygons
|
||||||
|
for (var i=0;i<rels.length;i++) {
|
||||||
|
if ((typeof rels[i].tags != "undefined") &&
|
||||||
|
(rels[i].tags["type"] == "multipolygon" || rels[i].tags["type"] == "boundary")) {
|
||||||
|
if (!_.isArray(rels[i].members)) {
|
||||||
|
if (options.verbose) console.warn('Multipolygon',rels[i].type+'/'+rels[i].id,'ignored because it has no members');
|
||||||
|
continue; // ignore relations without members (e.g. returned by an ids_only query)
|
||||||
|
}
|
||||||
|
var outer_count = 0;
|
||||||
|
for (var j=0;j<rels[i].members.length;j++)
|
||||||
|
if (rels[i].members[j].role == "outer")
|
||||||
|
outer_count++;
|
||||||
|
else if (options.verbose && rels[i].members[j].role != "inner")
|
||||||
|
console.warn('Multipolygon',rels[i].type+'/'+rels[i].id,'member',rels[i].members[j].type+'/'+rels[i].members[j].ref,'ignored because it has an invalid role: "' + rels[i].members[j].role + '"');
|
||||||
|
rels[i].members.forEach(function(m) {
|
||||||
|
if (wayids[m.ref]) {
|
||||||
|
// this even works in the following corner case:
|
||||||
|
// a multipolygon amenity=xxx with outer line tagged amenity=yyy
|
||||||
|
// see https://github.com/tyrasd/osmtogeojson/issues/7
|
||||||
|
if (m.role==="outer" && !has_interesting_tags(wayids[m.ref].tags,rels[i].tags))
|
||||||
|
wayids[m.ref].is_multipolygon_outline = true;
|
||||||
|
if (m.role==="inner" && !has_interesting_tags(wayids[m.ref].tags))
|
||||||
|
wayids[m.ref].is_multipolygon_outline = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (outer_count == 0) {
|
||||||
|
if (options.verbose) console.warn('Multipolygon relation',rels[i].type+'/'+rels[i].id,'ignored because it has no outer ways');
|
||||||
|
continue; // ignore multipolygons without outer ways
|
||||||
|
}
|
||||||
|
var simple_mp = false;
|
||||||
|
var mp_geometry = '';
|
||||||
|
if (outer_count == 1 && !has_interesting_tags(rels[i].tags, {"type":true}))
|
||||||
|
simple_mp = true;
|
||||||
|
var feature = null;
|
||||||
|
if (!simple_mp) {
|
||||||
|
feature = construct_multipolygon(rels[i], rels[i]);
|
||||||
|
} else {
|
||||||
|
// simple multipolygon
|
||||||
|
var outer_way = rels[i].members.filter(function(m) {return m.role === "outer";})[0];
|
||||||
|
outer_way = wayids[outer_way.ref];
|
||||||
|
if (outer_way === undefined) {
|
||||||
|
if (options.verbose) console.warn('Multipolygon relation',rels[i].type+'/'+rels[i].id,'ignored because outer way', outer_way.type+'/'+outer_way.ref,'is missing');
|
||||||
|
continue; // abort if outer way object is not present
|
||||||
|
}
|
||||||
|
outer_way.is_multipolygon_outline = true;
|
||||||
|
feature = construct_multipolygon(outer_way, rels[i]);
|
||||||
|
}
|
||||||
|
if (feature === false) {
|
||||||
|
if (options.verbose) console.warn('Multipolygon relation',rels[i].type+'/'+rels[i].id,'ignored because it has invalid geometry');
|
||||||
|
continue; // abort if feature could not be constructed
|
||||||
|
}
|
||||||
|
geojsonpolygons.features.push(feature);
|
||||||
|
function construct_multipolygon(tag_object, rel) {
|
||||||
|
var is_tainted = false;
|
||||||
|
var mp_geometry = simple_mp ? 'way' : 'relation',
|
||||||
|
mp_id = typeof tag_object.id === "number" ? tag_object.id : +(tag_object.id.replace("_fullGeom", ""));
|
||||||
|
// prepare mp members
|
||||||
|
var members;
|
||||||
|
members = rel.members.filter(function(m) {return m.type === "way";});
|
||||||
|
members = members.map(function(m) {
|
||||||
|
var way = wayids[m.ref];
|
||||||
|
if (way === undefined) { // check for missing ways
|
||||||
|
if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'tainted by a missing way', m.type+'/'+m.ref);
|
||||||
|
is_tainted = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return { // TODO: this is slow! :(
|
||||||
|
id: m.ref,
|
||||||
|
role: m.role || "outer",
|
||||||
|
way: way,
|
||||||
|
nodes: way.nodes.filter(function(n) {
|
||||||
|
if (n !== undefined)
|
||||||
|
return true;
|
||||||
|
is_tainted = true;
|
||||||
|
if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'tainted by a way', m.type+'/'+m.ref, 'with a missing node');
|
||||||
|
return false;
|
||||||
|
})
|
||||||
|
};
|
||||||
|
});
|
||||||
|
members = _.compact(members);
|
||||||
|
// construct outer and inner rings
|
||||||
|
var outers, inners;
|
||||||
|
function join(ways) {
|
||||||
|
var _first = function(arr) {return arr[0]};
|
||||||
|
var _last = function(arr) {return arr[arr.length-1]};
|
||||||
|
// stolen from iD/relation.js
|
||||||
|
var joined = [], current, first, last, i, how, what;
|
||||||
|
while (ways.length) {
|
||||||
|
current = ways.pop().nodes.slice();
|
||||||
|
joined.push(current);
|
||||||
|
while (ways.length && _first(current) !== _last(current)) {
|
||||||
|
first = _first(current);
|
||||||
|
last = _last(current);
|
||||||
|
for (i = 0; i < ways.length; i++) {
|
||||||
|
what = ways[i].nodes;
|
||||||
|
if (last === _first(what)) {
|
||||||
|
how = current.push;
|
||||||
|
what = what.slice(1);
|
||||||
|
break;
|
||||||
|
} else if (last === _last(what)) {
|
||||||
|
how = current.push;
|
||||||
|
what = what.slice(0, -1).reverse();
|
||||||
|
break;
|
||||||
|
} else if (first == _last(what)) {
|
||||||
|
how = current.unshift;
|
||||||
|
what = what.slice(0, -1);
|
||||||
|
break;
|
||||||
|
} else if (first == _first(what)) {
|
||||||
|
how = current.unshift;
|
||||||
|
what = what.slice(1).reverse();
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
what = how = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!what) {
|
||||||
|
if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'contains unclosed ring geometry');
|
||||||
|
break; // Invalid geometry (dangling way, unclosed ring)
|
||||||
|
}
|
||||||
|
ways.splice(i, 1);
|
||||||
|
how.apply(current, what);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return joined;
|
||||||
|
}
|
||||||
|
outers = join(members.filter(function(m) {return m.role==="outer";}));
|
||||||
|
inners = join(members.filter(function(m) {return m.role==="inner";}));
|
||||||
|
// sort rings
|
||||||
|
var mp;
|
||||||
|
function findOuter(inner) {
|
||||||
|
var polygonIntersectsPolygon = function(outer, inner) {
|
||||||
|
for (var i=0; i<inner.length; i++)
|
||||||
|
if (pointInPolygon(inner[i], outer))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var mapCoordinates = function(from) {
|
||||||
|
return from.map(function(n) {
|
||||||
|
return [+n.lat,+n.lon];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// stolen from iD/geo.js,
|
||||||
|
// based on https://github.com/substack/point-in-polygon,
|
||||||
|
// ray-casting algorithm based on http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
|
||||||
|
var pointInPolygon = function(point, polygon) {
|
||||||
|
var x = point[0], y = point[1], inside = false;
|
||||||
|
for (var i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
||||||
|
var xi = polygon[i][0], yi = polygon[i][1];
|
||||||
|
var xj = polygon[j][0], yj = polygon[j][1];
|
||||||
|
var intersect = ((yi > y) != (yj > y)) &&
|
||||||
|
(x < (xj - xi) * (y - yi) / (yj - yi) + xi);
|
||||||
|
if (intersect) inside = !inside;
|
||||||
|
}
|
||||||
|
return inside;
|
||||||
|
};
|
||||||
|
// stolen from iD/relation.js
|
||||||
|
var o, outer;
|
||||||
|
// todo: all this coordinate mapping makes this unneccesarily slow.
|
||||||
|
// see the "todo: this is slow! :(" above.
|
||||||
|
inner = mapCoordinates(inner);
|
||||||
|
/*for (o = 0; o < outers.length; o++) {
|
||||||
|
outer = mapCoordinates(outers[o]);
|
||||||
|
if (polygonContainsPolygon(outer, inner))
|
||||||
|
return o;
|
||||||
|
}*/
|
||||||
|
for (o = 0; o < outers.length; o++) {
|
||||||
|
outer = mapCoordinates(outers[o]);
|
||||||
|
if (polygonIntersectsPolygon(outer, inner))
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mp = outers.map(function(o) {return [o];});
|
||||||
|
for (var j=0; j<inners.length; j++) {
|
||||||
|
var o = findOuter(inners[j]);
|
||||||
|
if (o !== undefined)
|
||||||
|
mp[o].push(inners[j]);
|
||||||
|
else
|
||||||
|
if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'contains an inner ring with no containing outer');
|
||||||
|
// so, no outer ring for this inner ring is found.
|
||||||
|
// We're going to ignore holes in empty space.
|
||||||
|
;
|
||||||
|
}
|
||||||
|
// sanitize mp-coordinates (remove empty clusters or rings, {lat,lon,...} to [lon,lat]
|
||||||
|
var mp_coords = [];
|
||||||
|
mp_coords = _.compact(mp.map(function(cluster) {
|
||||||
|
var cl = _.compact(cluster.map(function(ring) {
|
||||||
|
if (ring.length < 4) { // todo: is this correct: ring.length < 4 ?
|
||||||
|
if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'contains a ring with less than four nodes');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return _.compact(ring.map(function(node) {
|
||||||
|
return [+node.lon,+node.lat];
|
||||||
|
}));
|
||||||
|
}));
|
||||||
|
if (cl.length == 0) {
|
||||||
|
if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'contains an empty ring cluster');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return cl;
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (mp_coords.length == 0) {
|
||||||
|
if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'contains no coordinates');
|
||||||
|
return false; // ignore multipolygons without coordinates
|
||||||
|
}
|
||||||
|
var mp_type = "MultiPolygon";
|
||||||
|
if (mp_coords.length === 1) {
|
||||||
|
mp_type = "Polygon";
|
||||||
|
mp_coords = mp_coords[0];
|
||||||
|
}
|
||||||
|
// mp parsed, now construct the geoJSON
|
||||||
|
var feature = {
|
||||||
|
"type" : "Feature",
|
||||||
|
"id" : tag_object.type+"/"+mp_id,
|
||||||
|
"properties" : {
|
||||||
|
"type" : tag_object.type,
|
||||||
|
"id" : mp_id,
|
||||||
|
"tags" : tag_object.tags || {},
|
||||||
|
"relations" : relsmap[tag_object.type][tag_object.id] || [],
|
||||||
|
"meta": build_meta_information(tag_object)
|
||||||
|
},
|
||||||
|
"geometry" : {
|
||||||
|
"type" : mp_type,
|
||||||
|
"coordinates" : mp_coords,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (is_tainted) {
|
||||||
|
if (options.verbose) console.warn('Multipolygon', mp_geometry+'/'+mp_id, 'is tainted');
|
||||||
|
feature.properties["tainted"] = true;
|
||||||
|
}
|
||||||
|
return feature;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// process lines and polygons
|
||||||
|
for (var i=0;i<ways.length;i++) {
|
||||||
|
if (!_.isArray(ways[i].nodes)) {
|
||||||
|
if (options.verbose) console.warn('Way',ways[i].type+'/'+ways[i].id,'ignored because it has no nodes');
|
||||||
|
continue; // ignore ways without nodes (e.g. returned by an ids_only query)
|
||||||
|
}
|
||||||
|
if (ways[i].is_multipolygon_outline)
|
||||||
|
continue; // ignore ways which are already rendered as (part of) a multipolygon
|
||||||
|
if (typeof ways[i].id !== "number") {
|
||||||
|
// remove full geometry namespace for output
|
||||||
|
ways[i].id = +ways[i].id.replace("_fullGeom", "");
|
||||||
|
}
|
||||||
|
ways[i].tainted = false;
|
||||||
|
ways[i].hidden = false;
|
||||||
|
var coords = new Array();
|
||||||
|
for (j=0;j<ways[i].nodes.length;j++) {
|
||||||
|
if (typeof ways[i].nodes[j] == "object")
|
||||||
|
coords.push([+ways[i].nodes[j].lon, +ways[i].nodes[j].lat]);
|
||||||
|
else {
|
||||||
|
if (options.verbose) console.warn('Way',ways[i].type+'/'+ways[i].id,'is tainted by an invalid node');
|
||||||
|
ways[i].tainted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (coords.length <= 1) { // invalid way geometry
|
||||||
|
if (options.verbose) console.warn('Way',ways[i].type+'/'+ways[i].id,'ignored because it contains too few nodes');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var way_type = "LineString"; // default
|
||||||
|
if (typeof ways[i].nodes[0] != "undefined" && // way has its nodes loaded
|
||||||
|
ways[i].nodes[0] === ways[i].nodes[ways[i].nodes.length-1] && // ... and forms a closed ring
|
||||||
|
(
|
||||||
|
typeof ways[i].tags != "undefined" && // ... and has tags
|
||||||
|
_isPolygonFeature(ways[i].tags) // ... and tags say it is a polygon
|
||||||
|
|| // or is a placeholder for a bounds geometry
|
||||||
|
ways[i].__is_bounds_placeholder
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
way_type = "Polygon";
|
||||||
|
coords = [coords];
|
||||||
|
}
|
||||||
|
var feature = {
|
||||||
|
"type" : "Feature",
|
||||||
|
"id" : ways[i].type+"/"+ways[i].id,
|
||||||
|
"properties" : {
|
||||||
|
"type" : ways[i].type,
|
||||||
|
"id" : ways[i].id,
|
||||||
|
"tags" : ways[i].tags || {},
|
||||||
|
"relations" : relsmap["way"][ways[i].id] || [],
|
||||||
|
"meta": build_meta_information(ways[i])
|
||||||
|
},
|
||||||
|
"geometry" : {
|
||||||
|
"type" : way_type,
|
||||||
|
"coordinates" : coords,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ways[i].tainted) {
|
||||||
|
if (options.verbose) console.warn('Way',ways[i].type+'/'+ways[i].id,'is tainted');
|
||||||
|
feature.properties["tainted"] = true;
|
||||||
|
}
|
||||||
|
if (ways[i].__is_bounds_placeholder)
|
||||||
|
feature.properties["geometry"] = "bounds";
|
||||||
|
if (way_type == "LineString")
|
||||||
|
geojsonlines.features.push(feature);
|
||||||
|
else
|
||||||
|
geojsonpolygons.features.push(feature);
|
||||||
|
}
|
||||||
|
|
||||||
|
geojson = {
|
||||||
|
"type": "FeatureCollection",
|
||||||
|
"features": []
|
||||||
|
};
|
||||||
|
geojson.features = geojson.features.concat(geojsonpolygons.features);
|
||||||
|
geojson.features = geojson.features.concat(geojsonlines.features);
|
||||||
|
geojson.features = geojson.features.concat(geojsonnodes.features);
|
||||||
|
// optionally, flatten properties
|
||||||
|
if (options.flatProperties) {
|
||||||
|
geojson.features.forEach(function(f) {
|
||||||
|
f.properties = _.merge(
|
||||||
|
f.properties.meta,
|
||||||
|
f.properties.tags,
|
||||||
|
{id: f.properties.type+"/"+f.properties.id}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// fix polygon winding
|
||||||
|
geojson = rewind(geojson, true /*remove for geojson-rewind >0.1.0*/);
|
||||||
|
return geojson;
|
||||||
|
}
|
||||||
|
function _isPolygonFeature( tags ) {
|
||||||
|
var polygonFeatures = options.polygonFeatures;
|
||||||
|
if (typeof polygonFeatures === "function")
|
||||||
|
return polygonFeatures(tags);
|
||||||
|
// explicitely tagged non-areas
|
||||||
|
if ( tags['area'] === 'no' )
|
||||||
|
return false;
|
||||||
|
// assuming that a typical OSM way has in average less tags than
|
||||||
|
// the polygonFeatures list, this way around should be faster
|
||||||
|
for ( var key in tags ) {
|
||||||
|
var val = tags[key];
|
||||||
|
var pfk = polygonFeatures[key];
|
||||||
|
// continue with next if tag is unknown or not "categorizing"
|
||||||
|
if ( typeof pfk === 'undefined' )
|
||||||
|
continue;
|
||||||
|
// continue with next if tag is explicitely un-set ("building=no")
|
||||||
|
if ( val === 'no' )
|
||||||
|
continue;
|
||||||
|
// check polygon features for: general acceptance, included or excluded values
|
||||||
|
if ( pfk === true )
|
||||||
|
return true;
|
||||||
|
if ( pfk.included_values && pfk.included_values[val] === true )
|
||||||
|
return true;
|
||||||
|
if ( pfk.excluded_values && pfk.excluded_values[val] !== true )
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// if no tags matched, this ain't no area.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// for backwards compatibility
|
||||||
|
osmtogeojson.toGeojson = osmtogeojson;
|
||||||
|
|
||||||
|
module.exports = osmtogeojson;
|
||||||
1794
assets/osmtogeojson/lodash.custom.js
Normal file
147
assets/osmtogeojson/osmtogeojson
Executable file
@@ -0,0 +1,147 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var osmtogeojson = require('./'),
|
||||||
|
opt = require('optimist')
|
||||||
|
.usage('Usage: $0 [-f format] [-e] [-v] FILE')
|
||||||
|
.string('f').describe('f', 'file format. if not given, will be detected from filename. supported values: osm, json')
|
||||||
|
.boolean('e').describe('e', 'enhanced properties. if set, the resulting GeoJSON feature\'s properties will contain more structured information')
|
||||||
|
.boolean('n').describe('n', 'numeric properties. if set, the resulting GeoJSON feature\'s properties will be numbers if possible')
|
||||||
|
.boolean('v').describe('v', 'verbose mode. output diagnostic information during processing')
|
||||||
|
.boolean('m').describe('m', 'minify output json (no identation and linebreaks)')
|
||||||
|
.boolean('version').describe('version','display software version')
|
||||||
|
.boolean('help').describe('help','print this help message'),
|
||||||
|
argv = opt.argv,
|
||||||
|
fs = require('fs'),
|
||||||
|
concat = require('concat-stream'),
|
||||||
|
xmldom = new (require('xmldom').DOMParser)(),
|
||||||
|
osmxmlParser = require('./parse_osmxml.js'),
|
||||||
|
JSONStream = require('JSONStream'),
|
||||||
|
geojsonNumeric = require('geojson-numeric'),
|
||||||
|
pack = require('./package.json');
|
||||||
|
|
||||||
|
if (argv.help) {
|
||||||
|
return opt.showHelp();
|
||||||
|
}
|
||||||
|
if (argv.version) {
|
||||||
|
process.stdout.write(pack.version+'\n');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var filename = argv._[0] || '';
|
||||||
|
|
||||||
|
var enhanced_geojson = argv.e;
|
||||||
|
var format = argv.f;
|
||||||
|
|
||||||
|
if (format === 'xml') format = 'osm';
|
||||||
|
// detect file format from filename
|
||||||
|
if (!format) {
|
||||||
|
if (filename.match(/\.osm$/i)) format = 'osm';
|
||||||
|
if (filename.match(/\.xml$/i)) format = 'osm';
|
||||||
|
if (filename.match(/\.json$/i)) format = 'json';
|
||||||
|
}
|
||||||
|
// fall back to the native JSON parser if the file is small enough
|
||||||
|
// (unfortunately, the streaming JSON parser isn't very fast)
|
||||||
|
if (format === 'json' && filename) {
|
||||||
|
if (fs.statSync(filename).size < 268435577)
|
||||||
|
format = 'nativejson';
|
||||||
|
}
|
||||||
|
// fall back to autodetection if still no format
|
||||||
|
if (!format) format = 'auto';
|
||||||
|
|
||||||
|
var datastream = (filename ? fs.createReadStream(filename) : process.stdin);
|
||||||
|
|
||||||
|
// use streaming parsers if format is already known
|
||||||
|
switch(format) {
|
||||||
|
case 'json':
|
||||||
|
case 'streamjson':
|
||||||
|
datastream.pipe(JSONStream.parse())
|
||||||
|
.on('root', function(data) {
|
||||||
|
// iron out some nasty floating point rounding errors
|
||||||
|
if (data.version) data.version = Math.round(data.version*1000)/1000;
|
||||||
|
data.elements.forEach(function(element) {
|
||||||
|
if (element.lat) element.lat = Math.round(element.lat*1E12)/1E12;
|
||||||
|
if (element.lon) element.lon = Math.round(element.lon*1E12)/1E12;
|
||||||
|
});
|
||||||
|
// convert to geojson
|
||||||
|
convert(data);
|
||||||
|
})
|
||||||
|
.on('error', function(err) {
|
||||||
|
process.stderr.write("ERROR: JSON input stream could not be parsed.\n");
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'osm':
|
||||||
|
case 'streamxml':
|
||||||
|
datastream
|
||||||
|
.on('data', function(chunk) {
|
||||||
|
osmxmlParser.write(chunk);
|
||||||
|
})
|
||||||
|
.on('end', function() {
|
||||||
|
osmxmlParser.end();
|
||||||
|
data = osmxmlParser.getJSON();
|
||||||
|
convert(data);
|
||||||
|
});
|
||||||
|
datastream.resume();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// otherwise use leagacy non-streaming parsers
|
||||||
|
datastream.pipe(concat(legacyParsers));
|
||||||
|
}
|
||||||
|
|
||||||
|
function legacyParsers(data) {
|
||||||
|
if (!data) data = ''; else data = data.toString();
|
||||||
|
if (format === 'auto') {
|
||||||
|
if (data.match(/^\s*</)) // (osm) xml files begin with a "<"
|
||||||
|
format = 'osm';
|
||||||
|
else if (data.match(/^\s*{/)) // osm json files begin with a "{"
|
||||||
|
format = 'json';
|
||||||
|
else {
|
||||||
|
format = 'unknown';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch (format) {
|
||||||
|
case 'xmldom':
|
||||||
|
data = xmldom.parseFromString(data);
|
||||||
|
break;
|
||||||
|
case 'json':
|
||||||
|
case 'nativejson':
|
||||||
|
data = JSON.parse(data);
|
||||||
|
break;
|
||||||
|
case 'osm':
|
||||||
|
case 'fastxml':
|
||||||
|
data = osmxmlParser.parseFromString(data);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
process.stderr.write('This doesn\'t look like a recognized file format.\n');
|
||||||
|
opt.showHelp();
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
convert(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function convert(data) {
|
||||||
|
var geojson = osmtogeojson(data, {
|
||||||
|
flatProperties: !enhanced_geojson,
|
||||||
|
verbose: argv.v
|
||||||
|
});
|
||||||
|
output(geojson);
|
||||||
|
}
|
||||||
|
|
||||||
|
function output(geojson) {
|
||||||
|
// this is much faster than a simple JSON.stringify of the whole geojson
|
||||||
|
// object. also, this is less memory intensive and output starts right
|
||||||
|
// after the conversion without any additional delay
|
||||||
|
process.stdout.on('error', function() {});
|
||||||
|
|
||||||
|
var separator = argv.m ? '' : '\n';
|
||||||
|
|
||||||
|
process.stdout.write('{'+separator+'"type": "FeatureCollection",'+separator+'"features": ['+separator);
|
||||||
|
geojson.features.forEach(function(f,i) {
|
||||||
|
if (argv.n)
|
||||||
|
f = geojsonNumeric(f,argv.e);
|
||||||
|
process.stdout.write(JSON.stringify(f, null, argv.m ? 0 : 2));
|
||||||
|
if (i != geojson.features.length-1)
|
||||||
|
process.stdout.write(','+separator);
|
||||||
|
});
|
||||||
|
process.stdout.write(separator+']'+separator+'}'+separator);
|
||||||
|
}
|
||||||
1
assets/osmtogeojson/osmtogeojson.js
Normal file
47
assets/osmtogeojson/package.json
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"name": "osmtogeojson",
|
||||||
|
"version": "2.2.12",
|
||||||
|
"description": "convert OSM to geojson",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"pretest": "npm ls --depth=Infinity > /dev/null",
|
||||||
|
"test": "npm run test-lib && npm run test-cli",
|
||||||
|
"test-lib": "mocha -R spec",
|
||||||
|
"test-cli": "node test-cli/cli.test.js | faucet"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"osmtogeojson": "osmtogeojson"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/tyrasd/osmtogeojson.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"openstreetmap",
|
||||||
|
"geojson"
|
||||||
|
],
|
||||||
|
"author": "Martin Raifer",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/tyrasd/osmtogeojson/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"JSONStream": "0.8.0",
|
||||||
|
"concat-stream": "~1.0.1",
|
||||||
|
"geojson-numeric": "0.2.0",
|
||||||
|
"geojson-rewind": "0.1.0",
|
||||||
|
"htmlparser2": "3.5.1",
|
||||||
|
"optimist": "~0.3.5",
|
||||||
|
"osm-polygon-features": "^0.9.1",
|
||||||
|
"xmldom": "~0.1.16"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"expect.js": "~0.2.0",
|
||||||
|
"mocha": "~1.12.0",
|
||||||
|
"tape": "~2.10.2",
|
||||||
|
"faucet": "~0.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.5"
|
||||||
|
}
|
||||||
|
}
|
||||||
91
assets/osmtogeojson/parse_osmxml.js
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
/* converts OSM XML to OSM JSON using a fast streaming parser */
|
||||||
|
var htmlparser = require('htmlparser2');
|
||||||
|
var _ = require("./lodash.custom.js");
|
||||||
|
|
||||||
|
var json = {
|
||||||
|
"version": 0.6,
|
||||||
|
"elements": []
|
||||||
|
};
|
||||||
|
var buffer = {};
|
||||||
|
var p = new htmlparser.Parser({
|
||||||
|
onopentag: function(name, attr) {
|
||||||
|
switch (name) {
|
||||||
|
case "node":
|
||||||
|
case "way":
|
||||||
|
case "relation":
|
||||||
|
buffer = {
|
||||||
|
type: name,
|
||||||
|
tags: {}
|
||||||
|
}
|
||||||
|
_.merge(buffer, attr);
|
||||||
|
if (name === "way") {
|
||||||
|
buffer.nodes = [];
|
||||||
|
buffer.geometry = [];
|
||||||
|
}
|
||||||
|
if (name === "relation") {
|
||||||
|
buffer.members = [];
|
||||||
|
buffer.nodes = [];
|
||||||
|
buffer.geometry = [];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "tag":
|
||||||
|
buffer.tags[attr.k] = attr.v;
|
||||||
|
break;
|
||||||
|
case "nd":
|
||||||
|
buffer.nodes.push(attr.ref);
|
||||||
|
if (attr.lat) {
|
||||||
|
buffer.geometry.push({
|
||||||
|
lat: attr.lat,
|
||||||
|
lon: attr.lon
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
buffer.geometry.push(null);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "member":
|
||||||
|
buffer.members.push(attr);
|
||||||
|
break;
|
||||||
|
case "center":
|
||||||
|
buffer.center = {
|
||||||
|
lat: attr.lat,
|
||||||
|
lon: attr.lon
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case "bounds":
|
||||||
|
buffer.bounds = {
|
||||||
|
minlat: attr.minlat,
|
||||||
|
minlon: attr.minlon,
|
||||||
|
maxlat: attr.maxlat,
|
||||||
|
maxlon: attr.maxlon
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ontext: function(text) {
|
||||||
|
},
|
||||||
|
onclosetag: function(name) {
|
||||||
|
if (name === "node" || name === "way" || name === "relation" || name === "area") {
|
||||||
|
// remove empty geometry or nodes arrays
|
||||||
|
if (buffer.geometry && buffer.geometry.every(function(g) {return g===null;}))
|
||||||
|
delete buffer.geometry;
|
||||||
|
if (name === "relation")
|
||||||
|
delete buffer.nodes;
|
||||||
|
json.elements.push(buffer);
|
||||||
|
}
|
||||||
|
if (name === "member") {
|
||||||
|
if (buffer.geometry) {
|
||||||
|
buffer.members[buffer.members.length-1].geometry = buffer.geometry;
|
||||||
|
buffer.geometry = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
decodeEntities: true,
|
||||||
|
xmlMode: true
|
||||||
|
});
|
||||||
|
|
||||||
|
p.parseFromString = function(xml_str) { p.write(xml_str); p.end(); return json; }
|
||||||
|
p.getJSON = function() {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = p;
|
||||||
67
assets/spin-js/Gruntfile.js
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/**
|
||||||
|
* Workflow to release a new version:
|
||||||
|
* grunt bump-only:minor
|
||||||
|
* grunt
|
||||||
|
* grunt gh-pages
|
||||||
|
* grunt bump-commit
|
||||||
|
* git push --tags
|
||||||
|
* npm publish
|
||||||
|
*/
|
||||||
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
|
grunt.initConfig({
|
||||||
|
pkg: grunt.file.readJSON('package.json'),
|
||||||
|
|
||||||
|
copy: {
|
||||||
|
js: {
|
||||||
|
files: [
|
||||||
|
{ src: ['spin.js', 'jquery.spin.js'], dest: 'site/' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
uglify: {
|
||||||
|
options: {
|
||||||
|
banner: '// http://spin.js.org/#v<%= pkg.version %>\n'
|
||||||
|
},
|
||||||
|
js: {
|
||||||
|
files: {
|
||||||
|
'site/spin.min.js': ['site/spin.js'],
|
||||||
|
'spin.min.js': ['site/spin.min.js']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
bump: {
|
||||||
|
options: {
|
||||||
|
files: ['package.json', 'component.json'],
|
||||||
|
updateConfigs: ['pkg'],
|
||||||
|
commit: true,
|
||||||
|
commitMessage: 'Release v%VERSION%',
|
||||||
|
commitFiles: ['package.json', 'component.json', 'spin.min.js'],
|
||||||
|
createTag: true,
|
||||||
|
tagName: '%VERSION%',
|
||||||
|
push: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'gh-pages': {
|
||||||
|
release: {
|
||||||
|
options: {
|
||||||
|
base: 'site',
|
||||||
|
message: 'automatic commit'
|
||||||
|
},
|
||||||
|
src: '**/*'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-copy')
|
||||||
|
grunt.loadNpmTasks('grunt-contrib-uglify')
|
||||||
|
grunt.loadNpmTasks('grunt-bump')
|
||||||
|
grunt.loadNpmTasks('grunt-gh-pages')
|
||||||
|
|
||||||
|
grunt.registerTask('default', ['copy', 'uglify'])
|
||||||
|
|
||||||
|
}
|
||||||
22
assets/spin-js/LICENSE.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
The MIT License
|
||||||
|
===============
|
||||||
|
|
||||||
|
Copyright (c) 2011-2015 Felix Gnass [fgnass at gmail dot com]
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
21
assets/spin-js/README.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# spin.js [](http://js.org)
|
||||||
|
|
||||||
|
An animated CSS3 loading spinner with VML fallback for IE.
|
||||||
|
|
||||||
|
* No images, no external CSS
|
||||||
|
* No dependencies
|
||||||
|
* Highly configurable
|
||||||
|
* Resolution independent
|
||||||
|
* Uses VML as fallback in old IEs
|
||||||
|
* Uses @keyframe animations, falling back to setTimeout()
|
||||||
|
* Works in all major browsers, including IE6
|
||||||
|
* Small footprint (~1.9K gzipped)
|
||||||
|
* MIT License
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
new Spinner({color:'#fff', lines: 12}).spin(target);
|
||||||
|
```
|
||||||
|
|
||||||
|
For an interactive demo and a list of all supported options please refer to the [project's homepage](http://spin.js.org).
|
||||||
17
assets/spin-js/bower.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "spin.js",
|
||||||
|
"main": "spin.js",
|
||||||
|
"dependencies": {},
|
||||||
|
"readme": "README.md",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/fgnass/spin.js.git"
|
||||||
|
},
|
||||||
|
"ignore": [
|
||||||
|
"Gruntfile.js",
|
||||||
|
"site",
|
||||||
|
"bower.json",
|
||||||
|
"component.json",
|
||||||
|
"package.json"
|
||||||
|
]
|
||||||
|
}
|
||||||
15
assets/spin-js/component.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "spin",
|
||||||
|
"repo": "fgnass/spin.js",
|
||||||
|
"description": "A spinning activity indicator",
|
||||||
|
"version": "2.3.2",
|
||||||
|
"main": "spin.js",
|
||||||
|
"scripts": [
|
||||||
|
"spin.js"
|
||||||
|
],
|
||||||
|
"keywords": [
|
||||||
|
"spin",
|
||||||
|
"spinner",
|
||||||
|
"component"
|
||||||
|
]
|
||||||
|
}
|
||||||
79
assets/spin-js/jquery.spin.js
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2011-2014 Felix Gnass
|
||||||
|
* Licensed under the MIT license
|
||||||
|
* http://spin.js.org/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Basic Usage:
|
||||||
|
============
|
||||||
|
|
||||||
|
$('#el').spin() // Creates a default Spinner using the text color of #el.
|
||||||
|
$('#el').spin({ ... }) // Creates a Spinner using the provided options.
|
||||||
|
|
||||||
|
$('#el').spin(false) // Stops and removes the spinner.
|
||||||
|
|
||||||
|
Using Presets:
|
||||||
|
==============
|
||||||
|
|
||||||
|
$('#el').spin('small') // Creates a 'small' Spinner using the text color of #el.
|
||||||
|
$('#el').spin('large', '#fff') // Creates a 'large' white Spinner.
|
||||||
|
|
||||||
|
Adding a custom preset:
|
||||||
|
=======================
|
||||||
|
|
||||||
|
$.fn.spin.presets.flower = {
|
||||||
|
lines: 9
|
||||||
|
, length: 10
|
||||||
|
, width: 20
|
||||||
|
, radius: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#el').spin('flower', 'red')
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
;(function(factory) {
|
||||||
|
|
||||||
|
if (typeof exports == 'object') {
|
||||||
|
// CommonJS
|
||||||
|
factory(require('jquery'), require('spin.js'))
|
||||||
|
} else if (typeof define == 'function' && define.amd) {
|
||||||
|
// AMD, register as anonymous module
|
||||||
|
define(['jquery', 'spin'], factory)
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
if (!window.Spinner) throw new Error('Spin.js not present')
|
||||||
|
factory(window.jQuery, window.Spinner)
|
||||||
|
}
|
||||||
|
|
||||||
|
}(function($, Spinner) {
|
||||||
|
|
||||||
|
$.fn.spin = function(opts, color) {
|
||||||
|
|
||||||
|
return this.each(function() {
|
||||||
|
var $this = $(this)
|
||||||
|
, data = $this.data()
|
||||||
|
|
||||||
|
if (data.spinner) {
|
||||||
|
data.spinner.stop()
|
||||||
|
delete data.spinner
|
||||||
|
}
|
||||||
|
if (opts !== false) {
|
||||||
|
opts = $.extend(
|
||||||
|
{ color: color || $this.css('color') }
|
||||||
|
, $.fn.spin.presets[opts] || opts
|
||||||
|
)
|
||||||
|
data.spinner = new Spinner(opts).spin(this)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.spin.presets = {
|
||||||
|
tiny: { lines: 8, length: 2, width: 2, radius: 3 }
|
||||||
|
, small: { lines: 8, length: 4, width: 3, radius: 5 }
|
||||||
|
, large: { lines: 10, length: 8, width: 4, radius: 8 }
|
||||||
|
}
|
||||||
|
|
||||||
|
}));
|
||||||
34
assets/spin-js/package.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"name": "spin.js",
|
||||||
|
"version": "2.3.2",
|
||||||
|
"main": "spin.js",
|
||||||
|
"author": "Felix Gnass <fgnass@gmail.com>",
|
||||||
|
"contributors": [
|
||||||
|
"Timothy Gu <timothygu99@gmail.com>"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/fgnass/spin.js.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"spin",
|
||||||
|
"spinner",
|
||||||
|
"component"
|
||||||
|
],
|
||||||
|
"component": {
|
||||||
|
"scripts": {
|
||||||
|
"spin": "spin.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"grunt": "~0.4.2",
|
||||||
|
"grunt-gh-pages": "~0.9.0",
|
||||||
|
"grunt-contrib-uglify": "~0.2.7",
|
||||||
|
"grunt-contrib-copy": "~0.5.0",
|
||||||
|
"grunt-bump": "0.0.13"
|
||||||
|
},
|
||||||
|
"spm": {
|
||||||
|
"main": "spin.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
377
assets/spin-js/spin.js
Normal file
@@ -0,0 +1,377 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2011-2014 Felix Gnass
|
||||||
|
* Licensed under the MIT license
|
||||||
|
* http://spin.js.org/
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
var opts = {
|
||||||
|
lines: 12 // The number of lines to draw
|
||||||
|
, length: 7 // The length of each line
|
||||||
|
, width: 5 // The line thickness
|
||||||
|
, radius: 10 // The radius of the inner circle
|
||||||
|
, scale: 1.0 // Scales overall size of the spinner
|
||||||
|
, corners: 1 // Roundness (0..1)
|
||||||
|
, color: '#000' // #rgb or #rrggbb
|
||||||
|
, opacity: 1/4 // Opacity of the lines
|
||||||
|
, rotate: 0 // Rotation offset
|
||||||
|
, direction: 1 // 1: clockwise, -1: counterclockwise
|
||||||
|
, speed: 1 // Rounds per second
|
||||||
|
, trail: 100 // Afterglow percentage
|
||||||
|
, fps: 20 // Frames per second when using setTimeout()
|
||||||
|
, zIndex: 2e9 // Use a high z-index by default
|
||||||
|
, className: 'spinner' // CSS class to assign to the element
|
||||||
|
, top: '50%' // center vertically
|
||||||
|
, left: '50%' // center horizontally
|
||||||
|
, shadow: false // Whether to render a shadow
|
||||||
|
, hwaccel: false // Whether to use hardware acceleration (might be buggy)
|
||||||
|
, position: 'absolute' // Element positioning
|
||||||
|
}
|
||||||
|
var target = document.getElementById('foo')
|
||||||
|
var spinner = new Spinner(opts).spin(target)
|
||||||
|
*/
|
||||||
|
;(function (root, factory) {
|
||||||
|
|
||||||
|
/* CommonJS */
|
||||||
|
if (typeof module == 'object' && module.exports) module.exports = factory()
|
||||||
|
|
||||||
|
/* AMD module */
|
||||||
|
else if (typeof define == 'function' && define.amd) define(factory)
|
||||||
|
|
||||||
|
/* Browser global */
|
||||||
|
else root.Spinner = factory()
|
||||||
|
}(this, function () {
|
||||||
|
"use strict"
|
||||||
|
|
||||||
|
var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
|
||||||
|
, animations = {} /* Animation rules keyed by their name */
|
||||||
|
, useCssAnimations /* Whether to use CSS animations or setTimeout */
|
||||||
|
, sheet /* A stylesheet to hold the @keyframe or VML rules. */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility function to create elements. If no tag name is given,
|
||||||
|
* a DIV is created. Optionally properties can be passed.
|
||||||
|
*/
|
||||||
|
function createEl (tag, prop) {
|
||||||
|
var el = document.createElement(tag || 'div')
|
||||||
|
, n
|
||||||
|
|
||||||
|
for (n in prop) el[n] = prop[n]
|
||||||
|
return el
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Appends children and returns the parent.
|
||||||
|
*/
|
||||||
|
function ins (parent /* child1, child2, ...*/) {
|
||||||
|
for (var i = 1, n = arguments.length; i < n; i++) {
|
||||||
|
parent.appendChild(arguments[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an opacity keyframe animation rule and returns its name.
|
||||||
|
* Since most mobile Webkits have timing issues with animation-delay,
|
||||||
|
* we create separate rules for each line/segment.
|
||||||
|
*/
|
||||||
|
function addAnimation (alpha, trail, i, lines) {
|
||||||
|
var name = ['opacity', trail, ~~(alpha * 100), i, lines].join('-')
|
||||||
|
, start = 0.01 + i/lines * 100
|
||||||
|
, z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)
|
||||||
|
, prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
|
||||||
|
, pre = prefix && '-' + prefix + '-' || ''
|
||||||
|
|
||||||
|
if (!animations[name]) {
|
||||||
|
sheet.insertRule(
|
||||||
|
'@' + pre + 'keyframes ' + name + '{' +
|
||||||
|
'0%{opacity:' + z + '}' +
|
||||||
|
start + '%{opacity:' + alpha + '}' +
|
||||||
|
(start+0.01) + '%{opacity:1}' +
|
||||||
|
(start+trail) % 100 + '%{opacity:' + alpha + '}' +
|
||||||
|
'100%{opacity:' + z + '}' +
|
||||||
|
'}', sheet.cssRules.length)
|
||||||
|
|
||||||
|
animations[name] = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tries various vendor prefixes and returns the first supported property.
|
||||||
|
*/
|
||||||
|
function vendor (el, prop) {
|
||||||
|
var s = el.style
|
||||||
|
, pp
|
||||||
|
, i
|
||||||
|
|
||||||
|
prop = prop.charAt(0).toUpperCase() + prop.slice(1)
|
||||||
|
if (s[prop] !== undefined) return prop
|
||||||
|
for (i = 0; i < prefixes.length; i++) {
|
||||||
|
pp = prefixes[i]+prop
|
||||||
|
if (s[pp] !== undefined) return pp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets multiple style properties at once.
|
||||||
|
*/
|
||||||
|
function css (el, prop) {
|
||||||
|
for (var n in prop) {
|
||||||
|
el.style[vendor(el, n) || n] = prop[n]
|
||||||
|
}
|
||||||
|
|
||||||
|
return el
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fills in default values.
|
||||||
|
*/
|
||||||
|
function merge (obj) {
|
||||||
|
for (var i = 1; i < arguments.length; i++) {
|
||||||
|
var def = arguments[i]
|
||||||
|
for (var n in def) {
|
||||||
|
if (obj[n] === undefined) obj[n] = def[n]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the line color from the given string or array.
|
||||||
|
*/
|
||||||
|
function getColor (color, idx) {
|
||||||
|
return typeof color == 'string' ? color : color[idx % color.length]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Built-in defaults
|
||||||
|
|
||||||
|
var defaults = {
|
||||||
|
lines: 12 // The number of lines to draw
|
||||||
|
, length: 7 // The length of each line
|
||||||
|
, width: 5 // The line thickness
|
||||||
|
, radius: 10 // The radius of the inner circle
|
||||||
|
, scale: 1.0 // Scales overall size of the spinner
|
||||||
|
, corners: 1 // Roundness (0..1)
|
||||||
|
, color: '#000' // #rgb or #rrggbb
|
||||||
|
, opacity: 1/4 // Opacity of the lines
|
||||||
|
, rotate: 0 // Rotation offset
|
||||||
|
, direction: 1 // 1: clockwise, -1: counterclockwise
|
||||||
|
, speed: 1 // Rounds per second
|
||||||
|
, trail: 100 // Afterglow percentage
|
||||||
|
, fps: 20 // Frames per second when using setTimeout()
|
||||||
|
, zIndex: 2e9 // Use a high z-index by default
|
||||||
|
, className: 'spinner' // CSS class to assign to the element
|
||||||
|
, top: '50%' // center vertically
|
||||||
|
, left: '50%' // center horizontally
|
||||||
|
, shadow: false // Whether to render a shadow
|
||||||
|
, hwaccel: false // Whether to use hardware acceleration (might be buggy)
|
||||||
|
, position: 'absolute' // Element positioning
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The constructor */
|
||||||
|
function Spinner (o) {
|
||||||
|
this.opts = merge(o || {}, Spinner.defaults, defaults)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Global defaults that override the built-ins:
|
||||||
|
Spinner.defaults = {}
|
||||||
|
|
||||||
|
merge(Spinner.prototype, {
|
||||||
|
/**
|
||||||
|
* Adds the spinner to the given target element. If this instance is already
|
||||||
|
* spinning, it is automatically removed from its previous target b calling
|
||||||
|
* stop() internally.
|
||||||
|
*/
|
||||||
|
spin: function (target) {
|
||||||
|
this.stop()
|
||||||
|
|
||||||
|
var self = this
|
||||||
|
, o = self.opts
|
||||||
|
, el = self.el = createEl(null, {className: o.className})
|
||||||
|
|
||||||
|
css(el, {
|
||||||
|
position: o.position
|
||||||
|
, width: 0
|
||||||
|
, zIndex: o.zIndex
|
||||||
|
, left: o.left
|
||||||
|
, top: o.top
|
||||||
|
})
|
||||||
|
|
||||||
|
if (target) {
|
||||||
|
target.insertBefore(el, target.firstChild || null)
|
||||||
|
}
|
||||||
|
|
||||||
|
el.setAttribute('role', 'progressbar')
|
||||||
|
self.lines(el, self.opts)
|
||||||
|
|
||||||
|
if (!useCssAnimations) {
|
||||||
|
// No CSS animation support, use setTimeout() instead
|
||||||
|
var i = 0
|
||||||
|
, start = (o.lines - 1) * (1 - o.direction) / 2
|
||||||
|
, alpha
|
||||||
|
, fps = o.fps
|
||||||
|
, f = fps / o.speed
|
||||||
|
, ostep = (1 - o.opacity) / (f * o.trail / 100)
|
||||||
|
, astep = f / o.lines
|
||||||
|
|
||||||
|
;(function anim () {
|
||||||
|
i++
|
||||||
|
for (var j = 0; j < o.lines; j++) {
|
||||||
|
alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity)
|
||||||
|
|
||||||
|
self.opacity(el, j * o.direction + start, alpha, o)
|
||||||
|
}
|
||||||
|
self.timeout = self.el && setTimeout(anim, ~~(1000 / fps))
|
||||||
|
})()
|
||||||
|
}
|
||||||
|
return self
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops and removes the Spinner.
|
||||||
|
*/
|
||||||
|
, stop: function () {
|
||||||
|
var el = this.el
|
||||||
|
if (el) {
|
||||||
|
clearTimeout(this.timeout)
|
||||||
|
if (el.parentNode) el.parentNode.removeChild(el)
|
||||||
|
this.el = undefined
|
||||||
|
}
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal method that draws the individual lines. Will be overwritten
|
||||||
|
* in VML fallback mode below.
|
||||||
|
*/
|
||||||
|
, lines: function (el, o) {
|
||||||
|
var i = 0
|
||||||
|
, start = (o.lines - 1) * (1 - o.direction) / 2
|
||||||
|
, seg
|
||||||
|
|
||||||
|
function fill (color, shadow) {
|
||||||
|
return css(createEl(), {
|
||||||
|
position: 'absolute'
|
||||||
|
, width: o.scale * (o.length + o.width) + 'px'
|
||||||
|
, height: o.scale * o.width + 'px'
|
||||||
|
, background: color
|
||||||
|
, boxShadow: shadow
|
||||||
|
, transformOrigin: 'left'
|
||||||
|
, transform: 'rotate(' + ~~(360/o.lines*i + o.rotate) + 'deg) translate(' + o.scale*o.radius + 'px' + ',0)'
|
||||||
|
, borderRadius: (o.corners * o.scale * o.width >> 1) + 'px'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
for (; i < o.lines; i++) {
|
||||||
|
seg = css(createEl(), {
|
||||||
|
position: 'absolute'
|
||||||
|
, top: 1 + ~(o.scale * o.width / 2) + 'px'
|
||||||
|
, transform: o.hwaccel ? 'translate3d(0,0,0)' : ''
|
||||||
|
, opacity: o.opacity
|
||||||
|
, animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1 / o.speed + 's linear infinite'
|
||||||
|
})
|
||||||
|
|
||||||
|
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px #000'), {top: '2px'}))
|
||||||
|
ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')))
|
||||||
|
}
|
||||||
|
return el
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal method that adjusts the opacity of a single line.
|
||||||
|
* Will be overwritten in VML fallback mode below.
|
||||||
|
*/
|
||||||
|
, opacity: function (el, i, val) {
|
||||||
|
if (i < el.childNodes.length) el.childNodes[i].style.opacity = val
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
function initVML () {
|
||||||
|
|
||||||
|
/* Utility function to create a VML tag */
|
||||||
|
function vml (tag, attr) {
|
||||||
|
return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
|
||||||
|
}
|
||||||
|
|
||||||
|
// No CSS transforms but VML support, add a CSS rule for VML elements:
|
||||||
|
sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')
|
||||||
|
|
||||||
|
Spinner.prototype.lines = function (el, o) {
|
||||||
|
var r = o.scale * (o.length + o.width)
|
||||||
|
, s = o.scale * 2 * r
|
||||||
|
|
||||||
|
function grp () {
|
||||||
|
return css(
|
||||||
|
vml('group', {
|
||||||
|
coordsize: s + ' ' + s
|
||||||
|
, coordorigin: -r + ' ' + -r
|
||||||
|
})
|
||||||
|
, { width: s, height: s }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
var margin = -(o.width + o.length) * o.scale * 2 + 'px'
|
||||||
|
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
|
||||||
|
, i
|
||||||
|
|
||||||
|
function seg (i, dx, filter) {
|
||||||
|
ins(
|
||||||
|
g
|
||||||
|
, ins(
|
||||||
|
css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx})
|
||||||
|
, ins(
|
||||||
|
css(
|
||||||
|
vml('roundrect', {arcsize: o.corners})
|
||||||
|
, { width: r
|
||||||
|
, height: o.scale * o.width
|
||||||
|
, left: o.scale * o.radius
|
||||||
|
, top: -o.scale * o.width >> 1
|
||||||
|
, filter: filter
|
||||||
|
}
|
||||||
|
)
|
||||||
|
, vml('fill', {color: getColor(o.color, i), opacity: o.opacity})
|
||||||
|
, vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (o.shadow)
|
||||||
|
for (i = 1; i <= o.lines; i++) {
|
||||||
|
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 1; i <= o.lines; i++) seg(i)
|
||||||
|
return ins(el, g)
|
||||||
|
}
|
||||||
|
|
||||||
|
Spinner.prototype.opacity = function (el, i, val, o) {
|
||||||
|
var c = el.firstChild
|
||||||
|
o = o.shadow && o.lines || 0
|
||||||
|
if (c && i + o < c.childNodes.length) {
|
||||||
|
c = c.childNodes[i + o]; c = c && c.firstChild; c = c && c.firstChild
|
||||||
|
if (c) c.opacity = val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof document !== 'undefined') {
|
||||||
|
sheet = (function () {
|
||||||
|
var el = createEl('style', {type : 'text/css'})
|
||||||
|
ins(document.getElementsByTagName('head')[0], el)
|
||||||
|
return el.sheet || el.styleSheet
|
||||||
|
}())
|
||||||
|
|
||||||
|
var probe = css(createEl('group'), {behavior: 'url(#default#VML)'})
|
||||||
|
|
||||||
|
if (!vendor(probe, 'transform') && probe.adj) initVML()
|
||||||
|
else useCssAnimations = vendor(probe, 'animation')
|
||||||
|
}
|
||||||
|
|
||||||
|
return Spinner
|
||||||
|
|
||||||
|
}));
|
||||||
4
assets/spin-js/spin.min.js
vendored
@@ -1,2 +1,2 @@
|
|||||||
// http://spin.js.org/#v2.3.1
|
// http://spin.js.org/#v2.3.2
|
||||||
!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return m[e]||(k.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",k.cssRules.length),m[e]=1),e}function d(a,b){var c,d,e=a.style;if(b=b.charAt(0).toUpperCase()+b.slice(1),void 0!==e[b])return b;for(d=0;d<l.length;d++)if(c=l[d]+b,void 0!==e[c])return c}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}k.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.scale*d.width,left:d.scale*d.radius,top:-d.scale*d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.scale*(d.length+d.width),k=2*d.scale*j,l=-(d.width+d.length)*d.scale*2+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k,l=["webkit","Moz","ms","O"],m={},n={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",opacity:.25,rotate:0,direction:1,speed:1,trail:100,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:!1,hwaccel:!1,position:"absolute"};if(h.defaults={},f(h.prototype,{spin:function(b){this.stop();var c=this,d=c.opts,f=c.el=a(null,{className:d.className});if(e(f,{position:d.position,width:0,zIndex:d.zIndex,left:d.left,top:d.top}),b&&b.insertBefore(f,b.firstChild||null),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.scale*(f.length+f.width)+"px",height:f.scale*f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.scale*f.radius+"px,0)",borderRadius:(f.corners*f.scale*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.scale*f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}}),"undefined"!=typeof document){k=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}();var o=e(a("group"),{behavior:"url(#default#VML)"});!d(o,"transform")&&o.adj?i():j=d(o,"animation")}return h});
|
!function(a,b){"object"==typeof module&&module.exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){"use strict";function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-"),f=.01+c/d*100,g=Math.max(1-(1-a)/b*(100-f),a),h=j.substring(0,j.indexOf("Animation")).toLowerCase(),i=h&&"-"+h+"-"||"";return m[e]||(k.insertRule("@"+i+"keyframes "+e+"{0%{opacity:"+g+"}"+f+"%{opacity:"+a+"}"+(f+.01)+"%{opacity:1}"+(f+b)%100+"%{opacity:"+a+"}100%{opacity:"+g+"}}",k.cssRules.length),m[e]=1),e}function d(a,b){var c,d,e=a.style;if(b=b.charAt(0).toUpperCase()+b.slice(1),void 0!==e[b])return b;for(d=0;d<l.length;d++)if(c=l[d]+b,void 0!==e[c])return c}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)void 0===a[d]&&(a[d]=c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,n)}function i(){function c(b,c){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',c)}k.addRule(".spin-vml","behavior:url(#default#VML)"),h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:k+" "+k,coordorigin:-j+" "+-j}),{width:k,height:k})}function h(a,h,i){b(m,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~h}),b(e(c("roundrect",{arcsize:d.corners}),{width:j,height:d.scale*d.width,left:d.scale*d.radius,top:-d.scale*d.width>>1,filter:i}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var i,j=d.scale*(d.length+d.width),k=2*d.scale*j,l=-(d.width+d.length)*d.scale*2+"px",m=e(f(),{position:"absolute",top:l,left:l});if(d.shadow)for(i=1;i<=d.lines;i++)h(i,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(i=1;i<=d.lines;i++)h(i);return b(a,m)},h.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}}var j,k,l=["webkit","Moz","ms","O"],m={},n={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",opacity:.25,rotate:0,direction:1,speed:1,trail:100,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:!1,hwaccel:!1,position:"absolute"};if(h.defaults={},f(h.prototype,{spin:function(b){this.stop();var c=this,d=c.opts,f=c.el=a(null,{className:d.className});if(e(f,{position:d.position,width:0,zIndex:d.zIndex,left:d.left,top:d.top}),b&&b.insertBefore(f,b.firstChild||null),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!j){var g,h=0,i=(d.lines-1)*(1-d.direction)/2,k=d.fps,l=k/d.speed,m=(1-d.opacity)/(l*d.trail/100),n=l/d.lines;!function o(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*n)%l*m,d.opacity),c.opacity(f,a*d.direction+i,g,d);c.timeout=c.el&&setTimeout(o,~~(1e3/k))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.scale*(f.length+f.width)+"px",height:f.scale*f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*k+f.rotate)+"deg) translate("+f.scale*f.radius+"px,0)",borderRadius:(f.corners*f.scale*f.width>>1)+"px"})}for(var i,k=0,l=(f.lines-1)*(1-f.direction)/2;k<f.lines;k++)i=e(a(),{position:"absolute",top:1+~(f.scale*f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:j&&c(f.opacity,f.trail,l+k*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(i,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(i,h(g(f.color,k),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}}),"undefined"!=typeof document){k=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}();var o=e(a("group"),{behavior:"url(#default#VML)"});!d(o,"transform")&&o.adj?i():j=d(o,"animation")}return h});
|
||||||
@@ -19,14 +19,17 @@
|
|||||||
},
|
},
|
||||||
"require":{
|
"require":{
|
||||||
"php":">=5.4",
|
"php":">=5.4",
|
||||||
"contao/core":">=3.2,<3.6-dev"
|
"contao-community-alliance/composer-plugin": "~2.4 | ~3.0",
|
||||||
|
"contao/core-bundle":"~3.5 | ~4.3"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"netzmacht/contao-leaflet-maps": "Leaflet maps integration into Contao CMS"
|
"netzmacht/contao-leaflet-maps": "Leaflet maps integration into Contao CMS"
|
||||||
},
|
},
|
||||||
"extra":{
|
"extra":{
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "0.7.3.x-dev"
|
"dev-master": "1.0.x-dev",
|
||||||
|
"dev-develop": "1.1.x-dev",
|
||||||
|
"dev-support/0.7.x": "0.7.x-dev"
|
||||||
},
|
},
|
||||||
"contao": {
|
"contao": {
|
||||||
"sources":{
|
"sources":{
|
||||||
|
|||||||
12
gulpfile.js
@@ -29,10 +29,14 @@ var paths = [
|
|||||||
dest: 'assets/leaflet-fullscreen',
|
dest: 'assets/leaflet-fullscreen',
|
||||||
css: 'Control.FullScreen.css',
|
css: 'Control.FullScreen.css',
|
||||||
js: 'Control.FullScreen.js'
|
js: 'Control.FullScreen.js'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dest: 'assets/leaflet-layer-overpass',
|
||||||
|
css: 'OverPassLayer.css'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
gulp.task('clear-styles', function(cb) {
|
gulp.task('clear-styles', function() {
|
||||||
var i, clear = [];
|
var i, clear = [];
|
||||||
|
|
||||||
for (i = 0; i < paths.length; i++) {
|
for (i = 0; i < paths.length; i++) {
|
||||||
@@ -41,10 +45,10 @@ gulp.task('clear-styles', function(cb) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
del(clear, cb);
|
del(clear);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('clear-scripts', function(cb) {
|
gulp.task('clear-scripts', function() {
|
||||||
var i, clear = [];
|
var i, clear = [];
|
||||||
|
|
||||||
for (i = 0; i < paths.length; i++) {
|
for (i = 0; i < paths.length; i++) {
|
||||||
@@ -53,7 +57,7 @@ gulp.task('clear-scripts', function(cb) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
del(clear, cb);
|
del(clear);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('scripts', ['clear-scripts'], function() {
|
gulp.task('scripts', ['clear-scripts'], function() {
|
||||||
|
|||||||
@@ -17,45 +17,45 @@
|
|||||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
|
$GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
|
||||||
(
|
(
|
||||||
'name' => 'Leaflet',
|
'name' => 'Leaflet',
|
||||||
'version' => '0.7.5',
|
'version' => '1.0.3',
|
||||||
'license' => '<a href="https://github.com/Leaflet/Leaflet/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>',
|
'license' => '<a href="https://github.com/Leaflet/Leaflet/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>',
|
||||||
'homepage' => 'http://leafletjs.com',
|
'homepage' => 'http://leafletjs.com',
|
||||||
'css' => 'assets/leaflet/libs/leaflet/leaflet.min.css',
|
'css' => 'assets/leaflet/libs/leaflet/leaflet.min.css',
|
||||||
'javascript' => 'assets/leaflet/libs/leaflet/leaflet.js',
|
'javascript' => 'assets/leaflet/libs/leaflet/leaflet-src.js',
|
||||||
);
|
);
|
||||||
|
|
||||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-providers'] = array
|
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-providers'] = array
|
||||||
(
|
(
|
||||||
'name' => 'Leaflet-providers',
|
'name' => 'Leaflet-providers',
|
||||||
'version' => '1.1.0',
|
'version' => '1.1.15',
|
||||||
'license' => '<a href="https://github.com/leaflet-extras/leaflet-providers/blob/master/license.md" target="_blank">BSD-2-Clause</a>',
|
'license' => '<a href="https://github.com/leaflet-extras/leaflet-providers/blob/master/license.md" target="_blank">BSD-2-Clause</a>',
|
||||||
'homepage' => 'http://leaflet-extras.github.io/leaflet-providers',
|
'homepage' => 'http://leaflet-extras.github.io/leaflet-providers',
|
||||||
'javascript' => 'assets/leaflet/libs/leaflet-providers/leaflet-providers.min.js'
|
'javascript' => 'assets/leaflet/libs/leaflet-providers/leaflet-providers.min.js'
|
||||||
);
|
);
|
||||||
|
|
||||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-omnivore'] = array
|
|
||||||
(
|
|
||||||
'name' => 'Leaflet-omnivore',
|
|
||||||
'version' => '0.3.2',
|
|
||||||
'license' => '<a href="https://github.com/mapbox/leaflet-omnivore/blob/master/LICENSE" target="_blank">BSD</a>',
|
|
||||||
'homepage' => 'https://github.com/mapbox/leaflet-omnivore',
|
|
||||||
'javascript' => 'assets/leaflet/libs/leaflet-omnivore/leaflet-omnivore.min.js'
|
|
||||||
);
|
|
||||||
|
|
||||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-markercluster'] = array
|
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-markercluster'] = array
|
||||||
(
|
(
|
||||||
'name' => 'Leaflet.markercluster',
|
'name' => 'Leaflet.markercluster',
|
||||||
'version' => '0.4.0-hotfix.1',
|
'version' => '1.0.2',
|
||||||
'license' => '<a href="https://github.com/Leaflet/Leaflet.markercluster/blob/master/MIT-LICENCE.txt" target="_blank">MIT</a>',
|
'license' => '<a href="https://github.com/Leaflet/Leaflet.markercluster/blob/master/MIT-LICENCE.txt" target="_blank">MIT</a>',
|
||||||
'homepage' => 'https://github.com/Leaflet/Leaflet.markercluster',
|
'homepage' => 'https://github.com/Leaflet/Leaflet.markercluster',
|
||||||
'css' => 'assets/leaflet/libs/leaflet-markercluster/MarkerCluster.css',
|
'css' => 'assets/leaflet/libs/leaflet-markercluster/MarkerCluster.css',
|
||||||
'javascript' => 'assets/leaflet/libs/leaflet-markercluster/leaflet.markercluster.js'
|
'javascript' => 'assets/leaflet/libs/leaflet-markercluster/leaflet.markercluster.js'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-omnivore'] = array
|
||||||
|
(
|
||||||
|
'name' => 'Leaflet-omnivore',
|
||||||
|
'version' => '0.3.4',
|
||||||
|
'license' => '<a href="https://github.com/mapbox/leaflet-omnivore/blob/master/LICENSE" target="_blank">BSD</a>',
|
||||||
|
'homepage' => 'https://github.com/mapbox/leaflet-omnivore',
|
||||||
|
'javascript' => 'assets/leaflet/libs/leaflet-omnivore/leaflet-omnivore.min.js'
|
||||||
|
);
|
||||||
|
|
||||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-loading'] = array
|
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-loading'] = array
|
||||||
(
|
(
|
||||||
'name' => 'Leaflet.loading',
|
'name' => 'Leaflet.loading',
|
||||||
'version' => '0.1.16',
|
'version' => '0.1.24',
|
||||||
'license' => '<a href="https://github.com/ebrelsford/Leaflet.loading/blob/master/LICENSE" target="_blank">MIT</a>',
|
'license' => '<a href="https://github.com/ebrelsford/Leaflet.loading/blob/master/LICENSE" target="_blank">MIT</a>',
|
||||||
'homepage' => 'https://github.com/ebrelsford/Leaflet.loading',
|
'homepage' => 'https://github.com/ebrelsford/Leaflet.loading',
|
||||||
'css' => 'assets/leaflet/libs/leaflet-loading/Control.Loading.min.css',
|
'css' => 'assets/leaflet/libs/leaflet-loading/Control.Loading.min.css',
|
||||||
@@ -65,7 +65,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-loading'] = array
|
|||||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-fullscreen'] = array
|
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-fullscreen'] = array
|
||||||
(
|
(
|
||||||
'name' => 'Leaflet.Control.FullScreen',
|
'name' => 'Leaflet.Control.FullScreen',
|
||||||
'version' => '1.1.4',
|
'version' => '1.4.2',
|
||||||
'license' => '<a href="https://github.com/brunob/leaflet.fullscreen/blob/master/LICENSE" target="_blank">MIT</a>',
|
'license' => '<a href="https://github.com/brunob/leaflet.fullscreen/blob/master/LICENSE" target="_blank">MIT</a>',
|
||||||
'homepage' => 'https://github.com/brunob/leaflet.fullscreen',
|
'homepage' => 'https://github.com/brunob/leaflet.fullscreen',
|
||||||
'css' => 'assets/leaflet/libs/leaflet-fullscreen/Control.FullScreen.min.css',
|
'css' => 'assets/leaflet/libs/leaflet-fullscreen/Control.FullScreen.min.css',
|
||||||
@@ -75,17 +75,36 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-fullscreen'] = array
|
|||||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-control-geocoder'] = array
|
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-control-geocoder'] = array
|
||||||
(
|
(
|
||||||
'name' => 'Leaflet Control Geocoder',
|
'name' => 'Leaflet Control Geocoder',
|
||||||
'version' => '1.1.0',
|
'version' => '1.5.4',
|
||||||
'license' => '<a href="https://github.com/perliedman/leaflet-control-geocoder/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>',
|
'license' => '<a href="https://github.com/perliedman/leaflet-control-geocoder/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>',
|
||||||
'homepage' => 'https://github.com/perliedman/leaflet-control-geocoder',
|
'homepage' => 'https://github.com/perliedman/leaflet-control-geocoder',
|
||||||
'css' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.min.css',
|
'css' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.min.css',
|
||||||
'javascript' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.min.js'
|
'javascript' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.min.js'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-extra-markers'] = array
|
||||||
|
(
|
||||||
|
'name' => 'Leaflet Extra Markers',
|
||||||
|
'version' => '1.0.6',
|
||||||
|
'license' => '<a href="https://github.com/coryasilva/Leaflet.ExtraMarkers/blob/master/LICENSE" target="_blank">MIT</a>',
|
||||||
|
'homepage' => 'https://github.com/coryasilva/Leaflet.ExtraMarkers',
|
||||||
|
'css' => 'assets/leaflet/libs/leaflet-extra-markers/css/leaflet.extra-markers.min.css',
|
||||||
|
'javascript' => 'assets/leaflet/libs/leaflet-extra-markers/js/leaflet.extra-markers.min.js'
|
||||||
|
);
|
||||||
|
|
||||||
|
$GLOBALS['LEAFLET_LIBRARIES']['osmtogeojson'] = array
|
||||||
|
(
|
||||||
|
'name' => 'osmtogeojson',
|
||||||
|
'version' => '2.2.12',
|
||||||
|
'license' => '<a href="https://github.com/tyrasd/osmtogeojson/blob/gh-pages/LICENSE" target="_blank">MIT</a>',
|
||||||
|
'homepage' => 'https://github.com/tyrasd/osmtogeojson',
|
||||||
|
'javascript' => 'assets/leaflet/libs/osmtogeojson/osmtogeojson.js'
|
||||||
|
);
|
||||||
|
|
||||||
$GLOBALS['LEAFLET_LIBRARIES']['spin.js'] = array
|
$GLOBALS['LEAFLET_LIBRARIES']['spin.js'] = array
|
||||||
(
|
(
|
||||||
'name' => 'spin.js',
|
'name' => 'spin.js',
|
||||||
'version' => '2.3.1',
|
'version' => '2.3.2',
|
||||||
'license' => '<a href="https://github.com/fgnass/spin.js/blob/master/LICENSE.txt" target="_blank">MIT</a>',
|
'license' => '<a href="https://github.com/fgnass/spin.js/blob/master/LICENSE.txt" target="_blank">MIT</a>',
|
||||||
'homepage' => 'http://fgnass.github.io/spin.js',
|
'homepage' => 'http://fgnass.github.io/spin.js',
|
||||||
'javascript' => 'assets/leaflet/libs/spin-js/spin.min.js'
|
'javascript' => 'assets/leaflet/libs/spin-js/spin.min.js'
|
||||||
|
|||||||
17
module/languages/de/modules.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Translations are managed using Transifex. To create a new translation
|
||||||
|
* or to help to maintain an existing one, please register at transifex.com.
|
||||||
|
*
|
||||||
|
* @link http://help.transifex.com/intro/translating.html
|
||||||
|
* @link https://www.transifex.com/projects/p/contao-leaflet-maps/language/de/
|
||||||
|
*
|
||||||
|
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
|
||||||
|
*
|
||||||
|
* last-updated: 2016-10-05T09:09:41+02:00
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
$GLOBALS['TL_LANG']['MOD']['leaflet-libs']['0'] = 'Leaflet-Bibliotheken';
|
||||||
|
$GLOBALS['TL_LANG']['MOD']['leaflet-libs']['1'] = 'Leaflet-Bibliotheken für die Leaflet-Integration in das CMS Contao.';
|
||||||
|
|
||||||
35
package.json
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "contao-leaflet-libaries",
|
||||||
|
"version": "0.7.7",
|
||||||
|
"description": "Libraries for Leaflet integration into Contao CMS =================================================",
|
||||||
|
"main": "gulpfile.js",
|
||||||
|
"dependencies": {
|
||||||
|
"del": "^2.2.2",
|
||||||
|
"gulp": "^3.9.1",
|
||||||
|
"gulp-minify-css": "^1.2.4",
|
||||||
|
"gulp-rename": "^1.2.2",
|
||||||
|
"gulp-replace": "^0.5.4",
|
||||||
|
"gulp-uglify": "^2.0.0",
|
||||||
|
"gulp-util": "^3.0.7",
|
||||||
|
"merge-stream": "^1.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {},
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/netzmacht/contao-leaflet-libaries.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Leaflet",
|
||||||
|
"Contao",
|
||||||
|
"Libraries"
|
||||||
|
],
|
||||||
|
"author": "netzmacht David Molineus",
|
||||||
|
"license": "LGPL-3.0",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/netzmacht/contao-leaflet-libaries/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/netzmacht/contao-leaflet-libaries#readme"
|
||||||
|
}
|
||||||