leaflet-js 0.6.beta4 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +6 -14
- data/CHANGELOG.rdoc +3 -0
- data/leaflet-js.gemspec +2 -2
- data/lib/leaflet.draw/CHANGELOG.md +45 -0
- data/lib/leaflet.draw/README.md +70 -23
- data/lib/leaflet.draw/build/deps.js +1 -0
- data/lib/leaflet.draw/dist/images/spritesheet-2x.png +0 -0
- data/lib/leaflet.draw/dist/images/spritesheet.png +0 -0
- data/lib/leaflet.draw/dist/leaflet.draw-src.js +489 -136
- data/lib/leaflet.draw/dist/leaflet.draw.css +34 -2
- data/lib/leaflet.draw/dist/leaflet.draw.ie.css +5 -0
- data/lib/leaflet.draw/dist/leaflet.draw.js +2 -2
- data/lib/leaflet.draw/examples/basic.html +14 -7
- data/lib/leaflet.draw/examples/libs/images/layers-2x.png +0 -0
- data/lib/leaflet.draw/examples/libs/images/layers.png +0 -0
- data/lib/leaflet.draw/examples/libs/images/marker-icon-2x.png +0 -0
- data/lib/leaflet.draw/examples/libs/leaflet-src.js +1129 -608
- data/lib/leaflet.draw/examples/libs/leaflet.css +85 -66
- data/lib/leaflet.draw/package.json +2 -2
- data/lib/leaflet.draw/spec/suites/DrawControlSpec.js +1 -1
- data/lib/leaflet.draw/spec/suites/GeometryUtilSpec.js +25 -0
- data/lib/leaflet.draw/spec/suites/LatLngUtilSpec.js +9 -0
- data/lib/leaflet.draw/src/Control.Draw.js +1 -0
- data/lib/leaflet.draw/src/Leaflet.draw.js +89 -1
- data/lib/leaflet.draw/src/Toolbar.js +2 -6
- data/lib/leaflet.draw/src/Tooltip.js +20 -7
- data/lib/leaflet.draw/src/draw/DrawToolbar.js +26 -22
- data/lib/leaflet.draw/src/draw/handler/Draw.Circle.js +11 -6
- data/lib/leaflet.draw/src/draw/handler/Draw.Feature.js +6 -2
- data/lib/leaflet.draw/src/draw/handler/Draw.Marker.js +7 -2
- data/lib/leaflet.draw/src/draw/handler/Draw.Polygon.js +29 -7
- data/lib/leaflet.draw/src/draw/handler/Draw.Polyline.js +44 -21
- data/lib/leaflet.draw/src/draw/handler/Draw.Rectangle.js +3 -3
- data/lib/leaflet.draw/src/draw/handler/Draw.SimpleShape.js +14 -1
- data/lib/leaflet.draw/src/edit/EditToolbar.js +86 -16
- data/lib/leaflet.draw/src/edit/handler/Edit.Poly.js +10 -7
- data/lib/leaflet.draw/src/edit/handler/Edit.SimpleShape.js +1 -2
- data/lib/leaflet.draw/src/edit/handler/EditToolbar.Delete.js +15 -3
- data/lib/leaflet.draw/src/edit/handler/EditToolbar.Edit.js +56 -38
- data/lib/leaflet.draw/src/ext/GeometryUtil.js +68 -0
- data/lib/leaflet.draw/src/images/spritesheet.svg +41 -0
- data/lib/leaflet.label/CHANGELOG.md +32 -0
- data/lib/leaflet.label/README.md +21 -4
- data/lib/leaflet.label/build/build.js +2 -2
- data/lib/leaflet.label/build/deps.js +2 -0
- data/lib/leaflet.label/build/hintrc.js +4 -0
- data/lib/leaflet.label/dist/leaflet.label-src.js +266 -83
- data/lib/leaflet.label/dist/leaflet.label.css +23 -4
- data/lib/leaflet.label/dist/leaflet.label.js +1 -1
- data/lib/leaflet.label/example/label.html +6 -3
- data/lib/leaflet.label/libs/leaflet/images/layers-2x.png +0 -0
- data/lib/leaflet.label/libs/leaflet/images/layers.png +0 -0
- data/lib/leaflet.label/libs/leaflet/images/marker-icon-2x.png +0 -0
- data/lib/leaflet.label/libs/leaflet/leaflet-src.js +1129 -608
- data/lib/leaflet.label/libs/leaflet/leaflet.css +85 -66
- data/lib/leaflet.label/libs/leaflet/leaflet.js +6 -5
- data/lib/leaflet.label/package.json +19 -0
- data/lib/leaflet.label/src/BaseMarkerMethods.js +129 -0
- data/lib/leaflet.label/src/CircleMarker.Label.js +7 -0
- data/lib/leaflet.label/src/Label.js +161 -37
- data/lib/leaflet.label/src/Leaflet.label.js +1 -1
- data/lib/leaflet.label/src/Map.Label.js +0 -2
- data/lib/leaflet.label/src/Marker.Label.js +15 -120
- data/lib/leaflet.label/src/Path.Label.js +11 -11
- data/lib/leaflet/CHANGELOG.md +299 -31
- data/lib/leaflet/CONTRIBUTING.md +3 -3
- data/lib/leaflet/FAQ.md +138 -0
- data/lib/leaflet/Jakefile.js +24 -4
- data/lib/leaflet/PLUGIN-GUIDE.md +127 -0
- data/lib/leaflet/README.md +10 -6
- data/lib/leaflet/build/build.html +3 -19
- data/lib/leaflet/build/build.js +21 -51
- data/lib/leaflet/build/deps.js +10 -7
- data/lib/leaflet/build/hintrc.js +6 -4
- data/lib/leaflet/debug/hacks/jitter.html +0 -1
- data/lib/leaflet/debug/map/canvas.html +11 -12
- data/lib/leaflet/debug/map/controls.html +3 -4
- data/lib/leaflet/debug/map/geolocation.html +0 -1
- data/lib/leaflet/debug/map/iframe.html +11 -0
- data/lib/leaflet/debug/map/image-overlay.html +0 -1
- data/lib/leaflet/debug/map/map-mobile.html +0 -1
- data/lib/leaflet/debug/map/map.html +1 -2
- data/lib/leaflet/debug/map/max-bounds.html +2 -1
- data/lib/leaflet/debug/map/opacity.html +223 -0
- data/lib/leaflet/debug/map/scroll.html +6 -1
- data/lib/leaflet/debug/map/simple-proj.html +0 -1
- data/lib/leaflet/debug/map/wms-marble.html +4 -5
- data/lib/leaflet/debug/map/wms.html +0 -1
- data/lib/leaflet/debug/map/zoomlevels.html +0 -1
- data/lib/leaflet/debug/tests/add_remove_layers.html +5 -6
- data/lib/leaflet/debug/tests/bringtoback.html +0 -1
- data/lib/leaflet/debug/tests/canvasloop.html +47 -0
- data/lib/leaflet/debug/tests/click_on_canvas.html +0 -1
- data/lib/leaflet/debug/tests/dragging_and_copyworldjump.html +61 -0
- data/lib/leaflet/debug/tests/opacity.html +0 -1
- data/lib/leaflet/debug/tests/popupcontextmenuclicks.html +59 -0
- data/lib/leaflet/debug/tests/remove_while_dragging.html +4 -5
- data/lib/leaflet/debug/tests/removetilewhilepan.html +0 -1
- data/lib/leaflet/debug/tests/reuse_popups.html +0 -1
- data/lib/leaflet/debug/tests/rtl.html +42 -0
- data/lib/leaflet/debug/tests/rtl2.html +27 -0
- data/lib/leaflet/debug/tests/set_icon_reuse_dom.html +43 -0
- data/lib/leaflet/debug/tests/svg_clicks.html +3 -4
- data/lib/leaflet/debug/vector/bounds-extend.html +0 -1
- data/lib/leaflet/debug/vector/feature-group-bounds.html +0 -1
- data/lib/leaflet/debug/vector/geojson.html +0 -1
- data/lib/leaflet/debug/vector/rectangle.html +0 -1
- data/lib/leaflet/debug/vector/touchzoomemu.html +2 -3
- data/lib/leaflet/debug/vector/vector-bounds.html +0 -1
- data/lib/leaflet/debug/vector/vector-canvas.html +0 -1
- data/lib/leaflet/debug/vector/vector-mobile.html +0 -1
- data/lib/leaflet/debug/vector/vector-simple.html +0 -1
- data/lib/leaflet/debug/vector/vector.html +0 -1
- data/lib/leaflet/dist/images/layers-2x.png +0 -0
- data/lib/leaflet/dist/images/layers.png +0 -0
- data/lib/leaflet/dist/leaflet.css +85 -66
- data/lib/leaflet/package.json +25 -20
- data/lib/leaflet/spec/after.js +1 -1
- data/lib/leaflet/spec/index.html +21 -13
- data/lib/leaflet/spec/karma.conf.js +51 -50
- data/lib/leaflet/spec/spec.hintrc.js +25 -0
- data/lib/leaflet/spec/suites/LeafletSpec.js +2 -2
- data/lib/leaflet/spec/suites/SpecHelper.js +37 -21
- data/lib/leaflet/spec/suites/control/Control.LayersSpec.js +1 -1
- data/lib/leaflet/spec/suites/core/ClassSpec.js +12 -12
- data/lib/leaflet/spec/suites/core/EventsSpec.js +74 -18
- data/lib/leaflet/spec/suites/core/UtilSpec.js +69 -25
- data/lib/leaflet/spec/suites/dom/DomEventSpec.js +16 -16
- data/lib/leaflet/spec/suites/dom/DomUtilSpec.js +9 -16
- data/lib/leaflet/spec/suites/dom/PosAnimationSpec.js +27 -0
- data/lib/leaflet/spec/suites/geo/CRSSpec.js +47 -0
- data/lib/leaflet/spec/suites/geo/LatLngBoundsSpec.js +22 -14
- data/lib/leaflet/spec/suites/geo/LatLngSpec.js +22 -8
- data/lib/leaflet/spec/suites/geo/ProjectionSpec.js +21 -20
- data/lib/leaflet/spec/suites/geometry/BoundsSpec.js +15 -15
- data/lib/leaflet/spec/suites/geometry/PointSpec.js +12 -12
- data/lib/leaflet/spec/suites/geometry/TransformationSpec.js +4 -4
- data/lib/leaflet/spec/suites/layer/FeatureGroupSpec.js +59 -9
- data/lib/leaflet/spec/suites/layer/GeoJSONSpec.js +213 -17
- data/lib/leaflet/spec/suites/layer/LayerGroupSpec.js +6 -6
- data/lib/leaflet/spec/suites/layer/PopupSpec.js +65 -5
- data/lib/leaflet/spec/suites/layer/TileLayerSpec.js +16 -15
- data/lib/leaflet/spec/suites/layer/marker/MarkerSpec.js +94 -0
- data/lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js +7 -7
- data/lib/leaflet/spec/suites/layer/vector/PolygonSpec.js +38 -2
- data/lib/leaflet/spec/suites/layer/vector/PolylineGeometrySpec.js +4 -4
- data/lib/leaflet/spec/suites/layer/vector/PolylineSpec.js +2 -2
- data/lib/leaflet/spec/suites/map/MapSpec.js +318 -26
- data/lib/leaflet/spec/suites/map/handler/Map.DragSpec.js +38 -0
- data/lib/leaflet/src/Leaflet.js +2 -2
- data/lib/leaflet/src/control/Control.Attribution.js +6 -0
- data/lib/leaflet/src/control/Control.Layers.js +33 -24
- data/lib/leaflet/src/control/Control.Zoom.js +12 -4
- data/lib/leaflet/src/control/Control.js +10 -0
- data/lib/leaflet/src/copyright.js +2 -1
- data/lib/leaflet/src/core/Browser.js +11 -10
- data/lib/leaflet/src/core/Events.js +15 -11
- data/lib/leaflet/src/core/Util.js +19 -14
- data/lib/leaflet/src/dom/DomEvent.DoubleTap.js +13 -12
- data/lib/leaflet/src/dom/DomEvent.Pointer.js +155 -0
- data/lib/leaflet/src/dom/DomEvent.js +57 -19
- data/lib/leaflet/src/dom/DomUtil.js +89 -34
- data/lib/leaflet/src/dom/Draggable.js +26 -89
- data/lib/leaflet/src/dom/PosAnimation.js +13 -2
- data/lib/leaflet/src/geo/LatLng.js +16 -5
- data/lib/leaflet/src/geo/LatLngBounds.js +5 -2
- data/lib/leaflet/src/geo/crs/CRS.EPSG3395.js +2 -2
- data/lib/leaflet/src/geo/crs/CRS.js +5 -0
- data/lib/leaflet/src/geo/projection/Projection.Mercator.js +3 -3
- data/lib/leaflet/src/geometry/LineUtil.js +2 -2
- data/lib/leaflet/src/images/layers.svg +8 -0
- data/lib/leaflet/src/images/marker.svg +61 -1
- data/lib/leaflet/src/layer/FeatureGroup.js +24 -7
- data/lib/leaflet/src/layer/GeoJSON.js +97 -56
- data/lib/leaflet/src/layer/ImageOverlay.js +9 -0
- data/lib/leaflet/src/layer/LayerGroup.js +8 -3
- data/lib/leaflet/src/layer/Popup.js +56 -34
- data/lib/leaflet/src/layer/marker/DivIcon.js +4 -2
- data/lib/leaflet/src/layer/marker/Icon.Default.js +1 -1
- data/lib/leaflet/src/layer/marker/Icon.js +15 -18
- data/lib/leaflet/src/layer/marker/Marker.Drag.js +7 -5
- data/lib/leaflet/src/layer/marker/Marker.Popup.js +22 -5
- data/lib/leaflet/src/layer/marker/Marker.js +75 -32
- data/lib/leaflet/src/layer/tile/TileLayer.Anim.js +14 -26
- data/lib/leaflet/src/layer/tile/TileLayer.Canvas.js +7 -6
- data/lib/leaflet/src/layer/tile/TileLayer.WMS.js +14 -10
- data/lib/leaflet/src/layer/tile/TileLayer.js +53 -32
- data/lib/leaflet/src/layer/vector/CircleMarker.js +11 -0
- data/lib/leaflet/src/layer/vector/MultiPoly.js +10 -0
- data/lib/leaflet/src/layer/vector/Path.SVG.js +14 -3
- data/lib/leaflet/src/layer/vector/Path.VML.js +12 -2
- data/lib/leaflet/src/layer/vector/Path.js +7 -3
- data/lib/leaflet/src/layer/vector/Polygon.js +14 -3
- data/lib/leaflet/src/layer/vector/canvas/CircleMarker.Canvas.js +9 -0
- data/lib/leaflet/src/layer/vector/canvas/Path.Canvas.js +1 -0
- data/lib/leaflet/src/map/Map.js +192 -125
- data/lib/leaflet/src/map/anim/Map.PanAnimation.js +29 -19
- data/lib/leaflet/src/map/anim/Map.ZoomAnimation.js +21 -9
- data/lib/leaflet/src/map/ext/Map.Geolocation.js +11 -4
- data/lib/leaflet/src/map/handler/Map.BoxZoom.js +26 -12
- data/lib/leaflet/src/map/handler/Map.DoubleClickZoom.js +10 -3
- data/lib/leaflet/src/map/handler/Map.Drag.js +12 -6
- data/lib/leaflet/src/map/handler/Map.Keyboard.js +5 -2
- data/lib/leaflet/src/map/handler/Map.ScrollWheelZoom.js +7 -1
- data/lib/leaflet/src/map/handler/Map.Tap.js +107 -0
- data/lib/leaflet/src/map/handler/Map.TouchZoom.js +9 -3
- data/vendor/assets/images/layers-2x.png +0 -0
- data/vendor/assets/images/layers.png +0 -0
- data/vendor/assets/images/spritesheet-2x.png +0 -0
- data/vendor/assets/images/spritesheet.png +0 -0
- data/vendor/assets/javascripts/leaflet.draw.js +2 -4
- data/vendor/assets/javascripts/leaflet.js +3 -1
- data/vendor/assets/javascripts/leaflet.label.js +2 -0
- data/vendor/assets/stylesheets/leaflet.css.erb +337 -318
- data/vendor/assets/stylesheets/leaflet.draw.css.erb +35 -3
- data/vendor/assets/stylesheets/leaflet.draw.ie.css +5 -0
- data/vendor/assets/stylesheets/leaflet.label.css +23 -4
- metadata +40 -14
- data/lib/leaflet.draw/examples/libs/leaflet.ie.css +0 -51
- data/lib/leaflet.label/libs/leaflet/leaflet.ie.css +0 -51
- data/lib/leaflet/dist/leaflet-src.js +0 -8579
- data/lib/leaflet/dist/leaflet.ie.css +0 -51
- data/lib/leaflet/dist/leaflet.js +0 -8
- data/lib/leaflet/spec/happen.js +0 -93
- data/lib/leaflet/src/dom/DomEvent.MsTouch.js +0 -146
- data/vendor/assets/stylesheets/leaflet.ie.css +0 -51
|
@@ -10,20 +10,20 @@ L.Draggable = L.Class.extend({
|
|
|
10
10
|
END: {
|
|
11
11
|
mousedown: 'mouseup',
|
|
12
12
|
touchstart: 'touchend',
|
|
13
|
+
pointerdown: 'touchend',
|
|
13
14
|
MSPointerDown: 'touchend'
|
|
14
15
|
},
|
|
15
16
|
MOVE: {
|
|
16
17
|
mousedown: 'mousemove',
|
|
17
18
|
touchstart: 'touchmove',
|
|
19
|
+
pointerdown: 'touchmove',
|
|
18
20
|
MSPointerDown: 'touchmove'
|
|
19
|
-
}
|
|
20
|
-
TAP_TOLERANCE: 15
|
|
21
|
+
}
|
|
21
22
|
},
|
|
22
23
|
|
|
23
|
-
initialize: function (element, dragStartTarget
|
|
24
|
+
initialize: function (element, dragStartTarget) {
|
|
24
25
|
this._element = element;
|
|
25
26
|
this._dragStartTarget = dragStartTarget || element;
|
|
26
|
-
this._longPress = longPress && !L.Browser.msTouch;
|
|
27
27
|
},
|
|
28
28
|
|
|
29
29
|
enable: function () {
|
|
@@ -48,61 +48,34 @@ L.Draggable = L.Class.extend({
|
|
|
48
48
|
},
|
|
49
49
|
|
|
50
50
|
_onDown: function (e) {
|
|
51
|
+
this._moved = false;
|
|
52
|
+
|
|
51
53
|
if (e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }
|
|
52
54
|
|
|
53
|
-
L.DomEvent
|
|
54
|
-
.preventDefault(e)
|
|
55
|
-
.stopPropagation(e);
|
|
55
|
+
L.DomEvent.stopPropagation(e);
|
|
56
56
|
|
|
57
57
|
if (L.Draggable._disabled) { return; }
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var touchesNum = (e.touches && e.touches.length) || 0;
|
|
62
|
-
|
|
63
|
-
// don't simulate click or track longpress if more than 1 touch
|
|
64
|
-
if (touchesNum > 1) {
|
|
65
|
-
this._simulateClick = false;
|
|
66
|
-
clearTimeout(this._longPressTimeout);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
var first = touchesNum === 1 ? e.touches[0] : e,
|
|
71
|
-
el = first.target;
|
|
72
|
-
|
|
73
|
-
// if touching a link, highlight it
|
|
74
|
-
if (L.Browser.touch && el.tagName.toLowerCase() === 'a') {
|
|
75
|
-
L.DomUtil.addClass(el, 'leaflet-active');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
this._moved = false;
|
|
59
|
+
L.DomUtil.disableImageDrag();
|
|
60
|
+
L.DomUtil.disableTextSelection();
|
|
79
61
|
|
|
80
62
|
if (this._moving) { return; }
|
|
81
63
|
|
|
64
|
+
var first = e.touches ? e.touches[0] : e;
|
|
65
|
+
|
|
82
66
|
this._startPoint = new L.Point(first.clientX, first.clientY);
|
|
83
67
|
this._startPos = this._newPos = L.DomUtil.getPosition(this._element);
|
|
84
68
|
|
|
85
|
-
// touch contextmenu event emulation
|
|
86
|
-
if (touchesNum === 1 && L.Browser.touch && this._longPress) {
|
|
87
|
-
|
|
88
|
-
this._longPressTimeout = setTimeout(L.bind(function () {
|
|
89
|
-
var dist = (this._newPos && this._newPos.distanceTo(this._startPos)) || 0;
|
|
90
|
-
|
|
91
|
-
if (dist < L.Draggable.TAP_TOLERANCE) {
|
|
92
|
-
this._simulateClick = false;
|
|
93
|
-
this._onUp();
|
|
94
|
-
this._simulateEvent('contextmenu', first);
|
|
95
|
-
}
|
|
96
|
-
}, this), 1000);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
69
|
L.DomEvent
|
|
100
70
|
.on(document, L.Draggable.MOVE[e.type], this._onMove, this)
|
|
101
71
|
.on(document, L.Draggable.END[e.type], this._onUp, this);
|
|
102
72
|
},
|
|
103
73
|
|
|
104
74
|
_onMove: function (e) {
|
|
105
|
-
if (e.touches && e.touches.length > 1) {
|
|
75
|
+
if (e.touches && e.touches.length > 1) {
|
|
76
|
+
this._moved = true;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
106
79
|
|
|
107
80
|
var first = (e.touches && e.touches.length === 1 ? e.touches[0] : e),
|
|
108
81
|
newPoint = new L.Point(first.clientX, first.clientY),
|
|
@@ -118,10 +91,8 @@ L.Draggable = L.Class.extend({
|
|
|
118
91
|
this._moved = true;
|
|
119
92
|
this._startPos = L.DomUtil.getPosition(this._element).subtract(offset);
|
|
120
93
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
L.DomUtil.addClass(document.body, 'leaflet-dragging');
|
|
124
|
-
}
|
|
94
|
+
L.DomUtil.addClass(document.body, 'leaflet-dragging');
|
|
95
|
+
L.DomUtil.addClass((e.target || e.srcElement), 'leaflet-drag-target');
|
|
125
96
|
}
|
|
126
97
|
|
|
127
98
|
this._newPos = this._startPos.add(offset);
|
|
@@ -138,61 +109,27 @@ L.Draggable = L.Class.extend({
|
|
|
138
109
|
},
|
|
139
110
|
|
|
140
111
|
_onUp: function (e) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
clearTimeout(this._longPressTimeout);
|
|
144
|
-
|
|
145
|
-
if (this._simulateClick && e.changedTouches) {
|
|
146
|
-
|
|
147
|
-
dist = (this._newPos && this._newPos.distanceTo(this._startPos)) || 0;
|
|
148
|
-
first = e.changedTouches[0];
|
|
149
|
-
el = first.target;
|
|
150
|
-
|
|
151
|
-
if (el.tagName.toLowerCase() === 'a') {
|
|
152
|
-
L.DomUtil.removeClass(el, 'leaflet-active');
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// simulate click if the touch didn't move too much
|
|
156
|
-
if (dist < L.Draggable.TAP_TOLERANCE) {
|
|
157
|
-
simulateClickTouch = true;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
112
|
+
L.DomUtil.removeClass(document.body, 'leaflet-dragging');
|
|
113
|
+
L.DomUtil.removeClass((e.target || e.srcElement), 'leaflet-drag-target');
|
|
160
114
|
|
|
161
|
-
|
|
162
|
-
L.DomUtil.enableTextSelection();
|
|
163
|
-
L.DomUtil.removeClass(document.body, 'leaflet-dragging');
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
for (i in L.Draggable.MOVE) {
|
|
115
|
+
for (var i in L.Draggable.MOVE) {
|
|
167
116
|
L.DomEvent
|
|
168
117
|
.off(document, L.Draggable.MOVE[i], this._onMove)
|
|
169
118
|
.off(document, L.Draggable.END[i], this._onUp);
|
|
170
119
|
}
|
|
171
120
|
|
|
121
|
+
L.DomUtil.enableImageDrag();
|
|
122
|
+
L.DomUtil.enableTextSelection();
|
|
123
|
+
|
|
172
124
|
if (this._moved) {
|
|
173
125
|
// ensure drag is not fired after dragend
|
|
174
126
|
L.Util.cancelAnimFrame(this._animRequest);
|
|
175
127
|
|
|
176
|
-
this.fire('dragend'
|
|
128
|
+
this.fire('dragend', {
|
|
129
|
+
distance: this._newPos.distanceTo(this._startPos)
|
|
130
|
+
});
|
|
177
131
|
}
|
|
178
132
|
|
|
179
133
|
this._moving = false;
|
|
180
|
-
|
|
181
|
-
if (simulateClickTouch) {
|
|
182
|
-
this._moved = false;
|
|
183
|
-
this._simulateEvent('click', first);
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
_simulateEvent: function (type, e) {
|
|
188
|
-
var simulatedEvent = document.createEvent('MouseEvents');
|
|
189
|
-
|
|
190
|
-
simulatedEvent.initMouseEvent(
|
|
191
|
-
type, true, true, window, 1,
|
|
192
|
-
e.screenX, e.screenY,
|
|
193
|
-
e.clientX, e.clientY,
|
|
194
|
-
false, false, false, false, 0, null);
|
|
195
|
-
|
|
196
|
-
e.target.dispatchEvent(simulatedEvent);
|
|
197
134
|
}
|
|
198
135
|
});
|
|
@@ -10,6 +10,7 @@ L.PosAnimation = L.Class.extend({
|
|
|
10
10
|
|
|
11
11
|
this._el = el;
|
|
12
12
|
this._inProgress = true;
|
|
13
|
+
this._newPos = newPos;
|
|
13
14
|
|
|
14
15
|
this.fire('start');
|
|
15
16
|
|
|
@@ -38,9 +39,14 @@ L.PosAnimation = L.Class.extend({
|
|
|
38
39
|
},
|
|
39
40
|
|
|
40
41
|
_onStep: function () {
|
|
42
|
+
var stepPos = this._getPos();
|
|
43
|
+
if (!stepPos) {
|
|
44
|
+
this._onTransitionEnd();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
41
47
|
// jshint camelcase: false
|
|
42
48
|
// make L.DomUtil.getPosition return intermediate position value during animation
|
|
43
|
-
this._el._leaflet_pos =
|
|
49
|
+
this._el._leaflet_pos = stepPos;
|
|
44
50
|
|
|
45
51
|
this.fire('step');
|
|
46
52
|
},
|
|
@@ -48,7 +54,7 @@ L.PosAnimation = L.Class.extend({
|
|
|
48
54
|
// you can't easily get intermediate values of properties animated with CSS3 Transitions,
|
|
49
55
|
// we need to parse computed style (in case of transform it returns matrix string)
|
|
50
56
|
|
|
51
|
-
_transformRe: /(
|
|
57
|
+
_transformRe: /([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,
|
|
52
58
|
|
|
53
59
|
_getPos: function () {
|
|
54
60
|
var left, top, matches,
|
|
@@ -57,6 +63,7 @@ L.PosAnimation = L.Class.extend({
|
|
|
57
63
|
|
|
58
64
|
if (L.Browser.any3d) {
|
|
59
65
|
matches = style[L.DomUtil.TRANSFORM].match(this._transformRe);
|
|
66
|
+
if (!matches) { return; }
|
|
60
67
|
left = parseFloat(matches[1]);
|
|
61
68
|
top = parseFloat(matches[2]);
|
|
62
69
|
} else {
|
|
@@ -75,6 +82,10 @@ L.PosAnimation = L.Class.extend({
|
|
|
75
82
|
|
|
76
83
|
this._el.style[L.DomUtil.TRANSITION] = '';
|
|
77
84
|
|
|
85
|
+
// jshint camelcase: false
|
|
86
|
+
// make sure L.DomUtil.getPosition returns the final position value after animation
|
|
87
|
+
this._el._leaflet_pos = this._newPos;
|
|
88
|
+
|
|
78
89
|
clearInterval(this._stepTimer);
|
|
79
90
|
|
|
80
91
|
this.fire('step').fire('end');
|
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
* L.LatLng represents a geographical point with latitude and longitude coordinates.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
L.LatLng = function (
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
L.LatLng = function (lat, lng, alt) { // (Number, Number, Number)
|
|
6
|
+
lat = parseFloat(lat);
|
|
7
|
+
lng = parseFloat(lng);
|
|
8
8
|
|
|
9
9
|
if (isNaN(lat) || isNaN(lng)) {
|
|
10
|
-
throw new Error('Invalid LatLng object: (' +
|
|
10
|
+
throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
this.lat = lat;
|
|
14
14
|
this.lng = lng;
|
|
15
|
+
|
|
16
|
+
if (alt !== undefined) {
|
|
17
|
+
this.alt = parseFloat(alt);
|
|
18
|
+
}
|
|
15
19
|
};
|
|
16
20
|
|
|
17
21
|
L.extend(L.LatLng, {
|
|
@@ -75,7 +79,11 @@ L.latLng = function (a, b) { // (LatLng) or ([Number, Number]) or (Number, Numbe
|
|
|
75
79
|
return a;
|
|
76
80
|
}
|
|
77
81
|
if (L.Util.isArray(a)) {
|
|
78
|
-
|
|
82
|
+
if (typeof a[0] === 'number' || typeof a[0] === 'string') {
|
|
83
|
+
return new L.LatLng(a[0], a[1], a[2]);
|
|
84
|
+
} else {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
79
87
|
}
|
|
80
88
|
if (a === undefined || a === null) {
|
|
81
89
|
return a;
|
|
@@ -83,6 +91,9 @@ L.latLng = function (a, b) { // (LatLng) or ([Number, Number]) or (Number, Numbe
|
|
|
83
91
|
if (typeof a === 'object' && 'lat' in a) {
|
|
84
92
|
return new L.LatLng(a.lat, 'lng' in a ? a.lng : a.lon);
|
|
85
93
|
}
|
|
94
|
+
if (b === undefined) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
86
97
|
return new L.LatLng(a, b);
|
|
87
98
|
};
|
|
88
99
|
|
|
@@ -15,8 +15,11 @@ L.LatLngBounds = function (southWest, northEast) { // (LatLng, LatLng) or (LatLn
|
|
|
15
15
|
L.LatLngBounds.prototype = {
|
|
16
16
|
// extend the bounds to contain the given point or bounds
|
|
17
17
|
extend: function (obj) { // (LatLng) or (LatLngBounds)
|
|
18
|
-
if (
|
|
19
|
-
|
|
18
|
+
if (!obj) { return this; }
|
|
19
|
+
|
|
20
|
+
var latLng = L.latLng(obj);
|
|
21
|
+
if (latLng !== null) {
|
|
22
|
+
obj = latLng;
|
|
20
23
|
} else {
|
|
21
24
|
obj = L.latLngBounds(obj);
|
|
22
25
|
}
|
|
@@ -7,8 +7,8 @@ L.CRS.EPSG3395 = L.extend({}, L.CRS, {
|
|
|
7
7
|
transformation: (function () {
|
|
8
8
|
var m = L.Projection.Mercator,
|
|
9
9
|
r = m.R_MAJOR,
|
|
10
|
-
|
|
10
|
+
scale = 0.5 / (Math.PI * r);
|
|
11
11
|
|
|
12
|
-
return new L.Transformation(
|
|
12
|
+
return new L.Transformation(scale, 0.5, -scale, 0.5);
|
|
13
13
|
}())
|
|
14
14
|
});
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
L.Projection.Mercator = {
|
|
7
7
|
MAX_LATITUDE: 85.0840591556,
|
|
8
8
|
|
|
9
|
-
R_MINOR: 6356752.
|
|
9
|
+
R_MINOR: 6356752.314245179,
|
|
10
10
|
R_MAJOR: 6378137,
|
|
11
11
|
|
|
12
12
|
project: function (latlng) { // (LatLng) -> Point
|
|
@@ -24,7 +24,7 @@ L.Projection.Mercator = {
|
|
|
24
24
|
con = Math.pow((1 - con) / (1 + con), eccent * 0.5);
|
|
25
25
|
|
|
26
26
|
var ts = Math.tan(0.5 * ((Math.PI * 0.5) - y)) / con;
|
|
27
|
-
y = -
|
|
27
|
+
y = -r * Math.log(ts);
|
|
28
28
|
|
|
29
29
|
return new L.Point(x, y);
|
|
30
30
|
},
|
|
@@ -36,7 +36,7 @@ L.Projection.Mercator = {
|
|
|
36
36
|
lng = point.x * d / r,
|
|
37
37
|
tmp = r2 / r,
|
|
38
38
|
eccent = Math.sqrt(1 - (tmp * tmp)),
|
|
39
|
-
ts = Math.exp(- point.y /
|
|
39
|
+
ts = Math.exp(- point.y / r),
|
|
40
40
|
phi = (Math.PI / 2) - 2 * Math.atan(ts),
|
|
41
41
|
numIter = 15,
|
|
42
42
|
tol = 1e-7,
|
|
@@ -117,8 +117,8 @@ L.LineUtil = {
|
|
|
117
117
|
return false;
|
|
118
118
|
// other cases
|
|
119
119
|
} else {
|
|
120
|
-
codeOut = codeA || codeB
|
|
121
|
-
p = this._getEdgeIntersection(a, b, codeOut, bounds)
|
|
120
|
+
codeOut = codeA || codeB;
|
|
121
|
+
p = this._getEdgeIntersection(a, b, codeOut, bounds);
|
|
122
122
|
newCode = this._getBitCode(p, bounds);
|
|
123
123
|
|
|
124
124
|
if (codeOut === codeA) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="26" width="26">
|
|
2
|
+
<path d="M.032 17.056l13-8 13 8-13 8-13-8" fill="#b9b9b9"/>
|
|
3
|
+
<path d="M.032 17.056l-.032.93 13 8 13-8 .032-.93-13 8z" fill="#737373"/>
|
|
4
|
+
<path d="M0 13.076l13-8 13 8-13 8-13-8" fill="#cdcdcd"/>
|
|
5
|
+
<path d="M0 13.076v.91l13 8 13-8v-.91l-13 8z" fill="#737373"/>
|
|
6
|
+
<path d="M0 8.986l13-8 13 8-13 8-13-8" fill-opacity=".585" stroke="#797979" stroke-width=".1" fill="#e9e9e9"/>
|
|
7
|
+
<path d="M0 8.986v1l13 8 13-8v-1l-13 8z" fill="#737373"/>
|
|
8
|
+
</svg>
|
|
@@ -1 +1,61 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="744.094" height="1052.362"
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="744.094" height="1052.362">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="b">
|
|
4
|
+
<stop offset="0" stop-color="#2e6c97"/>
|
|
5
|
+
<stop offset="1" stop-color="#3883b7"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="a">
|
|
8
|
+
<stop offset="0" stop-color="#126fc6"/>
|
|
9
|
+
<stop offset="1" stop-color="#4c9cd1"/>
|
|
10
|
+
</linearGradient>
|
|
11
|
+
<linearGradient xlink:href="#a" x1="351.138" y1="551.589" x2="351.138" y2="512.928" gradientUnits="userSpaceOnUse" gradientTransform="translate(-2.715)"/>
|
|
12
|
+
<linearGradient xlink:href="#a" x1="318.571" y1="550.052" x2="318.571" y2="512.422" gradientUnits="userSpaceOnUse" gradientTransform="translate(94.732 2.054)"/>
|
|
13
|
+
<linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-1 0 0 1 731.268 2.054)" x1="318.571" y1="550.052" x2="318.571" y2="512.422"/>
|
|
14
|
+
<linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(94.232 2.054)" x1="318.571" y1="550.052" x2="318.571" y2="512.422"/>
|
|
15
|
+
<linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(-28.58 -.437)" x1="445.301" y1="541.286" x2="445.301" y2="503.72"/>
|
|
16
|
+
<linearGradient xlink:href="#b" gradientUnits="userSpaceOnUse" gradientTransform="translate(63 -.438)" x1="351.748" y1="522.774" x2="351.748" y2="503.721"/>
|
|
17
|
+
<linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(-28.58 -.437)" x1="445.301" y1="541.286" x2="445.301" y2="503.72"/>
|
|
18
|
+
<linearGradient xlink:href="#b" gradientUnits="userSpaceOnUse" gradientTransform="translate(63 -.438)" x1="351.748" y1="522.774" x2="351.748" y2="503.721"/>
|
|
19
|
+
<linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(-28.58 -.437)" x1="445.301" y1="541.286" x2="445.301" y2="503.72"/>
|
|
20
|
+
<linearGradient xlink:href="#b" gradientUnits="userSpaceOnUse" gradientTransform="translate(63 -.438)" x1="351.748" y1="522.774" x2="351.748" y2="503.721"/>
|
|
21
|
+
<linearGradient xlink:href="#a" id="c" gradientUnits="userSpaceOnUse" gradientTransform="translate(-28.846 -.287)" x1="445.301" y1="541.286" x2="445.301" y2="503.72"/>
|
|
22
|
+
<linearGradient xlink:href="#b" id="d" gradientUnits="userSpaceOnUse" gradientTransform="translate(62.734 -.288)" x1="351.748" y1="522.774" x2="351.748" y2="503.721"/>
|
|
23
|
+
<linearGradient xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(-28.846 -.287)" x1="445.301" y1="541.286" x2="445.301" y2="503.72"/>
|
|
24
|
+
<linearGradient xlink:href="#b" gradientUnits="userSpaceOnUse" gradientTransform="translate(62.734 -.288)" x1="351.748" y1="522.774" x2="351.748" y2="503.721"/>
|
|
25
|
+
</defs>
|
|
26
|
+
<image y="502.237" x="369.375" xlink:href="data:image/png;base64,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 0YvhJSIAAAAASUVORK5CYII=" height="41" width="25"/>
|
|
27
|
+
<rect y="507.575" x="410.279" height="14.5" width="12.625" fill="#fff"/>
|
|
28
|
+
<path d="M416.544 503.612c-6.573 0-12.044 5.691-12.044 11.866 0 2.778 1.564 6.308 2.694 8.746l9.306 17.872 9.262-17.872c1.13-2.438 2.738-5.791 2.738-8.746 0-6.175-5.383-11.866-11.956-11.866zm0 7.155c2.584.017 4.679 2.122 4.679 4.71s-2.095 4.663-4.679 4.679c-2.584-.017-4.679-2.09-4.679-4.679 0-2.588 2.095-4.693 4.679-4.71z" fill="url(#c)" stroke="url(#d)" stroke-width="1.1" stroke-linecap="round"/>
|
|
29
|
+
<text style="line-height:125%" x="403.75" y="489.362" font-size="4" letter-spacing="0" word-spacing="0" font-family="Sans">
|
|
30
|
+
<tspan x="403.75" y="489.362">
|
|
31
|
+
Use this one.
|
|
32
|
+
</tspan>
|
|
33
|
+
<tspan x="403.75" y="494.362">
|
|
34
|
+
Select it and the area around with box select.
|
|
35
|
+
</tspan>
|
|
36
|
+
<tspan x="403.75" y="499.362">
|
|
37
|
+
should be exactly 25x41 at 90dpi
|
|
38
|
+
</tspan>
|
|
39
|
+
</text>
|
|
40
|
+
<text style="line-height:125%" x="408.708" y="563.751" font-size="40" letter-spacing="0" word-spacing="0" font-family="Sans">
|
|
41
|
+
<tspan x="408.708" y="563.751" font-size="4">
|
|
42
|
+
How to do the inset border:
|
|
43
|
+
</tspan>
|
|
44
|
+
<tspan x="408.708" y="568.751" font-size="4">
|
|
45
|
+
Delete the existing inset border. Select the background, duplicate.
|
|
46
|
+
</tspan>
|
|
47
|
+
<tspan x="408.708" y="573.751" font-size="4">
|
|
48
|
+
Path, Dynamic offset.
|
|
49
|
+
</tspan>
|
|
50
|
+
<tspan x="408.708" y="578.751" font-size="4">
|
|
51
|
+
Fill: None, Stroke Paint: RGBA #ffffff1f
|
|
52
|
+
</tspan>
|
|
53
|
+
<tspan x="408.708" y="583.751" font-size="4">
|
|
54
|
+
Zoom down to the top and grab the diamond, drag it down and fiddle it untill it looks in line
|
|
55
|
+
</tspan>
|
|
56
|
+
<tspan x="408.708" y="588.751" font-size="4">
|
|
57
|
+
with the main color layers border.
|
|
58
|
+
</tspan>
|
|
59
|
+
</text>
|
|
60
|
+
<path d="M416.531 504.719c-5.944 0-10.938 5.219-10.938 10.75 0 2.359 1.443 5.832 2.563 8.25l.031.031 8.313 15.969 8.25-15.969.031-.031c1.135-2.448 2.625-5.706 2.625-8.25 0-5.538-4.931-10.75-10.875-10.75zm0 4.969c3.168.021 5.781 2.601 5.781 5.781 0 3.18-2.613 5.761-5.781 5.781-3.168-.02-5.75-2.61-5.75-5.781 0-3.172 2.582-5.761 5.75-5.781z" stroke="#fff" stroke-width="1.1" stroke-linecap="round" stroke-opacity=".122" fill="none"/>
|
|
61
|
+
</svg>
|
|
@@ -7,7 +7,7 @@ L.FeatureGroup = L.LayerGroup.extend({
|
|
|
7
7
|
includes: L.Mixin.Events,
|
|
8
8
|
|
|
9
9
|
statics: {
|
|
10
|
-
EVENTS: 'click dblclick mouseover mouseout mousemove contextmenu'
|
|
10
|
+
EVENTS: 'click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose'
|
|
11
11
|
},
|
|
12
12
|
|
|
13
13
|
addLayer: function (layer) {
|
|
@@ -15,7 +15,9 @@ L.FeatureGroup = L.LayerGroup.extend({
|
|
|
15
15
|
return this;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
if ('on' in layer) {
|
|
19
|
+
layer.on(L.FeatureGroup.EVENTS, this._propagateEvent, this);
|
|
20
|
+
}
|
|
19
21
|
|
|
20
22
|
L.LayerGroup.prototype.addLayer.call(this, layer);
|
|
21
23
|
|
|
@@ -27,6 +29,13 @@ L.FeatureGroup = L.LayerGroup.extend({
|
|
|
27
29
|
},
|
|
28
30
|
|
|
29
31
|
removeLayer: function (layer) {
|
|
32
|
+
if (!this.hasLayer(layer)) {
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
if (layer in this._layers) {
|
|
36
|
+
layer = this._layers[layer];
|
|
37
|
+
}
|
|
38
|
+
|
|
30
39
|
layer.off(L.FeatureGroup.EVENTS, this._propagateEvent, this);
|
|
31
40
|
|
|
32
41
|
L.LayerGroup.prototype.removeLayer.call(this, layer);
|
|
@@ -44,6 +53,15 @@ L.FeatureGroup = L.LayerGroup.extend({
|
|
|
44
53
|
return this.invoke('bindPopup', content, options);
|
|
45
54
|
},
|
|
46
55
|
|
|
56
|
+
openPopup: function (latlng) {
|
|
57
|
+
// open popup on the first layer
|
|
58
|
+
for (var id in this._layers) {
|
|
59
|
+
this._layers[id].openPopup(latlng);
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
return this;
|
|
63
|
+
},
|
|
64
|
+
|
|
47
65
|
setStyle: function (style) {
|
|
48
66
|
return this.invoke('setStyle', style);
|
|
49
67
|
},
|
|
@@ -67,11 +85,10 @@ L.FeatureGroup = L.LayerGroup.extend({
|
|
|
67
85
|
},
|
|
68
86
|
|
|
69
87
|
_propagateEvent: function (e) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
88
|
+
e = L.extend({}, e, {
|
|
89
|
+
layer: e.target,
|
|
90
|
+
target: this
|
|
91
|
+
});
|
|
75
92
|
this.fire(e.type, e);
|
|
76
93
|
}
|
|
77
94
|
});
|