Skip to content

Commit 6d33a8d

Browse files
committed
Update Leaflet plugins (EditinOSM, search, providers, contextmenu, markercluster)
1 parent 22092ec commit 6d33a8d

13 files changed

Lines changed: 143 additions & 107 deletions

leaflet/Leaflet.EditInOSM.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
display: block;
1313
}
1414
.leaflet-control-edit-in-osm .leaflet-control-edit-in-osm-toggle {
15-
background-image: url("images/edit-in-osm.png");
15+
background-image: url("./edit-in-osm.png");
1616
}
1717
.leaflet-control-edit-in-osm .osm-editor + .osm-editor {
1818
border-left: 1px solid black;

leaflet/Leaflet.EditInOSM.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
_Editors = {
4141
Id: function (config) {
42-
var url = 'http://openstreetmap.us/iD/release/#map=',
42+
var url = 'https://www.openstreetmap.org/edit?editor=id#map=',
4343
displayName = "iD",
4444
buildUrl = function (map) {
4545
return this.url + [
@@ -152,9 +152,9 @@
152152

153153
// setup widget from string or object
154154
if (widgetSmallName === "multibutton") {
155-
this.options.widget = new _Widgets.MultiButton();
155+
this.options.widget = new _Widgets.MultiButton(this.options.widgetOptions);
156156
} else if (widgetSmallName === "attributionbox") {
157-
this.options.widget = new _Widgets.AttributionBox();
157+
this.options.widget = new _Widgets.AttributionBox(this.options.widgetOptions);
158158
}
159159

160160
// setup editors from strings or objects

leaflet/leaflet-providers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
options: L.Util.extend({}, provider.options, variant.options)
3131
};
3232
} else if (typeof provider.url === 'function') {
33-
provider.url = provider.url(parts.splice(1).join('.'));
33+
provider.url = provider.url(parts.splice(1, parts.length - 1).join('.'));
3434
}
3535

3636
// replace attribution placeholders with their values from toplevel provider attribution,
@@ -456,7 +456,7 @@
456456
i = 0;
457457

458458
while (i < len) {
459-
if (typeof base[i] === 'string') {
459+
if (typeof overlay[i] === 'string') {
460460
out[labelFormatter(overlay[i])] = L.tileLayer.provider(overlay[i]);
461461
}
462462
i++;

leaflet/leaflet-search.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

leaflet/leaflet-search.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

leaflet/leaflet-search.mobile.min.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Leaflet Search Control v1.4.7 - 2014-01-04
2+
* Leaflet Search Control v1.4.7 - 2014-02-07
33
*
44
* Copyright 2014 Stefano Cudini
55
* stefano.cudini@gmail.com

leaflet/leaflet-search.mobile.src.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Leaflet Search Control v1.4.7 - 2014-01-04
2+
* Leaflet Search Control v1.4.7 - 2014-02-07
33
*
44
* Copyright 2014 Stefano Cudini
55
* stefano.cudini@gmail.com

leaflet/leaflet-search.src.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Leaflet Search Control v1.4.7 - 2014-01-04
2+
* Leaflet Search Control v1.4.7 - 2014-02-07
33
*
44
* Copyright 2014 Stefano Cudini
55
* stefano.cudini@gmail.com
@@ -44,7 +44,7 @@
4444
margin:3px 0 3px 3px;
4545
}
4646
.leaflet-control-search.search-load .search-input {
47-
background: url('images/loader.gif') no-repeat center right #fff;
47+
background: url('../images/loader.gif') no-repeat center right #fff;
4848
}
4949
.leaflet-control-search.search-load .search-cancel {
5050
visibility:hidden;
@@ -56,7 +56,7 @@
5656
position:absolute;
5757
right:22px;
5858
margin:3px 0;
59-
background: url('images/search-icon.png') no-repeat 0 -46px;
59+
background: url('../images/search-icon.png') no-repeat 0 -46px;
6060
text-decoration:none;
6161
filter: alpha(opacity=80);
6262
opacity: 0.8;
@@ -80,11 +80,11 @@
8080
float:left;
8181
width:26px;
8282
height:26px;
83-
background: url('images/search-icon.png') no-repeat 2px 2px;
83+
background: url('../images/search-icon.png') no-repeat 2px 2px;
8484
border-radius:4px;
8585
}
8686
.leaflet-control-search .search-button:hover {
87-
background: url('images/search-icon.png') no-repeat 2px -22px;
87+
background: url('../images/search-icon.png') no-repeat 2px -22px;
8888
}
8989
.leaflet-control-search .search-tooltip {
9090
position:absolute;

leaflet/leaflet-search.src.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Leaflet Search Control v1.4.7 - 2014-01-04
2+
* Leaflet Search Control v1.4.7 - 2014-02-07
33
*
44
* Copyright 2014 Stefano Cudini
55
* stefano.cudini@gmail.com
@@ -14,7 +14,6 @@
1414
* git@github.com:stefanocudini/leaflet-search.git
1515
*
1616
*/
17-
1817
(function() {
1918

2019
L.Control.Search = L.Control.extend({
@@ -91,7 +90,7 @@ L.Control.Search = L.Control.extend({
9190
map.on({
9291
// 'layeradd': this._onLayerAddRemove,
9392
// 'layerremove': this._onLayerAddRemove
94-
'resize':this._handleAutoresize()
93+
'resize': this._handleAutoresize
9594
}, this);
9695
return this._container;
9796
},

leaflet/leaflet.contextmenu-src.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/*
2-
Leaflet.contextmenu, a context menu for Leaflet.
3-
(c) 2013, Adam Ratcliffe, GeoSmart Maps Limited
4-
*/
51
L.Map.mergeOptions({
62
contextmenuItems: []
73
});
@@ -167,7 +163,7 @@ L.Map.ContextMenu = L.Handler.extend({
167163
var itemCls = L.Map.ContextMenu.BASE_CLS + '-item',
168164
cls = options.disabled ? (itemCls + ' ' + itemCls + '-disabled') : itemCls,
169165
el = this._insertElementAt('a', cls, container, index),
170-
callback = this._createEventHandler(el, options.callback, options.context),
166+
callback = this._createEventHandler(el, options.callback, options.context, options.hideOnSelect),
171167
html = '';
172168

173169
if (options.icon) {
@@ -232,18 +228,24 @@ L.Map.ContextMenu = L.Handler.extend({
232228
};
233229
},
234230

235-
_createEventHandler: function (el, func, context) {
231+
_createEventHandler: function (el, func, context, hideOnSelect) {
236232
var me = this,
237233
map = this._map,
238-
disabledCls = L.Map.ContextMenu.BASE_CLS + '-item-disabled';
234+
disabledCls = L.Map.ContextMenu.BASE_CLS + '-item-disabled',
235+
hideOnSelect = (hideOnSelect !== undefined) ? hideOnSelect : true;
239236

240237
return function (e) {
241238
if (L.DomUtil.hasClass(el, disabledCls)) {
242239
return;
243240
}
241+
242+
if (hideOnSelect) {
243+
me._hide();
244+
}
244245

245-
me._hide();
246-
func.call(context || map, me._showLocation);
246+
if (func) {
247+
func.call(context || map, me._showLocation);
248+
}
247249

248250
me._map.fire('contextmenu:select', {
249251
contextmenu: me,

0 commit comments

Comments
 (0)