forked from Snck3rs/contao-leaflet-libraries
Compare commits
11 Commits
1.0.0-beta
...
1.0.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21fd7c8bd3 | ||
|
|
df8851fc8b | ||
|
|
5ca0430872 | ||
|
|
e985eb6cba | ||
|
|
6203fdc45d | ||
|
|
383bff4d6d | ||
|
|
396651d6be | ||
|
|
37efd85ad1 | ||
|
|
0dbb9424e2 | ||
|
|
aab101e58e | ||
|
|
337a1c7458 |
29
README.md
29
README.md
@@ -12,13 +12,15 @@ Contao CMS.
|
||||
|
||||
This package contains following packages:
|
||||
|
||||
- [leaflet 1.0.1](http://leafletjs.com)
|
||||
- [leaflet 1.0.3](http://leafletjs.com)
|
||||
- [Leaflet-providers 1.1.15](http://leaflet-extras.github.io/leaflet-providers)
|
||||
- [Leaflet.markercluster 1.0.0](https://github.com/Leaflet/Leaflet.markercluster)
|
||||
- [Leaflet-omnivore 0.3.2](https://github.com/mapbox/leaflet-omnivore)
|
||||
- [Leaflet.loading 0.1.23](https://github.com/ebrelsford/Leaflet.loading)
|
||||
- [Leaflet.markercluster 1.0.2](https://github.com/Leaflet/Leaflet.markercluster)
|
||||
- [Leaflet-omnivore 0.3.4](https://github.com/mapbox/leaflet-omnivore)
|
||||
- [Leaflet.loading 0.1.24](https://github.com/ebrelsford/Leaflet.loading)
|
||||
- [Leaflet.Control.FullScreen 1.4.2](https://github.com/brunob/leaflet.fullscreen)
|
||||
- [Leaflet Control Geocoder 1.5.1](https://github.com/perliedman/leaflet-control-geocoder)
|
||||
- [Leaflet Control Geocoder 1.5.4](https://github.com/perliedman/leaflet-control-geocoder)
|
||||
- [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)
|
||||
|
||||
|
||||
@@ -31,9 +33,20 @@ You can install this package via composer.
|
||||
$ php composer.phar require netzmacht/contao-leaflet-libraries:~1.0
|
||||
```
|
||||
|
||||
When releasing the first stable version of
|
||||
[netzmacht/contao-leaflet-maps](https://github.com/netzmacht/contao-leaflet-maps) the version number gonna be the same
|
||||
as the included leaflet library.
|
||||
If you use Contao 4 without the managed edition, you also have to register the module as a bundle.
|
||||
|
||||
```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
|
||||
-------
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.leafletControlGeocoder = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Nominatim = require('./geocoders/nominatim')["class"];
|
||||
Nominatim = _dereq_('./geocoders/nominatim')["class"];
|
||||
|
||||
module.exports = {
|
||||
"class": L.Control.extend({
|
||||
@@ -51,12 +51,14 @@ module.exports = {
|
||||
this._alts = L.DomUtil.create('ul',
|
||||
className + '-alternatives leaflet-control-geocoder-alternatives-minimized',
|
||||
container);
|
||||
L.DomEvent.disableClickPropagation(this._alts);
|
||||
|
||||
L.DomEvent.addListener(input, 'keydown', this._keydown, this);
|
||||
L.DomEvent.addListener(input, 'blur', function() {
|
||||
if (this.options.collapsed) {
|
||||
if (this.options.collapsed && !this._preventBlurCollapse) {
|
||||
this._collapse();
|
||||
}
|
||||
this._preventBlurCollapse = false;
|
||||
}, this);
|
||||
|
||||
|
||||
@@ -147,9 +149,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
_geocodeResultSelected: function(result) {
|
||||
if (this.options.collapsed) {
|
||||
this._collapse();
|
||||
} else {
|
||||
if (!this.options.collapsed) {
|
||||
this._clearResults();
|
||||
}
|
||||
|
||||
@@ -188,9 +188,20 @@ module.exports = {
|
||||
a = L.DomUtil.create('a', '', li),
|
||||
icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null,
|
||||
text = result.html ? undefined : document.createTextNode(result.name),
|
||||
clickHandler = function clickHandler(e) {
|
||||
L.DomEvent.preventDefault(e);
|
||||
mouseDownHandler = function mouseDownHandler(e) {
|
||||
// In some browsers, a click will fire on the map if the control is
|
||||
// collapsed directly after mousedown. To work around this, we
|
||||
// wait until the click is completed, and _then_ collapse the
|
||||
// control. Messy, but this is the workaround I could come up with
|
||||
// for #142.
|
||||
this._preventBlurCollapse = true;
|
||||
L.DomEvent.stop(e);
|
||||
this._geocodeResultSelected(result);
|
||||
L.DomEvent.on(li, 'click', function() {
|
||||
if (this.options.collapsed) {
|
||||
this._collapse();
|
||||
}
|
||||
}, this);
|
||||
};
|
||||
|
||||
if (icon) {
|
||||
@@ -205,7 +216,10 @@ module.exports = {
|
||||
a.appendChild(text);
|
||||
}
|
||||
|
||||
L.DomEvent.addListener(li, 'mousedown', clickHandler, this);
|
||||
// Use mousedown and not click, since click will fire _after_ blur,
|
||||
// causing the control to have collapsed and removed the items
|
||||
// before the click can fire.
|
||||
L.DomEvent.addListener(li, 'mousedown', mouseDownHandler, this);
|
||||
|
||||
return li;
|
||||
},
|
||||
@@ -275,10 +289,10 @@ module.exports = {
|
||||
};
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"./geocoders/nominatim":9}],2:[function(require,module,exports){
|
||||
},{"./geocoders/nominatim":9}],2:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Util = require('../util');
|
||||
Util = _dereq_('../util');
|
||||
|
||||
module.exports = {
|
||||
"class": L.Class.extend({
|
||||
@@ -362,10 +376,10 @@ module.exports = {
|
||||
};
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../util":13}],3:[function(require,module,exports){
|
||||
},{"../util":13}],3:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Util = require('../util');
|
||||
Util = _dereq_('../util');
|
||||
|
||||
module.exports = {
|
||||
"class": L.Class.extend({
|
||||
@@ -419,10 +433,10 @@ module.exports = {
|
||||
};
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../util":13}],4:[function(require,module,exports){
|
||||
},{"../util":13}],4:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Util = require('../util');
|
||||
Util = _dereq_('../util');
|
||||
|
||||
module.exports = {
|
||||
"class": L.Class.extend({
|
||||
@@ -512,10 +526,10 @@ module.exports = {
|
||||
};
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../util":13}],5:[function(require,module,exports){
|
||||
},{"../util":13}],5:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Util = require('../util');
|
||||
Util = _dereq_('../util');
|
||||
|
||||
module.exports = {
|
||||
"class": L.Class.extend({
|
||||
@@ -586,10 +600,10 @@ module.exports = {
|
||||
};
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../util":13}],6:[function(require,module,exports){
|
||||
},{"../util":13}],6:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Util = require('../util');
|
||||
Util = _dereq_('../util');
|
||||
|
||||
module.exports = {
|
||||
"class": L.Class.extend({
|
||||
@@ -678,10 +692,10 @@ module.exports = {
|
||||
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../util":13}],7:[function(require,module,exports){
|
||||
},{"../util":13}],7:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Util = require('../util');
|
||||
Util = _dereq_('../util');
|
||||
|
||||
module.exports = {
|
||||
"class": L.Class.extend({
|
||||
@@ -767,10 +781,10 @@ module.exports = {
|
||||
};
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../util":13}],8:[function(require,module,exports){
|
||||
},{"../util":13}],8:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Util = require('../util');
|
||||
Util = _dereq_('../util');
|
||||
|
||||
module.exports = {
|
||||
"class": L.Class.extend({
|
||||
@@ -856,10 +870,10 @@ module.exports = {
|
||||
};
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../util":13}],9:[function(require,module,exports){
|
||||
},{"../util":13}],9:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Util = require('../util');
|
||||
Util = _dereq_('../util');
|
||||
|
||||
module.exports = {
|
||||
"class": L.Class.extend({
|
||||
@@ -954,10 +968,10 @@ module.exports = {
|
||||
};
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../util":13}],10:[function(require,module,exports){
|
||||
},{"../util":13}],10:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Util = require('../util');
|
||||
Util = _dereq_('../util');
|
||||
|
||||
module.exports = {
|
||||
"class": L.Class.extend({
|
||||
@@ -1057,10 +1071,10 @@ module.exports = {
|
||||
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../util":13}],11:[function(require,module,exports){
|
||||
},{"../util":13}],11:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Util = require('../util');
|
||||
Util = _dereq_('../util');
|
||||
|
||||
module.exports = {
|
||||
"class": L.Class.extend({
|
||||
@@ -1123,20 +1137,20 @@ module.exports = {
|
||||
};
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"../util":13}],12:[function(require,module,exports){
|
||||
},{"../util":13}],12:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
Control = require('./control'),
|
||||
Nominatim = require('./geocoders/nominatim'),
|
||||
Bing = require('./geocoders/bing'),
|
||||
MapQuest = require('./geocoders/mapquest'),
|
||||
Mapbox = require('./geocoders/mapbox'),
|
||||
What3Words = require('./geocoders/what3words'),
|
||||
Google = require('./geocoders/google'),
|
||||
Photon = require('./geocoders/photon'),
|
||||
Mapzen = require('./geocoders/mapzen'),
|
||||
ArcGis = require('./geocoders/arcgis'),
|
||||
HERE = require('./geocoders/here');
|
||||
Control = _dereq_('./control'),
|
||||
Nominatim = _dereq_('./geocoders/nominatim'),
|
||||
Bing = _dereq_('./geocoders/bing'),
|
||||
MapQuest = _dereq_('./geocoders/mapquest'),
|
||||
Mapbox = _dereq_('./geocoders/mapbox'),
|
||||
What3Words = _dereq_('./geocoders/what3words'),
|
||||
Google = _dereq_('./geocoders/google'),
|
||||
Photon = _dereq_('./geocoders/photon'),
|
||||
Mapzen = _dereq_('./geocoders/mapzen'),
|
||||
ArcGis = _dereq_('./geocoders/arcgis'),
|
||||
HERE = _dereq_('./geocoders/here');
|
||||
|
||||
module.exports = L.Util.extend(Control["class"], {
|
||||
Nominatim: Nominatim["class"],
|
||||
@@ -1167,7 +1181,7 @@ L.Util.extend(L.Control, {
|
||||
});
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{"./control":1,"./geocoders/arcgis":2,"./geocoders/bing":3,"./geocoders/google":4,"./geocoders/here":5,"./geocoders/mapbox":6,"./geocoders/mapquest":7,"./geocoders/mapzen":8,"./geocoders/nominatim":9,"./geocoders/photon":10,"./geocoders/what3words":11}],13:[function(require,module,exports){
|
||||
},{"./control":1,"./geocoders/arcgis":2,"./geocoders/bing":3,"./geocoders/google":4,"./geocoders/here":5,"./geocoders/mapbox":6,"./geocoders/mapquest":7,"./geocoders/mapzen":8,"./geocoders/nominatim":9,"./geocoders/photon":10,"./geocoders/what3words":11}],13:[function(_dereq_,module,exports){
|
||||
(function (global){
|
||||
var L = (typeof window !== "undefined" ? window['L'] : typeof global !== "undefined" ? global['L'] : null),
|
||||
lastCallbackId = 0,
|
||||
@@ -1253,4 +1267,5 @@ module.exports = {
|
||||
};
|
||||
|
||||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||||
},{}]},{},[12]);
|
||||
},{}]},{},[12])(12)
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
46
assets/control-geocoder/README.md
Normal file → Executable file
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.
|
||||
|
||||
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).
|
||||
@@ -18,18 +18,24 @@ The plugin supports many different data providers:
|
||||
* [Google Geocoding API](https://developers.google.com/maps/documentation/geocoding/)
|
||||
* [Mapbox Geocoding](https://www.mapbox.com/developers/api/geocoding/)
|
||||
* [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/).
|
||||
|
||||
# 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
|
||||
<link rel="stylesheet" href="../Control.Geocoder.css" />
|
||||
<link rel="stylesheet" href="Control.Geocoder.css" />
|
||||
<script src="Control.Geocoder.js"></script>
|
||||
```
|
||||
|
||||
@@ -46,23 +52,27 @@ L.Control.geocoder().addTo(map);
|
||||
# Customizing
|
||||
|
||||
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```
|
||||
function, to perform any action desired.
|
||||
a marker at its location. This can be customized by listening to the control's `markgeocode`
|
||||
event. To remove the control's default handler for marking a result, set the option
|
||||
`defaultMarkGeocode` to `false`.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
var geocoder = L.Control.geocoder().addTo(map);
|
||||
|
||||
geocoder.markGeocode = function(result) {
|
||||
var bbox = result.bbox;
|
||||
L.polygon([
|
||||
bbox.getSouthEast(),
|
||||
bbox.getNorthEast(),
|
||||
bbox.getNorthWest(),
|
||||
bbox.getSouthWest()
|
||||
]).addTo(map);
|
||||
};
|
||||
var geocoder = L.Control.geocoder({
|
||||
defaultMarkGeocode: false
|
||||
})
|
||||
.on('markgeocode', function(e) {
|
||||
var bbox = e.geocode.bbox;
|
||||
var poly = L.polygon([
|
||||
bbox.getSouthEast(),
|
||||
bbox.getNorthEast(),
|
||||
bbox.getNorthWest(),
|
||||
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.
|
||||
|
||||
25
assets/control-geocoder/bower.json
Normal file → Executable file
25
assets/control-geocoder/bower.json
Normal file → Executable file
@@ -1,12 +1,17 @@
|
||||
{
|
||||
"name": "leaflet-control-geocoder",
|
||||
"version": "1.1.0",
|
||||
"version": "1.5.4",
|
||||
"homepage": "https://github.com/perliedman/leaflet-control-geocoder",
|
||||
"authors": [
|
||||
"Per Liedman <per@liedman.net>"
|
||||
],
|
||||
"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": [
|
||||
"amd",
|
||||
"globals"
|
||||
@@ -14,7 +19,16 @@
|
||||
"keywords": [
|
||||
"leaflet",
|
||||
"geocoder",
|
||||
"nominatim"
|
||||
"locations",
|
||||
"nominatim",
|
||||
"bing",
|
||||
"google",
|
||||
"mapbox",
|
||||
"photon",
|
||||
"what3words",
|
||||
"mapquest",
|
||||
"mapzen",
|
||||
"here"
|
||||
],
|
||||
"license": "BSD-2-Clause",
|
||||
"ignore": [
|
||||
@@ -23,8 +37,5 @@
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
],
|
||||
"dependencies": {
|
||||
"leaflet": "~0.7.2"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
{
|
||||
"name": "leaflet-control-geocoder",
|
||||
"version": "1.1.0",
|
||||
"description": "Extendable geocoder with builtin OSM/Nominatim support",
|
||||
"main": "Control.Geocoder.js",
|
||||
"version": "1.5.4",
|
||||
"description": "Extendable geocoder with builtin support for Nominatim, Bing, Google, Mapbox, Photon, What3Words, MapQuest, Mapzen, HERE",
|
||||
"main": "dist/Control.Geocoder.js",
|
||||
"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": {
|
||||
"type": "git",
|
||||
@@ -13,14 +15,30 @@
|
||||
"keywords": [
|
||||
"leaflet",
|
||||
"geocoder",
|
||||
"nominatim"
|
||||
"locations",
|
||||
"nominatim",
|
||||
"bing",
|
||||
"google",
|
||||
"mapbox",
|
||||
"photon",
|
||||
"what3words",
|
||||
"mapquest",
|
||||
"mapzen",
|
||||
"here"
|
||||
],
|
||||
"author": "Per Liedman <per@liedman.net>",
|
||||
"license": "BSD-2-Clause",
|
||||
"bugs": {
|
||||
"url": "https://github.com/perliedman/leaflet-control-geocoder/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"leaflet": "~0.7.2"
|
||||
"browserify-shim": {
|
||||
"leaflet": "global:L"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"browserify": "^11.0.1",
|
||||
"browserify-shim": "^3.8.10",
|
||||
"derequire": "^2.0.3",
|
||||
"es3ify": "^0.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,3 +18,4 @@ Your pull requests are very welcome! Please follow these guidelines:
|
||||
* [kcwu](https://github.com/kcwu)
|
||||
* [Robbie Trencheny](https://github.com/robbiet480)
|
||||
* [David Molineus](https://github.com/dmolineus)
|
||||
* [Marwen Arfa](https://github.com/arfa)
|
||||
|
||||
@@ -5,14 +5,16 @@
|
||||
}
|
||||
|
||||
.leaflet-control-loading,
|
||||
.leaflet-control-zoom a.leaflet-control-loading ,
|
||||
.leaflet-control-zoomslider a.leaflet-control-loading {
|
||||
.leaflet-control-zoom a.leaflet-control-loading,
|
||||
.leaflet-control-zoomslider a.leaflet-control-loading,
|
||||
.leaflet-control-layer-container {
|
||||
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 {
|
||||
.leaflet-control-zoomslider a.leaflet-control-loading.is-loading,
|
||||
.leaflet-control-layer-container.is-loading {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,8 +71,9 @@
|
||||
}
|
||||
else {
|
||||
// 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);
|
||||
if (this.options.spinjs) {
|
||||
this._spinner = new Spinner(this.options.spin).spin();
|
||||
@@ -156,6 +157,7 @@
|
||||
_showIndicator: function() {
|
||||
// Show loading indicator
|
||||
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 (!this.options.separate) {
|
||||
@@ -171,6 +173,7 @@
|
||||
_hideIndicator: function() {
|
||||
// Hide loading indicator
|
||||
L.DomUtil.removeClass(this._indicator, 'is-loading');
|
||||
L.DomUtil.removeClass(this._indicatorContainer, 'is-loading');
|
||||
|
||||
// If zoomControl exists, make the zoom-out button last
|
||||
if (!this.options.separate) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
.leaflet-control-loading:empty{background-image:url('data:image/gif;base64,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');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,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');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}
|
||||
File diff suppressed because one or more lines are too long
@@ -4,19 +4,22 @@ Leaflet.loading
|
||||
Leaflet.loading is a simple loading control for [Leaflet][]. An unobtrusive
|
||||
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
|
||||
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).
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
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
|
||||
`loadingControl: true` in its options.
|
||||
Include `Control.Loading.js` and `Control.Loading.css`, then create a map with
|
||||
`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
|
||||
the selector `.leaflet-control-loading`. The simplest case would be adding a 16
|
||||
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.
|
||||
|
||||
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
|
||||
else is occurring, simply fire the `dataloading` event on your map when you
|
||||
begin loading and `dataload` when you are finished loading. The control tracks
|
||||
the number of concurrent loaders, so it is your responsibility to ensure that
|
||||
the `dataloading` and `dataload` are called symmetrically.
|
||||
else is occurring, fire the `dataloading` event on your map when you begin
|
||||
loading and `dataload` when you are finished loading. Please note that there is
|
||||
[an issue](https://github.com/ebrelsford/Leaflet.loading/issues/26) with the
|
||||
way this control tracks these events and that this will be re-worked in a
|
||||
future version.
|
||||
|
||||
### Options
|
||||
|
||||
@@ -43,20 +47,22 @@ the `dataloading` and `dataload` are called symmetrically.
|
||||
- **separate**: (boolean) Whether the control should be separate from the zoom
|
||||
control or not, defaults to false.
|
||||
- **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.
|
||||
- **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`
|
||||
- **spin**: (object) A [spin.js][] options object. Optional, defaults to
|
||||
- **spin**: (object) A [spin.js][] options object. Optional, defaults to
|
||||
|
||||
```
|
||||
{
|
||||
{
|
||||
lines: 7,
|
||||
length: 3,
|
||||
width: 3,
|
||||
radius: 5,
|
||||
rotate: 13,
|
||||
top: "83%"
|
||||
top: "83%"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
{
|
||||
"name": "leaflet.loading",
|
||||
"version": "0.1.16",
|
||||
"version": "0.1.24",
|
||||
"homepage": "https://github.com/ebrelsford/leaflet.loading",
|
||||
"authors": [
|
||||
"Eric Brelsford <ebrelsford@gmail.com>"
|
||||
],
|
||||
"description": "A loading-indicator control for Leaflet",
|
||||
"main": "src/Control.Loading.js",
|
||||
"main": [
|
||||
"src/Control.Loading.css",
|
||||
"src/Control.Loading.js"
|
||||
],
|
||||
"keywords": [
|
||||
"leaflet",
|
||||
"map",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "leaflet-loading",
|
||||
"version": "0.1.16",
|
||||
"version": "0.1.24",
|
||||
"description": "A simple loading control for Leaflet",
|
||||
"main": "src/Control.Loading.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -3,7 +3,80 @@ Leaflet.markercluster
|
||||
|
||||
(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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
##0.3 (2013-12-18)
|
||||
|
||||
### Improvements
|
||||
|
||||
@@ -5,6 +5,8 @@ Provides Beautiful Animated Marker Clustering functionality for [Leaflet](http:/
|
||||
|
||||
*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.4 compatible version, [Download the 0.2 release](https://github.com/Leaflet/Leaflet.markercluster/archive/0.2.zip)
|
||||
@@ -16,6 +18,8 @@ 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)
|
||||
@@ -43,9 +47,23 @@ removed link to h1 and indented back 2 spaces all links.
|
||||
|
||||
|
||||
## 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 npm: `npm 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.
|
||||
|
||||
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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "leaflet.markercluster",
|
||||
"version": "0.4.0-hotfix.1",
|
||||
"version": "1.0.2",
|
||||
"homepage": "https://github.com/Leaflet/Leaflet.markercluster",
|
||||
"authors": [
|
||||
"Dave Leaver <danzel@localhost.geek.nz>"
|
||||
@@ -22,6 +22,6 @@
|
||||
"tests"
|
||||
],
|
||||
"dependencies": {
|
||||
"leaflet": ">= 0.7.0"
|
||||
"leaflet": ">= 1.0.3"
|
||||
}
|
||||
}
|
||||
@@ -69,6 +69,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
|
||||
this._queue = [];
|
||||
|
||||
this._childMarkerEventHandlers = {
|
||||
'dragstart': this._childMarkerDragStart,
|
||||
'move': this._childMarkerMoved,
|
||||
'dragend': this._childMarkerDragEnd,
|
||||
};
|
||||
|
||||
// Hook the appropriate animation methods.
|
||||
var animate = L.DomUtil.TRANSITION && this.options.animate;
|
||||
L.extend(this, animate ? this._withAnimation : this._noAnimation);
|
||||
@@ -85,11 +91,13 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
//Don't cluster non point data
|
||||
if (!layer.getLatLng) {
|
||||
this._nonPointGroup.addLayer(layer);
|
||||
this.fire('layeradd', { layer: layer });
|
||||
return this;
|
||||
}
|
||||
|
||||
if (!this._map) {
|
||||
this._needsClustering.push(layer);
|
||||
this.fire('layeradd', { layer: layer });
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -105,6 +113,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
}
|
||||
|
||||
this._addLayer(layer, this._maxZoom);
|
||||
this.fire('layeradd', { layer: layer });
|
||||
|
||||
// Refresh bounds and weighted positions.
|
||||
this._topClusterLevel._recalculateBounds();
|
||||
@@ -139,6 +148,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
//Non point layers
|
||||
if (!layer.getLatLng) {
|
||||
this._nonPointGroup.removeLayer(layer);
|
||||
this.fire('layerremove', { layer: layer });
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -146,6 +156,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
if (!this._arraySplice(this._needsClustering, layer) && this.hasLayer(layer)) {
|
||||
this._needsRemoving.push(layer);
|
||||
}
|
||||
this.fire('layerremove', { layer: layer });
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -160,13 +171,14 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
|
||||
//Remove the marker from clusters
|
||||
this._removeLayer(layer, true);
|
||||
this.fire('layerremove', { layer: layer });
|
||||
|
||||
// Refresh bounds and weighted positions.
|
||||
this._topClusterLevel._recalculateBounds();
|
||||
|
||||
this._refreshClustersIcons();
|
||||
|
||||
layer.off('move', this._childMarkerMoved, this);
|
||||
layer.off(this._childMarkerEventHandlers, this);
|
||||
|
||||
if (this._featureGroup.hasLayer(layer)) {
|
||||
this._featureGroup.removeLayer(layer);
|
||||
@@ -179,7 +191,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
},
|
||||
|
||||
//Takes an array of markers and adds them in bulk
|
||||
addLayers: function (layersArray) {
|
||||
addLayers: function (layersArray, skipLayerAddEvent) {
|
||||
if (!L.Util.isArray(layersArray)) {
|
||||
return this.addLayer(layersArray);
|
||||
}
|
||||
@@ -228,6 +240,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
//Not point data, can't be clustered
|
||||
if (!m.getLatLng) {
|
||||
npg.addLayer(m);
|
||||
if (!skipLayerAddEvent) {
|
||||
this.fire('layeradd', { layer: m });
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -236,6 +251,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
}
|
||||
|
||||
this._addLayer(m, this._maxZoom);
|
||||
if (!skipLayerAddEvent) {
|
||||
this.fire('layeradd', { layer: m });
|
||||
}
|
||||
|
||||
//If we just made a cluster of size 2 then we need to remove the other marker from the map (if it is) or we never will
|
||||
if (m.__parent) {
|
||||
@@ -328,6 +346,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
if (this.hasLayer(m)) {
|
||||
this._needsRemoving.push(m);
|
||||
}
|
||||
this.fire('layerremove', { layer: m });
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -368,10 +387,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
|
||||
if (!m.__parent) {
|
||||
npg.removeLayer(m);
|
||||
this.fire('layerremove', { layer: m });
|
||||
continue;
|
||||
}
|
||||
|
||||
this._removeLayer(m, true, true);
|
||||
this.fire('layerremove', { layer: m });
|
||||
|
||||
if (fg.hasLayer(m)) {
|
||||
fg.removeLayer(m);
|
||||
@@ -412,9 +433,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
this._nonPointGroup.clearLayers();
|
||||
|
||||
this.eachLayer(function (marker) {
|
||||
marker.off('move', this._childMarkerMoved, this);
|
||||
marker.off(this._childMarkerEventHandlers, this);
|
||||
delete marker.__parent;
|
||||
});
|
||||
}, this);
|
||||
|
||||
if (this._map) {
|
||||
//Reset _topClusterLevel and the DistanceGrids
|
||||
@@ -510,7 +531,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
|
||||
//Zoom down to show the given layer (spiderfying if necessary) then calls the callback
|
||||
zoomToShowLayer: function (layer, callback) {
|
||||
|
||||
|
||||
if (typeof callback !== 'function') {
|
||||
callback = function () {};
|
||||
}
|
||||
@@ -537,20 +558,9 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
this._map.on('moveend', showMarker, this);
|
||||
this._map.panTo(layer.getLatLng());
|
||||
} else {
|
||||
var moveStart = function () {
|
||||
this._map.off('movestart', moveStart, this);
|
||||
moveStart = null;
|
||||
};
|
||||
|
||||
this._map.on('movestart', moveStart, this);
|
||||
this._map.on('moveend', showMarker, this);
|
||||
this.on('animationend', showMarker, this);
|
||||
layer.__parent.zoomToBounds();
|
||||
|
||||
if (moveStart) {
|
||||
//Never started moving, must already be there, probably need clustering however
|
||||
showMarker.call(this);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -594,7 +604,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
//Actually add our markers to the map:
|
||||
l = this._needsClustering;
|
||||
this._needsClustering = [];
|
||||
this.addLayers(l);
|
||||
this.addLayers(l, true);
|
||||
},
|
||||
|
||||
//Overrides FeatureGroup.onRemove
|
||||
@@ -648,33 +658,57 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
* @private
|
||||
*/
|
||||
_removeFromGridUnclustered: function (marker, z) {
|
||||
var map = this._map,
|
||||
gridUnclustered = this._gridUnclustered;
|
||||
var map = this._map,
|
||||
gridUnclustered = this._gridUnclustered,
|
||||
minZoom = this._map.getMinZoom();
|
||||
|
||||
for (; z >= 0; z--) {
|
||||
for (; z >= minZoom; z--) {
|
||||
if (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_childMarkerMoved: function (e) {
|
||||
if (!this._ignoreMove) {
|
||||
e.target._latlng = e.oldLatLng;
|
||||
this.removeLayer(e.target);
|
||||
_childMarkerDragStart: function (e) {
|
||||
e.target.__dragStart = e.target._latlng;
|
||||
},
|
||||
|
||||
e.target._latlng = e.latlng;
|
||||
this.addLayer(e.target);
|
||||
_childMarkerMoved: function (e) {
|
||||
if (!this._ignoreMove && !e.target.__dragStart) {
|
||||
var isPopupOpen = e.target._popup && e.target._popup.isOpen();
|
||||
|
||||
this._moveChild(e.target, e.oldLatLng, e.latlng);
|
||||
|
||||
if (isPopupOpen) {
|
||||
e.target.openPopup();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_moveChild: function (layer, from, to) {
|
||||
layer._latlng = from;
|
||||
this.removeLayer(layer);
|
||||
|
||||
layer._latlng = to;
|
||||
this.addLayer(layer);
|
||||
},
|
||||
|
||||
_childMarkerDragEnd: function (e) {
|
||||
if (e.target.__dragStart) {
|
||||
this._moveChild(e.target, e.target.__dragStart, e.target._latlng);
|
||||
}
|
||||
delete e.target.__dragStart;
|
||||
},
|
||||
|
||||
|
||||
//Internal function for removing a marker from everything.
|
||||
//dontUpdateMap: set to true if you will handle updating the map manually (for bulk functions)
|
||||
_removeLayer: function (marker, removeFromDistanceGrid, dontUpdateMap) {
|
||||
var gridClusters = this._gridClusters,
|
||||
gridUnclustered = this._gridUnclustered,
|
||||
fg = this._featureGroup,
|
||||
map = this._map;
|
||||
map = this._map,
|
||||
minZoom = this._map.getMinZoom();
|
||||
|
||||
//Remove the marker from distance clusters it might be in
|
||||
if (removeFromDistanceGrid) {
|
||||
@@ -693,7 +727,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
cluster._childCount--;
|
||||
cluster._boundsNeedUpdate = true;
|
||||
|
||||
if (cluster._zoom < 0) {
|
||||
if (cluster._zoom < minZoom) {
|
||||
//Top level, do nothing
|
||||
break;
|
||||
} else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required
|
||||
@@ -876,6 +910,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
|
||||
_generateInitialClusters: function () {
|
||||
var maxZoom = this._map.getMaxZoom(),
|
||||
minZoom = this._map.getMinZoom(),
|
||||
radius = this.options.maxClusterRadius,
|
||||
radiusFn = radius;
|
||||
|
||||
@@ -894,29 +929,30 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
|
||||
this._gridUnclustered = {};
|
||||
|
||||
//Set up DistanceGrids for each zoom
|
||||
for (var zoom = maxZoom; zoom >= 0; zoom--) {
|
||||
for (var zoom = maxZoom; zoom >= minZoom; zoom--) {
|
||||
this._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom));
|
||||
this._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom));
|
||||
}
|
||||
|
||||
// Instantiate the appropriate L.MarkerCluster class (animated or not).
|
||||
this._topClusterLevel = new this._markerCluster(this, -1);
|
||||
this._topClusterLevel = new this._markerCluster(this, minZoom - 1);
|
||||
},
|
||||
|
||||
//Zoom: Zoom to start adding at (Pass this._maxZoom to start at the bottom)
|
||||
_addLayer: function (layer, zoom) {
|
||||
var gridClusters = this._gridClusters,
|
||||
gridUnclustered = this._gridUnclustered,
|
||||
minZoom = this._map.getMinZoom(),
|
||||
markerPoint, z;
|
||||
|
||||
if (this.options.singleMarkerMode) {
|
||||
this._overrideMarkerIcon(layer);
|
||||
}
|
||||
|
||||
layer.on('move', this._childMarkerMoved, this);
|
||||
layer.on(this._childMarkerEventHandlers, this);
|
||||
|
||||
//Find the lowest zoom level to slot this one in
|
||||
for (; zoom >= 0; zoom--) {
|
||||
for (; zoom >= minZoom; zoom--) {
|
||||
markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position
|
||||
|
||||
//Try find a cluster close by
|
||||
@@ -1156,13 +1192,14 @@ L.MarkerClusterGroup.include({
|
||||
|
||||
_animationZoomIn: function (previousZoomLevel, newZoomLevel) {
|
||||
var bounds = this._getExpandedVisibleBounds(),
|
||||
fg = this._featureGroup,
|
||||
fg = this._featureGroup,
|
||||
minZoom = this._map.getMinZoom(),
|
||||
i;
|
||||
|
||||
this._ignoreMove = true;
|
||||
|
||||
//Add all children of current clusters to map and remove those clusters from map
|
||||
this._topClusterLevel._recursively(bounds, previousZoomLevel, 0, function (c) {
|
||||
this._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {
|
||||
var startPos = c._latlng,
|
||||
markers = c._markers,
|
||||
m;
|
||||
@@ -1212,7 +1249,7 @@ L.MarkerClusterGroup.include({
|
||||
//Remove the old clusters and close the zoom animation
|
||||
this._enqueue(function () {
|
||||
//update the positions of the just added clusters/markers
|
||||
this._topClusterLevel._recursively(bounds, previousZoomLevel, 0, function (c) {
|
||||
this._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {
|
||||
fg.removeLayer(c);
|
||||
c.clusterShow();
|
||||
});
|
||||
@@ -1264,7 +1301,8 @@ L.MarkerClusterGroup.include({
|
||||
|
||||
// Private methods for animated versions.
|
||||
_animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {
|
||||
var bounds = this._getExpandedVisibleBounds();
|
||||
var bounds = this._getExpandedVisibleBounds(),
|
||||
minZoom = this._map.getMinZoom();
|
||||
|
||||
//Animate all of the markers in the clusters to move to their cluster center point
|
||||
cluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, previousZoomLevel + 1, newZoomLevel);
|
||||
@@ -1290,7 +1328,7 @@ L.MarkerClusterGroup.include({
|
||||
m.clusterShow();
|
||||
}
|
||||
} else {
|
||||
cluster._recursively(bounds, newZoomLevel, 0, function (c) {
|
||||
cluster._recursively(bounds, newZoomLevel, minZoom, function (c) {
|
||||
c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel + 1);
|
||||
});
|
||||
}
|
||||
@@ -1536,7 +1574,7 @@ L.MarkerCluster = L.Marker.extend({
|
||||
},
|
||||
|
||||
_recursivelyAnimateChildrenIn: function (bounds, center, maxZoom) {
|
||||
this._recursively(bounds, 0, maxZoom - 1,
|
||||
this._recursively(bounds, this._group._map.getMinZoom(), maxZoom - 1,
|
||||
function (c) {
|
||||
var markers = c._markers,
|
||||
i, m;
|
||||
@@ -1565,7 +1603,7 @@ L.MarkerCluster = L.Marker.extend({
|
||||
},
|
||||
|
||||
_recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, previousZoomLevel, newZoomLevel) {
|
||||
this._recursively(bounds, newZoomLevel, 0,
|
||||
this._recursively(bounds, newZoomLevel, this._group._map.getMinZoom(),
|
||||
function (c) {
|
||||
c._recursivelyAnimateChildrenIn(bounds, c._group._map.latLngToLayerPoint(c.getLatLng()).round(), previousZoomLevel);
|
||||
|
||||
@@ -1584,13 +1622,13 @@ L.MarkerCluster = L.Marker.extend({
|
||||
},
|
||||
|
||||
_recursivelyBecomeVisible: function (bounds, zoomLevel) {
|
||||
this._recursively(bounds, 0, zoomLevel, null, function (c) {
|
||||
this._recursively(bounds, this._group._map.getMinZoom(), zoomLevel, null, function (c) {
|
||||
c.clusterShow();
|
||||
});
|
||||
},
|
||||
|
||||
_recursivelyAddChildrenToMap: function (startPos, zoomLevel, bounds) {
|
||||
this._recursively(bounds, -1, zoomLevel,
|
||||
this._recursively(bounds, this._group._map.getMinZoom() - 1, zoomLevel,
|
||||
function (c) {
|
||||
if (zoomLevel === c._zoom) {
|
||||
return;
|
||||
@@ -1654,7 +1692,7 @@ L.MarkerCluster = L.Marker.extend({
|
||||
//exceptBounds: If set, don't remove any markers/clusters in it
|
||||
_recursivelyRemoveChildrenFromMap: function (previousBounds, zoomLevel, exceptBounds) {
|
||||
var m, i;
|
||||
this._recursively(previousBounds, -1, zoomLevel - 1,
|
||||
this._recursively(previousBounds, this._group._map.getMinZoom() - 1, zoomLevel - 1,
|
||||
function (c) {
|
||||
//Remove markers at every level
|
||||
for (i = c._markers.length - 1; i >= 0; i--) {
|
||||
@@ -2336,6 +2374,9 @@ L.MarkerCluster.include({
|
||||
continue;
|
||||
}
|
||||
|
||||
//Close any popup on the marker first, otherwise setting the location of the marker will make the map scroll
|
||||
m.closePopup();
|
||||
|
||||
//Fix up the location to the real one
|
||||
m.setLatLng(m._preSpiderfyLatlng);
|
||||
delete m._preSpiderfyLatlng;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "leaflet.markercluster",
|
||||
"repository": "https://github.com/Leaflet/Leaflet.markercluster",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.2",
|
||||
"description": "Provides Beautiful Animated Marker Clustering functionality for Leaflet",
|
||||
"devDependencies": {
|
||||
"jshint": "~2.1.3",
|
||||
@@ -10,7 +10,7 @@
|
||||
"uglify-js": "~2.3.6",
|
||||
"jake": "~0.5.16",
|
||||
"magic-string": "^0.7.0",
|
||||
"leaflet": "~1.0.0-rc.1"
|
||||
"leaflet": "~1.0.3"
|
||||
},
|
||||
"main": "dist/leaflet.markercluster.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -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
|
||||
|
||||
* Move `brfs` and `hintify` to dependencies.
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
[](https://travis-ci.org/mapbox/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):
|
||||
|
||||
```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/)
|
||||
|
||||
```js
|
||||
var map = L.mapbox.map('map', 'examples.map-9ijuk24y')
|
||||
var map = L.mapbox.map('map', 'mapbox.streets')
|
||||
.setView([38, -102.0], 5);
|
||||
|
||||
omnivore.csv('a.csv').addTo(map);
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"name": "leaflet-omnivore",
|
||||
"version": "0.3.0",
|
||||
"description": "a geospatial format parser for Leaflet"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,22 +1,26 @@
|
||||
{
|
||||
"name": "leaflet-omnivore",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.4",
|
||||
"description": "a geospatial format parser for Leaflet",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "zuul --local -- test/test.js",
|
||||
"test-remote": "zuul -- 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"
|
||||
"test-headless": "zuul --phantom -- test/test.js",
|
||||
"prepublish": "browserify -s omnivore index.js > leaflet-omnivore.js && uglifyjs leaflet-omnivore.js -c -m > leaflet-omnivore.min.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:mapbox/leaflet-omnivore.git"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"leaflet-omnivore.js",
|
||||
"leaflet-omnivore.min.js"
|
||||
],
|
||||
"browserify": {
|
||||
"transform": [
|
||||
"brfs",
|
||||
"hintify"
|
||||
"brfs"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
@@ -38,30 +42,29 @@
|
||||
"converter"
|
||||
],
|
||||
"author": "Tom MacWright",
|
||||
"license": "BSD",
|
||||
"license": "BSD-3-Clause",
|
||||
"bugs": {
|
||||
"url": "https://github.com/mapbox/leaflet-omnivore/issues"
|
||||
},
|
||||
"homepage": "https://github.com/mapbox/leaflet-omnivore",
|
||||
"dependencies": {
|
||||
"csv2geojson": "~3.6.1",
|
||||
"togeojson": "0.10.1",
|
||||
"corslite": "0.0.6",
|
||||
"wellknown": "0.3.0",
|
||||
"hintify": "~0.1.0",
|
||||
"brfs": "0.2.1",
|
||||
"topojson": "1.6.8",
|
||||
"polyline": "0.0.3"
|
||||
"csv2geojson": "~5.0.0",
|
||||
"togeojson": "0.13.0",
|
||||
"corslite": "0.0.7",
|
||||
"wellknown": "0.4.2",
|
||||
"brfs": "1.4.3",
|
||||
"topojson": "1.6.26",
|
||||
"polyline": "0.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "7.0.2",
|
||||
"tape": "2.4.2",
|
||||
"uglify-js": "2.4.16",
|
||||
"jshint": "2.5.0",
|
||||
"mocha": "~1.20.1",
|
||||
"zuul": "~1.7.0",
|
||||
"st": "0.5.1",
|
||||
"mapbox.js": "1.6.4",
|
||||
"phantomjs": "~1.9.7-15"
|
||||
"browserify": "13.0.1",
|
||||
"tape": "4.5.1",
|
||||
"uglify-js": "^2.6.2",
|
||||
"jshint": "2.9.2",
|
||||
"mocha": "~2.5.3",
|
||||
"zuul": "~3.10.1",
|
||||
"st": "1.1.0",
|
||||
"mapbox.js": "2.4.0",
|
||||
"phantomjs-prebuilt": "2.1.7"
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -5,8 +5,8 @@
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow,
|
||||
.leaflet-tile-container,
|
||||
.leaflet-map-pane svg,
|
||||
.leaflet-map-pane canvas,
|
||||
.leaflet-pane > svg,
|
||||
.leaflet-pane > canvas,
|
||||
.leaflet-zoom-box,
|
||||
.leaflet-image-layer,
|
||||
.leaflet-layer {
|
||||
@@ -43,6 +43,7 @@
|
||||
/* .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;
|
||||
@@ -55,7 +56,7 @@
|
||||
.leaflet-container.leaflet-touch-drag {
|
||||
-ms-touch-action: pinch-zoom;
|
||||
}
|
||||
.leaflet-container.leaflet-touch-drag.leaflet-touch-drag {
|
||||
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
assets/leaflet/leaflet.min.css
vendored
2
assets/leaflet/leaflet.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -19,7 +19,8 @@
|
||||
},
|
||||
"require":{
|
||||
"php":">=5.4",
|
||||
"contao/core":"~3.5"
|
||||
"contao-community-alliance/composer-plugin": "~2.4 | ~3.0",
|
||||
"contao/core-bundle":"~3.5 | ~4.3"
|
||||
},
|
||||
"suggest": {
|
||||
"netzmacht/contao-leaflet-maps": "Leaflet maps integration into Contao CMS"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet'] = array
|
||||
(
|
||||
'name' => 'Leaflet',
|
||||
'version' => '1.0.1',
|
||||
'version' => '1.0.3',
|
||||
'license' => '<a href="https://github.com/Leaflet/Leaflet/blob/master/LICENSE" target="_blank">BSD-2-Clause</a>',
|
||||
'homepage' => 'http://leafletjs.com',
|
||||
'css' => 'assets/leaflet/libs/leaflet/leaflet.min.css',
|
||||
@@ -33,29 +33,29 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-providers'] = array
|
||||
'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
|
||||
(
|
||||
'name' => 'Leaflet.markercluster',
|
||||
'version' => '1.0.0',
|
||||
'version' => '1.0.2',
|
||||
'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',
|
||||
'css' => 'assets/leaflet/libs/leaflet-markercluster/MarkerCluster.css',
|
||||
'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
|
||||
(
|
||||
'name' => 'Leaflet.loading',
|
||||
'version' => '0.1.23',
|
||||
'version' => '0.1.24',
|
||||
'license' => '<a href="https://github.com/ebrelsford/Leaflet.loading/blob/master/LICENSE" target="_blank">MIT</a>',
|
||||
'homepage' => 'https://github.com/ebrelsford/Leaflet.loading',
|
||||
'css' => 'assets/leaflet/libs/leaflet-loading/Control.Loading.min.css',
|
||||
@@ -75,7 +75,7 @@ $GLOBALS['LEAFLET_LIBRARIES']['leaflet-fullscreen'] = array
|
||||
$GLOBALS['LEAFLET_LIBRARIES']['leaflet-control-geocoder'] = array
|
||||
(
|
||||
'name' => 'Leaflet Control Geocoder',
|
||||
'version' => '1.5.1',
|
||||
'version' => '1.5.4',
|
||||
'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',
|
||||
'css' => 'assets/leaflet/libs/control-geocoder/Control.Geocoder.min.css',
|
||||
|
||||
Reference in New Issue
Block a user