Skip to content

Commit f171746

Browse files
committed
Update Leaflet 0.7.3 plugins (EditinOSM, search, providers, contextmenu, markercluster)
1 parent 5b23c92 commit f171746

16 files changed

Lines changed: 358 additions & 191 deletions

leaflet/Leaflet.EditInOSM.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.leaflet-control-edit-in-osm-simple,
12
.leaflet-control-edit-in-osm {
23
background: none repeat scroll 0 0 #F8F8F9;
34
border: 1px solid #888888;
@@ -12,11 +13,12 @@
1213
display: block;
1314
}
1415
.leaflet-control-edit-in-osm .leaflet-control-edit-in-osm-toggle {
15-
background-image: url("images/edit-in-osm.png");
16+
background-image: url("./edit-in-osm.png");
1617
}
1718
.leaflet-control-edit-in-osm .osm-editor + .osm-editor {
1819
border-left: 1px solid black;
1920
}
21+
.leaflet-control-edit-in-osm-simple a.osm-editor,
2022
.leaflet-control-edit-in-osm a.osm-editor {
2123
display: none;
2224
height: 36px;
@@ -28,6 +30,7 @@
2830
text-decoration: none;
2931
font-family: sans-serif;
3032
}
33+
.leaflet-control-edit-in-osm-simple a.osm-editor,
3134
.leaflet-control-edit-in-osm:hover a.osm-editor {
3235
display: inline-block;
3336
}
@@ -40,4 +43,4 @@ a.osm-editor:hover {
4043

4144
.leaflet-control-edit-hidden {
4245
display: none;
43-
}
46+
}

leaflet/Leaflet.EditInOSM.js

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,41 @@
1-
(function (L, setTimeout) {
2-
1+
(function (factory) {
2+
var L;
3+
if (typeof define === 'function' && define.amd) {
4+
// AMD
5+
define(['leaflet'], function(L) {
6+
factory(L, setTimeout);
7+
});
8+
} else if (typeof module !== 'undefined') {
9+
// Node/CommonJS
10+
L = require('leaflet');
11+
module.exports = factory(L, setTimeout);
12+
} else {
13+
// Browser globals
14+
if (typeof window.L === 'undefined')
15+
throw 'Leaflet must be loaded first';
16+
factory(window.L, setTimeout);
17+
}
18+
}(function (L, setTimeout) {
319
var _controlContainer,
420
_map,
521
_zoomThreshold,
622
_hideClass = 'leaflet-control-edit-hidden',
723
_anchorClass = 'leaflet-control-edit-in-osm-toggle',
824

925
_Widgets = {
26+
SimpleButton: function (config) {
27+
var className = (config && config.className) || 'leaflet-control-edit-in-osm-simple',
28+
helpText = config && config.helpText,
29+
addEditors = (config && config.addEditors) || function (container, editors) {
30+
addEditorToWidget(container, editors[0], helpText);
31+
};
32+
33+
return {
34+
className: className,
35+
helpText: helpText,
36+
addEditors: addEditors
37+
};
38+
},
1039
MultiButton: function (config) {
1140
var className = 'leaflet-control-edit-in-osm',
1241
helpText = "Open this map extent in a map editor to provide more accurate data to OpenStreetMap",
@@ -44,8 +73,8 @@
4473
buildUrl = function (map) {
4574
return this.url + [
4675
map.getZoom(),
47-
map.getCenter().wrap().lng,
48-
map.getCenter().wrap().lat
76+
map.getCenter().wrap().lat,
77+
map.getCenter().wrap().lng
4978
].join('/');
5079
};
5180
return {
@@ -151,7 +180,9 @@
151180
widgetSmallName = typeof(widget) === 'string' ? widget.toLowerCase() : '';
152181

153182
// setup widget from string or object
154-
if (widgetSmallName === "multibutton") {
183+
if (widgetSmallName === "simplebutton") {
184+
this.options.widget = new _Widgets.SimpleButton(this.options.widgetOptions);
185+
} else if (widgetSmallName === "multibutton") {
155186
this.options.widget = new _Widgets.MultiButton(this.options.widgetOptions);
156187
} else if (widgetSmallName === "attributionbox") {
157188
this.options.widget = new _Widgets.AttributionBox(this.options.widgetOptions);
@@ -206,4 +237,4 @@
206237
}
207238
});
208239

209-
})(L, setTimeout);
240+
}));

leaflet/jcarousel.responsive.css

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.jcarousel-wrapper {
22
margin: 5px auto;
3-
position: relative;
3+
/** display: none; **/
44
border: 5px solid #fff;
55
-webkit-border-radius: 5px;
66
-moz-border-radius: 5px;
@@ -15,11 +15,10 @@
1515
.jcarousel {
1616
position: relative;
1717
overflow: hidden;
18-
height: 40px;
18+
height: 50px;
1919
}
2020

2121
.jcarousel ul {
22-
width: 20000em;
2322
position: relative;
2423
list-style: none;
2524
margin: 0;
@@ -28,19 +27,19 @@
2827

2928
.jcarousel li {
3029
float: left;
31-
width: 40px;
32-
height: 40px;
30+
width: 50px;
31+
height: 50px;
3332
margin-right: 5px;
3433
}
3534

3635
.jcarousel img {
37-
max-height: 40px;
38-
max-width: 40px;
36+
max-height: 50px;
37+
max-width: 50px;
3938
}
4039

4140
.jcarousel .loading {
4241
text-align: center;
43-
line-height: 90px; /* Fake vertical aligning */
42+
line-height: 50px; /* Fake vertical aligning */
4443
}
4544

4645
/** Carousel Controls **/

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.

0 commit comments

Comments
 (0)