leaflet-js 0.7.9 → 0.8.dev2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +0 -10
- data/Rakefile +3 -3
- data/leaflet-js.gemspec +7 -13
- data/lib/leaflet-js.rb +10 -2
- data/lib/leaflet.draw/BREAKINGCHANGES.md +54 -0
- data/lib/leaflet.draw/CHANGELOG.md +130 -0
- data/lib/leaflet.draw/Jakefile.js +48 -0
- data/lib/leaflet.draw/MIT-LICENCE.txt +20 -0
- data/lib/leaflet.draw/README.md +427 -0
- data/lib/leaflet.draw/TODO.md +62 -0
- data/lib/leaflet.draw/build/build.html +243 -0
- data/lib/leaflet.draw/build/build.js +187 -0
- data/lib/leaflet.draw/build/deps.js +76 -0
- data/lib/leaflet.draw/build/hintrc.js +39 -0
- data/lib/leaflet.draw/build/leaflet.draw-include.js +42 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/dist/images/spritesheet-2x.png +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/dist/images/spritesheet.png +0 -0
- data/lib/leaflet.draw/dist/leaflet.draw-src.js +2872 -0
- data/lib/leaflet.draw/dist/leaflet.draw.css +295 -0
- data/lib/leaflet.draw/dist/leaflet.draw.js +10 -0
- data/lib/leaflet.draw/examples/basic.html +113 -0
- data/lib/leaflet.draw/examples/edithandlers.html +66 -0
- data/{vendor/assets/Leaflet/dist → lib/leaflet.draw/examples/libs}/images/layers-2x.png +0 -0
- data/{vendor/assets/Leaflet/dist → lib/leaflet.draw/examples/libs}/images/layers.png +0 -0
- data/{vendor/assets/Leaflet/dist → lib/leaflet.draw/examples/libs}/images/marker-icon-2x.png +0 -0
- data/{vendor/assets/Leaflet/dist → lib/leaflet.draw/examples/libs}/images/marker-icon.png +0 -0
- data/lib/leaflet.draw/examples/libs/images/marker-icon@2x.png +0 -0
- data/{vendor/assets/Leaflet/dist → lib/leaflet.draw/examples/libs}/images/marker-shadow.png +0 -0
- data/lib/leaflet.draw/examples/libs/leaflet-src.js +9191 -0
- data/{vendor/assets/leaflet.css.erb → lib/leaflet.draw/examples/libs/leaflet.css} +2 -2
- data/lib/leaflet.draw/package.json +40 -0
- data/lib/leaflet.draw/spec/after.js +2 -0
- data/lib/leaflet.draw/spec/before.js +3 -0
- data/lib/leaflet.draw/spec/expect.js +1253 -0
- data/lib/leaflet.draw/spec/happen.js +93 -0
- data/lib/leaflet.draw/spec/index.html +38 -0
- data/lib/leaflet.draw/spec/karma.conf.js +72 -0
- data/lib/leaflet.draw/spec/sinon.js +4223 -0
- data/lib/leaflet.draw/spec/spec.hintrc.js +25 -0
- data/lib/leaflet.draw/spec/suites/DrawControlSpec.js +14 -0
- data/lib/leaflet.draw/spec/suites/GeometryUtilSpec.js +25 -0
- data/lib/leaflet.draw/spec/suites/LatLngUtilSpec.js +11 -0
- data/lib/leaflet.draw/spec/suites/SpecHelper.js +28 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/Control.Draw.js +9 -9
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/Leaflet.draw.js +1 -2
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/Toolbar.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/Tooltip.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/copyright.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/DrawToolbar.js +0 -4
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Circle.js +1 -1
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Feature.js +2 -2
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Marker.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Polygon.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Polyline.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Rectangle.js +1 -19
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.SimpleShape.js +1 -7
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/EditToolbar.js +2 -9
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/Edit.Circle.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/Edit.Poly.js +2 -14
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/Edit.Rectangle.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/Edit.SimpleShape.js +3 -11
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/EditToolbar.Delete.js +1 -4
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/EditToolbar.Edit.js +83 -17
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/ext/GeometryUtil.js +1 -1
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/ext/LatLngUtil.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/ext/LineUtil.Intersect.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/ext/Polygon.Intersect.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/ext/Polyline.Intersect.js +0 -0
- data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/images/spritesheet.svg +0 -0
- data/lib/leaflet.label/CHANGELOG.md +67 -0
- data/lib/leaflet.label/Jakefile.js +21 -0
- data/lib/leaflet.label/MIT-LICENCE.txt +20 -0
- data/lib/leaflet.label/README.md +103 -0
- data/lib/leaflet.label/build/build.js +155 -0
- data/lib/leaflet.label/build/deps.js +26 -0
- data/lib/leaflet.label/build/hint.js +30 -0
- data/lib/leaflet.label/build/hintrc.js +51 -0
- data/lib/leaflet.label/dist/images/death.png +0 -0
- data/lib/leaflet.label/dist/leaflet.label-src.js +542 -0
- data/{vendor/assets → lib/leaflet.label/dist}/leaflet.label.css +0 -0
- data/lib/leaflet.label/dist/leaflet.label.js +9 -0
- data/lib/leaflet.label/example/label.html +85 -0
- 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/images/marker-icon.png +0 -0
- data/lib/leaflet.label/libs/leaflet/images/marker-icon@2x.png +0 -0
- data/lib/leaflet.label/libs/leaflet/images/marker-shadow.png +0 -0
- data/lib/leaflet.label/libs/leaflet/leaflet-src.js +9108 -0
- data/lib/leaflet.label/libs/leaflet/leaflet.css +478 -0
- data/lib/leaflet.label/libs/leaflet/leaflet.js +9 -0
- data/lib/leaflet.label/package.json +19 -0
- data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/BaseMarkerMethods.js +0 -0
- data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/CircleMarker.Label.js +0 -0
- data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/FeatureGroup.Label.js +0 -0
- data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/Label.js +2 -5
- data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/Leaflet.label.js +1 -1
- data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/Map.Label.js +0 -0
- data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/Marker.Label.js +0 -0
- data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/Path.Label.js +0 -0
- data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/copyright.js +0 -0
- data/lib/leaflet/CHANGELOG.md +1007 -0
- data/lib/leaflet/CONTRIBUTING.md +155 -0
- data/lib/leaflet/FAQ.md +138 -0
- data/lib/leaflet/Jakefile.js +56 -0
- data/lib/leaflet/LICENSE +23 -0
- data/lib/leaflet/PLUGIN-GUIDE.md +127 -0
- data/lib/leaflet/README.md +34 -0
- data/lib/leaflet/build/build.html +227 -0
- data/lib/leaflet/build/build.js +190 -0
- data/lib/leaflet/build/deps.js +258 -0
- data/lib/leaflet/build/hintrc.js +40 -0
- data/lib/leaflet/debug/css/mobile.css +6 -0
- data/lib/leaflet/debug/css/screen.css +5 -0
- data/lib/leaflet/debug/hacks/jitter.html +42 -0
- data/lib/leaflet/debug/leaflet-include.js +59 -0
- data/lib/leaflet/debug/map/canvas.html +49 -0
- data/lib/leaflet/debug/map/controls.html +49 -0
- data/lib/leaflet/debug/map/geolocation.html +34 -0
- data/lib/leaflet/debug/map/grid.html +45 -0
- data/lib/leaflet/debug/map/iframe.html +11 -0
- data/lib/leaflet/debug/map/image-overlay.html +43 -0
- data/lib/leaflet/debug/map/map-mobile.html +34 -0
- data/lib/leaflet/debug/map/map.html +61 -0
- data/lib/leaflet/debug/map/max-bounds.html +38 -0
- data/lib/leaflet/debug/map/opacity.html +223 -0
- data/lib/leaflet/debug/map/scroll.html +41 -0
- data/lib/leaflet/debug/map/simple-proj.html +59 -0
- data/lib/leaflet/debug/map/wms-marble.html +30 -0
- data/lib/leaflet/debug/map/wms.html +40 -0
- data/lib/leaflet/debug/map/zoomlevels.html +45 -0
- data/lib/leaflet/debug/tests/add_remove_layers.html +87 -0
- data/lib/leaflet/debug/tests/bringtoback.html +37 -0
- data/lib/leaflet/debug/tests/canvasloop.html +47 -0
- data/lib/leaflet/debug/tests/click_on_canvas.html +58 -0
- data/lib/leaflet/debug/tests/click_on_canvas_broken.html +49 -0
- data/lib/leaflet/debug/tests/dragging_and_copyworldjump.html +61 -0
- data/lib/leaflet/debug/tests/opacity.html +56 -0
- data/lib/leaflet/debug/tests/popupcontextmenuclicks.html +59 -0
- data/lib/leaflet/debug/tests/remove_while_dragging.html +28 -0
- data/lib/leaflet/debug/tests/removetilewhilepan.html +41 -0
- data/lib/leaflet/debug/tests/reuse_popups.html +40 -0
- 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 +54 -0
- data/lib/leaflet/debug/vector/bounds-extend.html +88 -0
- data/lib/leaflet/debug/vector/feature-group-bounds.html +90 -0
- data/lib/leaflet/debug/vector/geojson-sample.js +53 -0
- data/lib/leaflet/debug/vector/geojson.html +173 -0
- data/lib/leaflet/debug/vector/rectangle.html +53 -0
- data/lib/leaflet/debug/vector/route.js +1 -0
- data/lib/leaflet/debug/vector/touchzoomemu.html +194 -0
- data/lib/leaflet/debug/vector/us-states.js +54 -0
- data/lib/leaflet/debug/vector/vector-bounds.html +69 -0
- data/lib/leaflet/debug/vector/vector-canvas.html +92 -0
- data/lib/leaflet/debug/vector/vector-mobile.html +38 -0
- data/lib/leaflet/debug/vector/vector-simple.html +47 -0
- data/lib/leaflet/debug/vector/vector.html +37 -0
- data/lib/leaflet/debug/vector/vector2.html +58 -0
- data/lib/leaflet/dist/images/layers-2x.png +0 -0
- data/lib/leaflet/dist/images/layers.png +0 -0
- data/lib/leaflet/dist/images/marker-icon-2x.png +0 -0
- data/lib/leaflet/dist/images/marker-icon.png +0 -0
- data/lib/leaflet/dist/images/marker-shadow.png +0 -0
- data/lib/leaflet/dist/leaflet.css +494 -0
- data/lib/leaflet/package.json +28 -0
- data/lib/leaflet/spec/after.js +2 -0
- data/lib/leaflet/spec/expect.js +1253 -0
- data/lib/leaflet/spec/index.html +87 -0
- data/lib/leaflet/spec/karma.conf.js +68 -0
- data/lib/leaflet/spec/sinon.js +4223 -0
- data/lib/leaflet/spec/spec.hintrc.js +25 -0
- data/lib/leaflet/spec/suites/SpecHelper.js +42 -0
- data/lib/leaflet/spec/suites/control/Control.AttributionSpec.js +68 -0
- data/lib/leaflet/spec/suites/control/Control.LayersSpec.js +67 -0
- data/lib/leaflet/spec/suites/control/Control.ScaleSpec.js +6 -0
- data/lib/leaflet/spec/suites/core/ClassSpec.js +166 -0
- data/lib/leaflet/spec/suites/core/EventsSpec.js +416 -0
- data/lib/leaflet/spec/suites/core/UtilSpec.js +237 -0
- data/lib/leaflet/spec/suites/dom/DomEventSpec.js +102 -0
- data/lib/leaflet/spec/suites/dom/DomUtilSpec.js +59 -0
- data/lib/leaflet/spec/suites/dom/PosAnimationSpec.js +27 -0
- data/lib/leaflet/spec/suites/geo/CRSSpec.js +151 -0
- data/lib/leaflet/spec/suites/geo/LatLngBoundsSpec.js +144 -0
- data/lib/leaflet/spec/suites/geo/LatLngSpec.js +102 -0
- data/lib/leaflet/spec/suites/geo/ProjectionSpec.js +96 -0
- data/lib/leaflet/spec/suites/geometry/BoundsSpec.js +87 -0
- data/lib/leaflet/spec/suites/geometry/LineUtilSpec.js +75 -0
- data/lib/leaflet/spec/suites/geometry/PointSpec.js +104 -0
- data/lib/leaflet/spec/suites/geometry/PolyUtilSpec.js +27 -0
- data/lib/leaflet/spec/suites/geometry/TransformationSpec.js +31 -0
- data/lib/leaflet/spec/suites/layer/FeatureGroupSpec.js +86 -0
- data/lib/leaflet/spec/suites/layer/GeoJSONSpec.js +282 -0
- data/lib/leaflet/spec/suites/layer/LayerGroupSpec.js +71 -0
- data/lib/leaflet/spec/suites/layer/PopupSpec.js +119 -0
- data/lib/leaflet/spec/suites/layer/marker/MarkerSpec.js +117 -0
- data/lib/leaflet/spec/suites/layer/tile/GridLayerSpec.js +70 -0
- data/lib/leaflet/spec/suites/layer/tile/TileLayerSpec.js +88 -0
- data/lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js +53 -0
- data/lib/leaflet/spec/suites/layer/vector/CircleSpec.js +18 -0
- data/lib/leaflet/spec/suites/layer/vector/PolygonSpec.js +96 -0
- data/lib/leaflet/spec/suites/layer/vector/PolylineGeometrySpec.js +35 -0
- data/lib/leaflet/spec/suites/layer/vector/PolylineSpec.js +55 -0
- data/lib/leaflet/spec/suites/map/MapSpec.js +553 -0
- data/lib/leaflet/spec/suites/map/handler/Map.DragSpec.js +38 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/Leaflet.js +16 -11
- data/{vendor/assets/Leaflet → lib/leaflet}/src/control/Control.Attribution.js +1 -23
- data/{vendor/assets/Leaflet → lib/leaflet}/src/control/Control.Layers.js +42 -57
- data/lib/leaflet/src/control/Control.Scale.js +102 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/control/Control.Zoom.js +11 -18
- data/{vendor/assets/Leaflet → lib/leaflet}/src/control/Control.js +7 -9
- data/lib/leaflet/src/copyright.js +4 -0
- data/lib/leaflet/src/core/Browser.js +65 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/core/Class.js +8 -13
- data/lib/leaflet/src/core/Events.js +226 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/core/Handler.js +0 -0
- data/lib/leaflet/src/core/Util.js +196 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/dom/DomEvent.DoubleTap.js +20 -27
- data/lib/leaflet/src/dom/DomEvent.Pointer.js +107 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/dom/DomEvent.js +70 -59
- data/lib/leaflet/src/dom/DomUtil.js +213 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/dom/Draggable.js +10 -19
- data/{vendor/assets/Leaflet → lib/leaflet}/src/dom/PosAnimation.Timer.js +0 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/dom/PosAnimation.js +4 -3
- data/lib/leaflet/src/geo/LatLng.js +67 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/geo/LatLngBounds.js +0 -0
- data/lib/leaflet/src/geo/crs/CRS.EPSG3395.js +13 -0
- data/lib/leaflet/src/geo/crs/CRS.EPSG3857.js +17 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/geo/crs/CRS.EPSG4326.js +2 -3
- data/lib/leaflet/src/geo/crs/CRS.Earth.js +19 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/geo/crs/CRS.Simple.js +10 -1
- data/lib/leaflet/src/geo/crs/CRS.js +63 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/geo/projection/Projection.LonLat.js +5 -1
- data/lib/leaflet/src/geo/projection/Projection.Mercator.js +43 -0
- data/lib/leaflet/src/geo/projection/Projection.SphericalMercator.js +31 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/geometry/Bounds.js +0 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/geometry/LineUtil.js +16 -5
- data/{vendor/assets/Leaflet → lib/leaflet}/src/geometry/Point.js +10 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/geometry/PolyUtil.js +0 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/geometry/Transformation.js +0 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/images/layers.svg +0 -0
- data/lib/leaflet/src/images/logo.svg +85 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/images/marker.svg +0 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/FeatureGroup.js +3 -20
- data/lib/leaflet/src/layer/GeoJSON.js +275 -0
- data/lib/leaflet/src/layer/ImageOverlay.js +123 -0
- data/lib/leaflet/src/layer/Layer.Popup.js +87 -0
- data/lib/leaflet/src/layer/Layer.js +150 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/LayerGroup.js +12 -14
- data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/Popup.js +65 -83
- data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/marker/DivIcon.js +3 -8
- data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/marker/Icon.Default.js +6 -12
- data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/marker/Icon.js +8 -25
- data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/marker/Marker.Drag.js +13 -11
- data/lib/leaflet/src/layer/marker/Marker.Popup.js +16 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/marker/Marker.js +52 -103
- data/lib/leaflet/src/layer/tile/GridLayer.js +536 -0
- data/lib/leaflet/src/layer/tile/TileLayer.WMS.js +79 -0
- data/lib/leaflet/src/layer/tile/TileLayer.js +148 -0
- data/lib/leaflet/src/layer/vector/Canvas.js +292 -0
- data/lib/leaflet/src/layer/vector/Circle.js +67 -0
- data/lib/leaflet/src/layer/vector/CircleMarker.js +72 -0
- data/lib/leaflet/src/layer/vector/Path.js +79 -0
- data/lib/leaflet/src/layer/vector/Polygon.js +75 -0
- data/lib/leaflet/src/layer/vector/Polyline.js +223 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/vector/Rectangle.js +27 -27
- data/lib/leaflet/src/layer/vector/Renderer.js +75 -0
- data/lib/leaflet/src/layer/vector/SVG.VML.js +134 -0
- data/lib/leaflet/src/layer/vector/SVG.js +189 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/map/Map.js +83 -199
- data/{vendor/assets/Leaflet → lib/leaflet}/src/map/anim/Map.PanAnimation.js +0 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/map/anim/Map.ZoomAnimation.js +30 -38
- data/{vendor/assets/Leaflet → lib/leaflet}/src/map/ext/Map.Geolocation.js +8 -8
- data/lib/leaflet/src/map/handler/Map.BoxZoom.js +105 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.DoubleClickZoom.js +0 -0
- data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.Drag.js +12 -10
- data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.Keyboard.js +19 -17
- data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.ScrollWheelZoom.js +10 -6
- data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.Tap.js +8 -6
- data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.TouchZoom.js +16 -32
- data/vendor/assets/images/layers-2x.png +0 -0
- data/vendor/assets/images/layers.png +0 -0
- data/vendor/assets/images/marker-icon-2x.png +0 -0
- data/vendor/assets/images/marker-icon.png +0 -0
- data/vendor/assets/images/marker-shadow.png +0 -0
- data/vendor/assets/images/spritesheet-2x.png +0 -0
- data/vendor/assets/images/spritesheet.png +0 -0
- data/vendor/assets/{leaflet-js.js → javascripts/leaflet-js.js} +2 -2
- data/vendor/assets/javascripts/leaflet.draw.js +37 -0
- data/vendor/assets/javascripts/leaflet.js +149 -0
- data/vendor/assets/javascripts/leaflet.label.js +11 -0
- data/vendor/assets/{leaflet-js.css → stylesheets/leaflet-js.css} +0 -0
- data/vendor/assets/stylesheets/leaflet.css.erb +478 -0
- data/vendor/assets/{leaflet.draw.css.erb → stylesheets/leaflet.draw.css.erb} +2 -2
- data/vendor/assets/{leaflet.draw.ie.css → stylesheets/leaflet.draw.ie.css} +0 -0
- data/vendor/assets/stylesheets/leaflet.label.css +52 -0
- metadata +298 -137
- data/lib/leaflet-js/engine.rb +0 -7
- data/lib/leaflet-js/version.rb +0 -3
- data/vendor/assets/Leaflet.draw/src/edit/handler/Edit.Marker.js +0 -75
- data/vendor/assets/Leaflet/src/control/Control.Scale.js +0 -112
- data/vendor/assets/Leaflet/src/copyright.js +0 -5
- data/vendor/assets/Leaflet/src/core/Browser.js +0 -66
- data/vendor/assets/Leaflet/src/core/Events.js +0 -178
- data/vendor/assets/Leaflet/src/core/Util.js +0 -182
- data/vendor/assets/Leaflet/src/dom/DomEvent.Pointer.js +0 -156
- data/vendor/assets/Leaflet/src/dom/DomUtil.js +0 -289
- data/vendor/assets/Leaflet/src/geo/LatLng.js +0 -99
- data/vendor/assets/Leaflet/src/geo/crs/CRS.EPSG3395.js +0 -14
- data/vendor/assets/Leaflet/src/geo/crs/CRS.EPSG3857.js +0 -21
- data/vendor/assets/Leaflet/src/geo/crs/CRS.js +0 -32
- data/vendor/assets/Leaflet/src/geo/projection/Projection.Mercator.js +0 -56
- data/vendor/assets/Leaflet/src/geo/projection/Projection.SphericalMercator.js +0 -27
- data/vendor/assets/Leaflet/src/geo/projection/Projection.js +0 -5
- data/vendor/assets/Leaflet/src/layer/GeoJSON.js +0 -286
- data/vendor/assets/Leaflet/src/layer/ImageOverlay.js +0 -141
- data/vendor/assets/Leaflet/src/layer/marker/Marker.Popup.js +0 -90
- data/vendor/assets/Leaflet/src/layer/tile/TileLayer.Anim.js +0 -110
- data/vendor/assets/Leaflet/src/layer/tile/TileLayer.Canvas.js +0 -61
- data/vendor/assets/Leaflet/src/layer/tile/TileLayer.WMS.js +0 -87
- data/vendor/assets/Leaflet/src/layer/tile/TileLayer.js +0 -597
- data/vendor/assets/Leaflet/src/layer/vector/Circle.js +0 -98
- data/vendor/assets/Leaflet/src/layer/vector/CircleMarker.js +0 -45
- data/vendor/assets/Leaflet/src/layer/vector/MultiPoly.js +0 -57
- data/vendor/assets/Leaflet/src/layer/vector/Path.Popup.js +0 -65
- data/vendor/assets/Leaflet/src/layer/vector/Path.SVG.js +0 -230
- data/vendor/assets/Leaflet/src/layer/vector/Path.VML.js +0 -135
- data/vendor/assets/Leaflet/src/layer/vector/Path.js +0 -119
- data/vendor/assets/Leaflet/src/layer/vector/Polygon.js +0 -92
- data/vendor/assets/Leaflet/src/layer/vector/Polyline.js +0 -164
- data/vendor/assets/Leaflet/src/layer/vector/canvas/Circle.Canvas.js +0 -18
- data/vendor/assets/Leaflet/src/layer/vector/canvas/CircleMarker.Canvas.js +0 -9
- data/vendor/assets/Leaflet/src/layer/vector/canvas/Path.Canvas.js +0 -204
- data/vendor/assets/Leaflet/src/layer/vector/canvas/Polygon.Canvas.js +0 -37
- data/vendor/assets/Leaflet/src/layer/vector/canvas/Polyline.Canvas.js +0 -30
- data/vendor/assets/Leaflet/src/map/handler/Map.BoxZoom.js +0 -118
- data/vendor/assets/leaflet.draw.js +0 -38
- data/vendor/assets/leaflet.js +0 -155
- data/vendor/assets/leaflet.label.js +0 -11
@@ -0,0 +1,87 @@
|
|
1
|
+
/*
|
2
|
+
* Adds popup-related methods to all layers.
|
3
|
+
*/
|
4
|
+
|
5
|
+
L.Layer.include({
|
6
|
+
|
7
|
+
bindPopup: function (content, options) {
|
8
|
+
|
9
|
+
if (content instanceof L.Popup) {
|
10
|
+
this._popup = content;
|
11
|
+
content._source = this;
|
12
|
+
} else {
|
13
|
+
if (!this._popup || options) {
|
14
|
+
this._popup = new L.Popup(options, this);
|
15
|
+
}
|
16
|
+
this._popup.setContent(content);
|
17
|
+
}
|
18
|
+
|
19
|
+
if (!this._popupHandlersAdded) {
|
20
|
+
this.on({
|
21
|
+
click: this._openPopup,
|
22
|
+
remove: this.closePopup,
|
23
|
+
move: this._movePopup
|
24
|
+
});
|
25
|
+
this._popupHandlersAdded = true;
|
26
|
+
}
|
27
|
+
|
28
|
+
return this;
|
29
|
+
},
|
30
|
+
|
31
|
+
unbindPopup: function () {
|
32
|
+
if (this._popup) {
|
33
|
+
this.on({
|
34
|
+
click: this._openPopup,
|
35
|
+
remove: this.closePopup,
|
36
|
+
move: this._movePopup
|
37
|
+
});
|
38
|
+
this._popupHandlersAdded = false;
|
39
|
+
this._popup = null;
|
40
|
+
}
|
41
|
+
return this;
|
42
|
+
},
|
43
|
+
|
44
|
+
openPopup: function (latlng) {
|
45
|
+
if (this._popup && this._map) {
|
46
|
+
this._map.openPopup(this._popup, latlng || this._latlng || this.getCenter());
|
47
|
+
}
|
48
|
+
return this;
|
49
|
+
},
|
50
|
+
|
51
|
+
closePopup: function () {
|
52
|
+
if (this._popup) {
|
53
|
+
this._popup._close();
|
54
|
+
}
|
55
|
+
return this;
|
56
|
+
},
|
57
|
+
|
58
|
+
togglePopup: function () {
|
59
|
+
if (this._popup) {
|
60
|
+
if (this._popup._map) {
|
61
|
+
this.closePopup();
|
62
|
+
} else {
|
63
|
+
this.openPopup();
|
64
|
+
}
|
65
|
+
}
|
66
|
+
return this;
|
67
|
+
},
|
68
|
+
|
69
|
+
setPopupContent: function (content) {
|
70
|
+
if (this._popup) {
|
71
|
+
this._popup.setContent(content);
|
72
|
+
}
|
73
|
+
return this;
|
74
|
+
},
|
75
|
+
|
76
|
+
getPopup: function () {
|
77
|
+
return this._popup;
|
78
|
+
},
|
79
|
+
|
80
|
+
_openPopup: function (e) {
|
81
|
+
this._map.openPopup(this._popup, e.latlng);
|
82
|
+
},
|
83
|
+
|
84
|
+
_movePopup: function (e) {
|
85
|
+
this._popup.setLatLng(e.latlng);
|
86
|
+
}
|
87
|
+
});
|
@@ -0,0 +1,150 @@
|
|
1
|
+
|
2
|
+
L.Layer = L.Evented.extend({
|
3
|
+
|
4
|
+
options: {
|
5
|
+
pane: 'overlayPane'
|
6
|
+
},
|
7
|
+
|
8
|
+
addTo: function (map) {
|
9
|
+
var id = L.stamp(this);
|
10
|
+
if (map._layers[id]) { return this; }
|
11
|
+
map._layers[id] = this;
|
12
|
+
|
13
|
+
this._zoomAnimated = map._zoomAnimated;
|
14
|
+
|
15
|
+
if (this.beforeAdd) {
|
16
|
+
this.beforeAdd(map);
|
17
|
+
}
|
18
|
+
|
19
|
+
this._mapToAdd = map;
|
20
|
+
map.whenReady(this._layerAdd, this);
|
21
|
+
|
22
|
+
return this;
|
23
|
+
},
|
24
|
+
|
25
|
+
_layerAdd: function () {
|
26
|
+
var map = this._mapToAdd;
|
27
|
+
|
28
|
+
// check in case layer gets added and then removed before the map is ready
|
29
|
+
if (!map) { return; }
|
30
|
+
|
31
|
+
this._map = map;
|
32
|
+
this._mapToAdd = null;
|
33
|
+
|
34
|
+
this.onAdd(map);
|
35
|
+
|
36
|
+
if (this.getAttribution && this._map.attributionControl) {
|
37
|
+
this._map.attributionControl.addAttribution(this.getAttribution());
|
38
|
+
}
|
39
|
+
|
40
|
+
if (this.getEvents) {
|
41
|
+
map.on(this.getEvents(), this);
|
42
|
+
}
|
43
|
+
|
44
|
+
this.fire('add');
|
45
|
+
map.fire('layeradd', {layer: this});
|
46
|
+
},
|
47
|
+
|
48
|
+
remove: function () {
|
49
|
+
|
50
|
+
var id = L.stamp(this),
|
51
|
+
map = this._map || this._mapToAdd;
|
52
|
+
|
53
|
+
if (!map || !map._layers[id]) { return this; }
|
54
|
+
|
55
|
+
if (map._loaded) {
|
56
|
+
this.onRemove(map);
|
57
|
+
}
|
58
|
+
|
59
|
+
if (this.getAttribution && this._map.attributionControl) {
|
60
|
+
this._map.attributionControl.removeAttribution(this.getAttribution());
|
61
|
+
}
|
62
|
+
|
63
|
+
if (this.getEvents) {
|
64
|
+
map.off(this.getEvents(), this);
|
65
|
+
}
|
66
|
+
|
67
|
+
delete map._layers[id];
|
68
|
+
|
69
|
+
if (map._loaded) {
|
70
|
+
map.fire('layerremove', {layer: this});
|
71
|
+
this.fire('remove');
|
72
|
+
}
|
73
|
+
|
74
|
+
this._map = this._mapToAdd = null;
|
75
|
+
|
76
|
+
return this;
|
77
|
+
},
|
78
|
+
|
79
|
+
getPane: function (name) {
|
80
|
+
return this._map.getPane(name ? (this.options[name] || name) : this.options.pane);
|
81
|
+
}
|
82
|
+
});
|
83
|
+
|
84
|
+
|
85
|
+
L.Map.include({
|
86
|
+
addLayer: function (layer) {
|
87
|
+
layer.addTo(this);
|
88
|
+
return this;
|
89
|
+
},
|
90
|
+
|
91
|
+
removeLayer: function (layer) {
|
92
|
+
layer.remove();
|
93
|
+
return this;
|
94
|
+
},
|
95
|
+
|
96
|
+
hasLayer: function (layer) {
|
97
|
+
return !!layer && (L.stamp(layer) in this._layers);
|
98
|
+
},
|
99
|
+
|
100
|
+
eachLayer: function (method, context) {
|
101
|
+
for (var i in this._layers) {
|
102
|
+
method.call(context, this._layers[i]);
|
103
|
+
}
|
104
|
+
return this;
|
105
|
+
},
|
106
|
+
|
107
|
+
_addLayers: function (layers) {
|
108
|
+
layers = layers ? (L.Util.isArray(layers) ? layers : [layers]) : [];
|
109
|
+
|
110
|
+
for (var i = 0, len = layers.length; i < len; i++) {
|
111
|
+
this.addLayer(layers[i]);
|
112
|
+
}
|
113
|
+
},
|
114
|
+
|
115
|
+
_addZoomLimit: function (layer) {
|
116
|
+
if (isNaN(layer.options.maxZoom) || !isNaN(layer.options.minZoom)) {
|
117
|
+
this._zoomBoundLayers[L.stamp(layer)] = layer;
|
118
|
+
this._updateZoomLevels();
|
119
|
+
}
|
120
|
+
},
|
121
|
+
|
122
|
+
_removeZoomLimit: function (layer) {
|
123
|
+
var id = L.stamp(layer);
|
124
|
+
|
125
|
+
if (this._zoomBoundLayers[id]) {
|
126
|
+
delete this._zoomBoundLayers[id];
|
127
|
+
this._updateZoomLevels();
|
128
|
+
}
|
129
|
+
},
|
130
|
+
|
131
|
+
_updateZoomLevels: function () {
|
132
|
+
var minZoom = Infinity,
|
133
|
+
maxZoom = -Infinity,
|
134
|
+
oldZoomSpan = this._getZoomSpan();
|
135
|
+
|
136
|
+
for (var i in this._zoomBoundLayers) {
|
137
|
+
var options = this._zoomBoundLayers[i].options;
|
138
|
+
|
139
|
+
minZoom = options.minZoom === undefined ? minZoom : Math.min(minZoom, options.minZoom);
|
140
|
+
maxZoom = options.maxZoom === undefined ? maxZoom : Math.max(maxZoom, options.maxZoom);
|
141
|
+
}
|
142
|
+
|
143
|
+
this._layersMaxZoom = maxZoom === -Infinity ? undefined : maxZoom;
|
144
|
+
this._layersMinZoom = minZoom === Infinity ? undefined : minZoom;
|
145
|
+
|
146
|
+
if (oldZoomSpan !== this._getZoomSpan()) {
|
147
|
+
this.fire('zoomlevelschange');
|
148
|
+
}
|
149
|
+
}
|
150
|
+
});
|
@@ -3,7 +3,8 @@
|
|
3
3
|
* you can manipulate the group (e.g. add/remove it) as one layer.
|
4
4
|
*/
|
5
5
|
|
6
|
-
L.LayerGroup = L.
|
6
|
+
L.LayerGroup = L.Layer.extend({
|
7
|
+
|
7
8
|
initialize: function (layers) {
|
8
9
|
this._layers = {};
|
9
10
|
|
@@ -41,13 +42,13 @@ L.LayerGroup = L.Class.extend({
|
|
41
42
|
},
|
42
43
|
|
43
44
|
hasLayer: function (layer) {
|
44
|
-
|
45
|
-
|
46
|
-
return (layer in this._layers || this.getLayerId(layer) in this._layers);
|
45
|
+
return !!layer && (layer in this._layers || this.getLayerId(layer) in this._layers);
|
47
46
|
},
|
48
47
|
|
49
48
|
clearLayers: function () {
|
50
|
-
|
49
|
+
for (var i in this._layers) {
|
50
|
+
this.removeLayer(this._layers[i]);
|
51
|
+
}
|
51
52
|
return this;
|
52
53
|
},
|
53
54
|
|
@@ -67,18 +68,15 @@ L.LayerGroup = L.Class.extend({
|
|
67
68
|
},
|
68
69
|
|
69
70
|
onAdd: function (map) {
|
70
|
-
this.
|
71
|
-
|
71
|
+
for (var i in this._layers) {
|
72
|
+
map.addLayer(this._layers[i]);
|
73
|
+
}
|
72
74
|
},
|
73
75
|
|
74
76
|
onRemove: function (map) {
|
75
|
-
this.
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
addTo: function (map) {
|
80
|
-
map.addLayer(this);
|
81
|
-
return this;
|
77
|
+
for (var i in this._layers) {
|
78
|
+
map.removeLayer(this._layers[i]);
|
79
|
+
}
|
82
80
|
},
|
83
81
|
|
84
82
|
eachLayer: function (method, context) {
|
@@ -6,21 +6,24 @@ L.Map.mergeOptions({
|
|
6
6
|
closePopupOnClick: true
|
7
7
|
});
|
8
8
|
|
9
|
-
L.Popup = L.
|
10
|
-
includes: L.Mixin.Events,
|
9
|
+
L.Popup = L.Layer.extend({
|
11
10
|
|
12
11
|
options: {
|
12
|
+
pane: 'popupPane',
|
13
|
+
|
13
14
|
minWidth: 50,
|
14
15
|
maxWidth: 300,
|
15
|
-
// maxHeight:
|
16
|
-
autoPan: true,
|
17
|
-
closeButton: true,
|
16
|
+
// maxHeight: <Number>,
|
18
17
|
offset: [0, 7],
|
18
|
+
|
19
|
+
autoPan: true,
|
19
20
|
autoPanPadding: [5, 5],
|
20
|
-
// autoPanPaddingTopLeft:
|
21
|
-
// autoPanPaddingBottomRight:
|
22
|
-
|
23
|
-
|
21
|
+
// autoPanPaddingTopLeft: <Point>,
|
22
|
+
// autoPanPaddingBottomRight: <Point>,
|
23
|
+
|
24
|
+
closeButton: true,
|
25
|
+
// keepInView: false,
|
26
|
+
// className: '',
|
24
27
|
zoomAnimation: true
|
25
28
|
},
|
26
29
|
|
@@ -28,70 +31,51 @@ L.Popup = L.Class.extend({
|
|
28
31
|
L.setOptions(this, options);
|
29
32
|
|
30
33
|
this._source = source;
|
31
|
-
this._animated = L.Browser.any3d && this.options.zoomAnimation;
|
32
|
-
this._isOpen = false;
|
33
34
|
},
|
34
35
|
|
35
36
|
onAdd: function (map) {
|
36
|
-
this.
|
37
|
+
this._zoomAnimated = this._zoomAnimated && this.options.zoomAnimation;
|
37
38
|
|
38
39
|
if (!this._container) {
|
39
40
|
this._initLayout();
|
40
41
|
}
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
if (animFade) {
|
43
|
+
if (map._fadeAnimated) {
|
45
44
|
L.DomUtil.setOpacity(this._container, 0);
|
46
45
|
}
|
47
|
-
map._panes.popupPane.appendChild(this._container);
|
48
|
-
|
49
|
-
map.on(this._getEvents(), this);
|
50
46
|
|
47
|
+
clearTimeout(this._removeTimeout);
|
48
|
+
this.getPane().appendChild(this._container);
|
51
49
|
this.update();
|
52
50
|
|
53
|
-
if (
|
51
|
+
if (map._fadeAnimated) {
|
54
52
|
L.DomUtil.setOpacity(this._container, 1);
|
55
53
|
}
|
56
54
|
|
57
|
-
this.fire('open');
|
58
|
-
|
59
55
|
map.fire('popupopen', {popup: this});
|
60
56
|
|
61
57
|
if (this._source) {
|
62
|
-
this._source.fire('popupopen', {popup: this});
|
58
|
+
this._source.fire('popupopen', {popup: this}, true);
|
63
59
|
}
|
64
60
|
},
|
65
61
|
|
66
|
-
addTo: function (map) {
|
67
|
-
map.addLayer(this);
|
68
|
-
return this;
|
69
|
-
},
|
70
|
-
|
71
62
|
openOn: function (map) {
|
72
63
|
map.openPopup(this);
|
73
64
|
return this;
|
74
65
|
},
|
75
66
|
|
76
67
|
onRemove: function (map) {
|
77
|
-
map.
|
78
|
-
|
79
|
-
L.Util.falseFn(this._container.offsetWidth); // force reflow
|
80
|
-
|
81
|
-
map.off(this._getEvents(), this);
|
82
|
-
|
83
|
-
if (map.options.fadeAnimation) {
|
68
|
+
if (map._fadeAnimated) {
|
84
69
|
L.DomUtil.setOpacity(this._container, 0);
|
70
|
+
this._removeTimeout = setTimeout(L.bind(L.DomUtil.remove, L.DomUtil, this._container), 200);
|
71
|
+
} else {
|
72
|
+
L.DomUtil.remove(this._container);
|
85
73
|
}
|
86
74
|
|
87
|
-
this._map = null;
|
88
|
-
|
89
|
-
this.fire('close');
|
90
|
-
|
91
75
|
map.fire('popupclose', {popup: this});
|
92
76
|
|
93
77
|
if (this._source) {
|
94
|
-
this._source.fire('popupclose', {popup: this});
|
78
|
+
this._source.fire('popupclose', {popup: this}, true);
|
95
79
|
}
|
96
80
|
},
|
97
81
|
|
@@ -132,21 +116,19 @@ L.Popup = L.Class.extend({
|
|
132
116
|
this._adjustPan();
|
133
117
|
},
|
134
118
|
|
135
|
-
|
136
|
-
var events = {
|
137
|
-
|
138
|
-
};
|
119
|
+
getEvents: function () {
|
120
|
+
var events = {viewreset: this._updatePosition},
|
121
|
+
options = this.options;
|
139
122
|
|
140
|
-
if (this.
|
141
|
-
events.zoomanim = this.
|
123
|
+
if (this._zoomAnimated) {
|
124
|
+
events.zoomanim = this._animateZoom;
|
142
125
|
}
|
143
|
-
if ('closeOnClick' in
|
126
|
+
if ('closeOnClick' in options ? options.closeOnClick : this._map.options.closePopupOnClick) {
|
144
127
|
events.preclick = this._close;
|
145
128
|
}
|
146
|
-
if (
|
129
|
+
if (options.keepInView) {
|
147
130
|
events.moveend = this._adjustPan;
|
148
131
|
}
|
149
|
-
|
150
132
|
return events;
|
151
133
|
},
|
152
134
|
|
@@ -158,29 +140,25 @@ L.Popup = L.Class.extend({
|
|
158
140
|
|
159
141
|
_initLayout: function () {
|
160
142
|
var prefix = 'leaflet-popup',
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
closeButton;
|
143
|
+
container = this._container = L.DomUtil.create('div',
|
144
|
+
prefix + ' ' + (this.options.className || '') +
|
145
|
+
' leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide'));
|
165
146
|
|
166
147
|
if (this.options.closeButton) {
|
167
|
-
closeButton = this._closeButton =
|
168
|
-
L.DomUtil.create('a', prefix + '-close-button', container);
|
148
|
+
var closeButton = this._closeButton = L.DomUtil.create('a', prefix + '-close-button', container);
|
169
149
|
closeButton.href = '#close';
|
170
150
|
closeButton.innerHTML = '×';
|
171
|
-
L.DomEvent.disableClickPropagation(closeButton);
|
172
151
|
|
173
152
|
L.DomEvent.on(closeButton, 'click', this._onCloseButtonClick, this);
|
174
153
|
}
|
175
154
|
|
176
|
-
var wrapper = this._wrapper =
|
177
|
-
L.DomUtil.create('div', prefix + '-content-wrapper', container);
|
178
|
-
L.DomEvent.disableClickPropagation(wrapper);
|
179
|
-
|
155
|
+
var wrapper = this._wrapper = L.DomUtil.create('div', prefix + '-content-wrapper', container);
|
180
156
|
this._contentNode = L.DomUtil.create('div', prefix + '-content', wrapper);
|
181
157
|
|
182
|
-
L.DomEvent
|
183
|
-
|
158
|
+
L.DomEvent
|
159
|
+
.disableClickPropagation(wrapper)
|
160
|
+
.disableScrollPropagation(this._contentNode)
|
161
|
+
.on(wrapper, 'contextmenu', L.DomEvent.stopPropagation);
|
184
162
|
|
185
163
|
this._tipContainer = L.DomUtil.create('div', prefix + '-tip-container', container);
|
186
164
|
this._tip = L.DomUtil.create('div', prefix + '-tip', this._tipContainer);
|
@@ -189,13 +167,15 @@ L.Popup = L.Class.extend({
|
|
189
167
|
_updateContent: function () {
|
190
168
|
if (!this._content) { return; }
|
191
169
|
|
170
|
+
var node = this._contentNode;
|
171
|
+
|
192
172
|
if (typeof this._content === 'string') {
|
193
|
-
|
173
|
+
node.innerHTML = this._content;
|
194
174
|
} else {
|
195
|
-
while (
|
196
|
-
|
175
|
+
while (node.hasChildNodes()) {
|
176
|
+
node.removeChild(node.firstChild);
|
197
177
|
}
|
198
|
-
|
178
|
+
node.appendChild(this._content);
|
199
179
|
}
|
200
180
|
this.fire('contentupdate');
|
201
181
|
},
|
@@ -234,24 +214,24 @@ L.Popup = L.Class.extend({
|
|
234
214
|
if (!this._map) { return; }
|
235
215
|
|
236
216
|
var pos = this._map.latLngToLayerPoint(this._latlng),
|
237
|
-
animated = this._animated,
|
238
217
|
offset = L.point(this.options.offset);
|
239
218
|
|
240
|
-
if (
|
219
|
+
if (this._zoomAnimated) {
|
241
220
|
L.DomUtil.setPosition(this._container, pos);
|
221
|
+
} else {
|
222
|
+
offset = offset.add(pos);
|
242
223
|
}
|
243
224
|
|
244
|
-
this._containerBottom = -offset.y
|
245
|
-
|
225
|
+
var bottom = this._containerBottom = -offset.y,
|
226
|
+
left = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x;
|
246
227
|
|
247
228
|
// bottom position the popup in case the height of the popup changes (images loading etc)
|
248
|
-
this._container.style.bottom =
|
249
|
-
this._container.style.left =
|
229
|
+
this._container.style.bottom = bottom + 'px';
|
230
|
+
this._container.style.left = left + 'px';
|
250
231
|
},
|
251
232
|
|
252
|
-
|
253
|
-
var pos = this._map._latLngToNewLayerPoint(this._latlng,
|
254
|
-
|
233
|
+
_animateZoom: function (e) {
|
234
|
+
var pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center);
|
255
235
|
L.DomUtil.setPosition(this._container, pos);
|
256
236
|
},
|
257
237
|
|
@@ -261,10 +241,9 @@ L.Popup = L.Class.extend({
|
|
261
241
|
var map = this._map,
|
262
242
|
containerHeight = this._container.offsetHeight,
|
263
243
|
containerWidth = this._containerWidth,
|
264
|
-
|
265
244
|
layerPos = new L.Point(this._containerLeft, -containerHeight - this._containerBottom);
|
266
245
|
|
267
|
-
if (this.
|
246
|
+
if (this._zoomAnimated) {
|
268
247
|
layerPos._add(L.DomUtil.getPosition(this._container));
|
269
248
|
}
|
270
249
|
|
@@ -309,17 +288,21 @@ L.popup = function (options, source) {
|
|
309
288
|
|
310
289
|
L.Map.include({
|
311
290
|
openPopup: function (popup, latlng, options) { // (Popup) or (String || HTMLElement, LatLng[, Object])
|
312
|
-
this.closePopup();
|
313
|
-
|
314
291
|
if (!(popup instanceof L.Popup)) {
|
315
292
|
var content = popup;
|
316
293
|
|
317
|
-
popup = new L.Popup(options)
|
318
|
-
|
319
|
-
|
294
|
+
popup = new L.Popup(options).setContent(content);
|
295
|
+
}
|
296
|
+
|
297
|
+
if (latlng) {
|
298
|
+
popup.setLatLng(latlng);
|
299
|
+
}
|
300
|
+
|
301
|
+
if (this.hasLayer(popup)) {
|
302
|
+
return this;
|
320
303
|
}
|
321
|
-
popup._isOpen = true;
|
322
304
|
|
305
|
+
this.closePopup();
|
323
306
|
this._popup = popup;
|
324
307
|
return this.addLayer(popup);
|
325
308
|
},
|
@@ -331,7 +314,6 @@ L.Map.include({
|
|
331
314
|
}
|
332
315
|
if (popup) {
|
333
316
|
this.removeLayer(popup);
|
334
|
-
popup._isOpen = false;
|
335
317
|
}
|
336
318
|
return this;
|
337
319
|
}
|