leaflet-js 0.6.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CHANGELOG.rdoc +32 -0
- data/LICENSE +21 -0
- data/README.rdoc +54 -0
- data/Rakefile +15 -0
- data/leaflet-js.gemspec +28 -0
- data/lib/leaflet-js.rb +10 -0
- data/lib/leaflet.draw/BREAKINGCHANGES.md +54 -0
- data/lib/leaflet.draw/CHANGELOG.md +73 -0
- data/lib/leaflet.draw/Jakefile.js +26 -0
- data/lib/leaflet.draw/MIT-LICENCE.txt +20 -0
- data/lib/leaflet.draw/README.md +364 -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 +189 -0
- data/lib/leaflet.draw/build/deps.js +75 -0
- data/lib/leaflet.draw/build/hintrc.js +47 -0
- data/lib/leaflet.draw/build/leaflet.draw-include.js +42 -0
- data/lib/leaflet.draw/dist/images/spritesheet.png +0 -0
- data/lib/leaflet.draw/dist/leaflet.draw-src.js +2429 -0
- data/lib/leaflet.draw/dist/leaflet.draw.css +212 -0
- data/lib/leaflet.draw/dist/leaflet.draw.ie.css +44 -0
- data/lib/leaflet.draw/dist/leaflet.draw.js +10 -0
- data/lib/leaflet.draw/examples/basic.html +106 -0
- data/lib/leaflet.draw/examples/edithandlers.html +67 -0
- data/lib/leaflet.draw/examples/libs/images/layers.png +0 -0
- data/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/lib/leaflet.draw/examples/libs/images/marker-shadow.png +0 -0
- data/lib/leaflet.draw/examples/libs/leaflet-src.js +8587 -0
- data/lib/leaflet.draw/examples/libs/leaflet.css +459 -0
- data/lib/leaflet.draw/examples/libs/leaflet.ie.css +51 -0
- data/lib/leaflet.draw/package.json +37 -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 +36 -0
- data/lib/leaflet.draw/spec/karma.conf.js +69 -0
- data/lib/leaflet.draw/spec/sinon.js +4223 -0
- data/lib/leaflet.draw/spec/suites/DrawControlSpec.js +15 -0
- data/lib/leaflet.draw/spec/suites/SpecHelper.js +26 -0
- data/lib/leaflet.draw/src/Control.Draw.js +101 -0
- data/lib/leaflet.draw/src/Leaflet.draw.js +5 -0
- data/lib/leaflet.draw/src/Toolbar.js +187 -0
- data/lib/leaflet.draw/src/Tooltip.js +52 -0
- data/lib/leaflet.draw/src/copyright.js +8 -0
- data/lib/leaflet.draw/src/draw/DrawToolbar.js +107 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Circle.js +59 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Feature.js +74 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Marker.js +97 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Polygon.js +79 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Polyline.js +360 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Rectangle.js +41 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.SimpleShape.js +67 -0
- data/lib/leaflet.draw/src/edit/EditToolbar.js +93 -0
- data/lib/leaflet.draw/src/edit/handler/Edit.Circle.js +63 -0
- data/lib/leaflet.draw/src/edit/handler/Edit.Poly.js +267 -0
- data/lib/leaflet.draw/src/edit/handler/Edit.Rectangle.js +117 -0
- data/lib/leaflet.draw/src/edit/handler/Edit.SimpleShape.js +138 -0
- data/lib/leaflet.draw/src/edit/handler/EditToolbar.Delete.js +109 -0
- data/lib/leaflet.draw/src/edit/handler/EditToolbar.Edit.js +233 -0
- data/lib/leaflet.draw/src/ext/LatLngUtil.js +18 -0
- data/lib/leaflet.draw/src/ext/LineUtil.Intersect.js +15 -0
- data/lib/leaflet.draw/src/ext/Polygon.Intersect.js +27 -0
- data/lib/leaflet.draw/src/ext/Polyline.Intersect.js +85 -0
- data/lib/leaflet.label/CHANGELOG.md +35 -0
- data/lib/leaflet.label/Jakefile.js +21 -0
- data/lib/leaflet.label/MIT-LICENCE.txt +20 -0
- data/lib/leaflet.label/README.md +86 -0
- data/lib/leaflet.label/build/build.js +155 -0
- data/lib/leaflet.label/build/deps.js +24 -0
- data/lib/leaflet.label/build/hint.js +30 -0
- data/lib/leaflet.label/build/hintrc.js +47 -0
- data/lib/leaflet.label/dist/images/death.png +0 -0
- data/lib/leaflet.label/dist/leaflet.label-src.js +359 -0
- data/lib/leaflet.label/dist/leaflet.label.css +33 -0
- data/lib/leaflet.label/dist/leaflet.label.js +9 -0
- data/lib/leaflet.label/example/label.html +82 -0
- data/lib/leaflet.label/libs/leaflet/images/layers.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 +8587 -0
- data/lib/leaflet.label/libs/leaflet/leaflet.css +459 -0
- data/lib/leaflet.label/libs/leaflet/leaflet.ie.css +51 -0
- data/lib/leaflet.label/libs/leaflet/leaflet.js +8 -0
- data/lib/leaflet.label/src/FeatureGroup.Label.js +20 -0
- data/lib/leaflet.label/src/Label.js +123 -0
- data/lib/leaflet.label/src/Leaflet.label.js +5 -0
- data/lib/leaflet.label/src/Map.Label.js +7 -0
- data/lib/leaflet.label/src/Marker.Label.js +160 -0
- data/lib/leaflet.label/src/Path.Label.js +55 -0
- data/lib/leaflet.label/src/copyright.js +8 -0
- data/lib/leaflet/CHANGELOG.md +637 -0
- data/lib/leaflet/CONTRIBUTING.md +155 -0
- data/lib/leaflet/Jakefile.js +26 -0
- data/lib/leaflet/LICENSE +23 -0
- data/lib/leaflet/README.md +30 -0
- data/lib/leaflet/build/build.html +243 -0
- data/lib/leaflet/build/build.js +193 -0
- data/lib/leaflet/build/deps.js +256 -0
- data/lib/leaflet/build/hintrc.js +37 -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 +43 -0
- data/lib/leaflet/debug/leaflet-include.js +59 -0
- data/lib/leaflet/debug/map/canvas.html +47 -0
- data/lib/leaflet/debug/map/controls.html +50 -0
- data/lib/leaflet/debug/map/geolocation.html +35 -0
- data/lib/leaflet/debug/map/image-overlay.html +44 -0
- data/lib/leaflet/debug/map/map-mobile.html +35 -0
- data/lib/leaflet/debug/map/map.html +60 -0
- data/lib/leaflet/debug/map/max-bounds.html +37 -0
- data/lib/leaflet/debug/map/scroll.html +36 -0
- data/lib/leaflet/debug/map/simple-proj.html +45 -0
- data/lib/leaflet/debug/map/wms-marble.html +31 -0
- data/lib/leaflet/debug/map/wms.html +41 -0
- data/lib/leaflet/debug/map/zoomlevels.html +46 -0
- data/lib/leaflet/debug/tests/add_remove_layers.html +88 -0
- data/lib/leaflet/debug/tests/bringtoback.html +38 -0
- data/lib/leaflet/debug/tests/click_on_canvas.html +59 -0
- data/lib/leaflet/debug/tests/click_on_canvas_broken.html +49 -0
- data/lib/leaflet/debug/tests/opacity.html +57 -0
- data/lib/leaflet/debug/tests/remove_while_dragging.html +29 -0
- data/lib/leaflet/debug/tests/removetilewhilepan.html +42 -0
- data/lib/leaflet/debug/tests/reuse_popups.html +41 -0
- data/lib/leaflet/debug/tests/svg_clicks.html +55 -0
- data/lib/leaflet/debug/vector/bounds-extend.html +89 -0
- data/lib/leaflet/debug/vector/feature-group-bounds.html +91 -0
- data/lib/leaflet/debug/vector/geojson-sample.js +53 -0
- data/lib/leaflet/debug/vector/geojson.html +174 -0
- data/lib/leaflet/debug/vector/rectangle.html +54 -0
- data/lib/leaflet/debug/vector/route.js +1 -0
- data/lib/leaflet/debug/vector/touchzoomemu.html +195 -0
- data/lib/leaflet/debug/vector/us-states.js +54 -0
- data/lib/leaflet/debug/vector/vector-bounds.html +70 -0
- data/lib/leaflet/debug/vector/vector-canvas.html +93 -0
- data/lib/leaflet/debug/vector/vector-mobile.html +39 -0
- data/lib/leaflet/debug/vector/vector-simple.html +49 -0
- data/lib/leaflet/debug/vector/vector.html +38 -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-src.js +8579 -0
- data/lib/leaflet/dist/leaflet.css +459 -0
- data/lib/leaflet/dist/leaflet.ie.css +51 -0
- data/lib/leaflet/dist/leaflet.js +8 -0
- data/lib/leaflet/package.json +22 -0
- data/lib/leaflet/spec/after.js +2 -0
- data/lib/leaflet/spec/before.js +3 -0
- data/lib/leaflet/spec/expect.js +1253 -0
- data/lib/leaflet/spec/happen.js +93 -0
- data/lib/leaflet/spec/index.html +78 -0
- data/lib/leaflet/spec/karma.conf.js +64 -0
- data/lib/leaflet/spec/sinon.js +4223 -0
- data/lib/leaflet/spec/suites/LeafletSpec.js +13 -0
- data/lib/leaflet/spec/suites/SpecHelper.js +26 -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 +156 -0
- data/lib/leaflet/spec/suites/core/EventsSpec.js +336 -0
- data/lib/leaflet/spec/suites/core/UtilSpec.js +212 -0
- data/lib/leaflet/spec/suites/dom/DomEventSpec.js +102 -0
- data/lib/leaflet/spec/suites/dom/DomUtilSpec.js +89 -0
- data/lib/leaflet/spec/suites/geo/LatLngBoundsSpec.js +136 -0
- data/lib/leaflet/spec/suites/geo/LatLngSpec.js +118 -0
- data/lib/leaflet/spec/suites/geo/ProjectionSpec.js +47 -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 +36 -0
- data/lib/leaflet/spec/suites/layer/GeoJSONSpec.js +86 -0
- data/lib/leaflet/spec/suites/layer/LayerGroupSpec.js +58 -0
- data/lib/leaflet/spec/suites/layer/PopupSpec.js +59 -0
- data/lib/leaflet/spec/suites/layer/TileLayerSpec.js +87 -0
- data/lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js +53 -0
- data/lib/leaflet/spec/suites/layer/vector/CircleSpec.js +17 -0
- data/lib/leaflet/spec/suites/layer/vector/PolygonSpec.js +55 -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 +244 -0
- data/lib/leaflet/src/Leaflet.js +23 -0
- data/lib/leaflet/src/control/Control.Attribution.js +115 -0
- data/lib/leaflet/src/control/Control.Layers.js +243 -0
- data/lib/leaflet/src/control/Control.Scale.js +112 -0
- data/lib/leaflet/src/control/Control.Zoom.js +86 -0
- data/lib/leaflet/src/control/Control.js +107 -0
- data/lib/leaflet/src/copyright.js +4 -0
- data/lib/leaflet/src/core/Browser.js +96 -0
- data/lib/leaflet/src/core/Class.js +106 -0
- data/lib/leaflet/src/core/Events.js +174 -0
- data/lib/leaflet/src/core/Handler.js +28 -0
- data/lib/leaflet/src/core/Util.js +182 -0
- data/lib/leaflet/src/dom/DomEvent.DoubleTap.js +103 -0
- data/lib/leaflet/src/dom/DomEvent.MsTouch.js +146 -0
- data/lib/leaflet/src/dom/DomEvent.js +211 -0
- data/lib/leaflet/src/dom/DomUtil.js +239 -0
- data/lib/leaflet/src/dom/Draggable.js +198 -0
- data/lib/leaflet/src/dom/PosAnimation.Timer.js +67 -0
- data/lib/leaflet/src/dom/PosAnimation.js +83 -0
- data/lib/leaflet/src/geo/LatLng.js +88 -0
- data/lib/leaflet/src/geo/LatLngBounds.js +153 -0
- data/lib/leaflet/src/geo/crs/CRS.EPSG3395.js +14 -0
- data/lib/leaflet/src/geo/crs/CRS.EPSG3857.js +21 -0
- data/lib/leaflet/src/geo/crs/CRS.EPSG4326.js +10 -0
- data/lib/leaflet/src/geo/crs/CRS.Simple.js +12 -0
- data/lib/leaflet/src/geo/crs/CRS.js +27 -0
- data/lib/leaflet/src/geo/projection/Projection.LonLat.js +13 -0
- data/lib/leaflet/src/geo/projection/Projection.Mercator.js +56 -0
- data/lib/leaflet/src/geo/projection/Projection.SphericalMercator.js +27 -0
- data/lib/leaflet/src/geo/projection/Projection.js +5 -0
- data/lib/leaflet/src/geometry/Bounds.js +95 -0
- data/lib/leaflet/src/geometry/LineUtil.js +202 -0
- data/lib/leaflet/src/geometry/Point.js +119 -0
- data/lib/leaflet/src/geometry/PolyUtil.js +55 -0
- data/lib/leaflet/src/geometry/Transformation.js +31 -0
- data/lib/leaflet/src/images/marker.svg +1 -0
- data/lib/leaflet/src/layer/FeatureGroup.js +81 -0
- data/lib/leaflet/src/layer/GeoJSON.js +245 -0
- data/lib/leaflet/src/layer/ImageOverlay.js +132 -0
- data/lib/leaflet/src/layer/LayerGroup.js +110 -0
- data/lib/leaflet/src/layer/Popup.js +316 -0
- data/lib/leaflet/src/layer/marker/DivIcon.js +43 -0
- data/lib/leaflet/src/layer/marker/Icon.Default.js +51 -0
- data/lib/leaflet/src/layer/marker/Icon.js +101 -0
- data/lib/leaflet/src/layer/marker/Marker.Drag.js +66 -0
- data/lib/leaflet/src/layer/marker/Marker.Popup.js +72 -0
- data/lib/leaflet/src/layer/marker/Marker.js +275 -0
- data/lib/leaflet/src/layer/tile/TileLayer.Anim.js +117 -0
- data/lib/leaflet/src/layer/tile/TileLayer.Canvas.js +60 -0
- data/lib/leaflet/src/layer/tile/TileLayer.WMS.js +83 -0
- data/lib/leaflet/src/layer/tile/TileLayer.js +578 -0
- data/lib/leaflet/src/layer/vector/Circle.js +98 -0
- data/lib/leaflet/src/layer/vector/CircleMarker.js +33 -0
- data/lib/leaflet/src/layer/vector/MultiPoly.js +47 -0
- data/lib/leaflet/src/layer/vector/Path.Popup.js +65 -0
- data/lib/leaflet/src/layer/vector/Path.SVG.js +219 -0
- data/lib/leaflet/src/layer/vector/Path.VML.js +125 -0
- data/lib/leaflet/src/layer/vector/Path.js +115 -0
- data/lib/leaflet/src/layer/vector/Polygon.js +81 -0
- data/lib/leaflet/src/layer/vector/Polyline.js +164 -0
- data/lib/leaflet/src/layer/vector/Rectangle.js +27 -0
- data/lib/leaflet/src/layer/vector/canvas/Circle.Canvas.js +18 -0
- data/lib/leaflet/src/layer/vector/canvas/Path.Canvas.js +196 -0
- data/lib/leaflet/src/layer/vector/canvas/Polygon.Canvas.js +37 -0
- data/lib/leaflet/src/layer/vector/canvas/Polyline.Canvas.js +30 -0
- data/lib/leaflet/src/map/Map.js +743 -0
- data/lib/leaflet/src/map/anim/Map.PanAnimation.js +88 -0
- data/lib/leaflet/src/map/anim/Map.ZoomAnimation.js +90 -0
- data/lib/leaflet/src/map/ext/Map.Geolocation.js +91 -0
- data/lib/leaflet/src/map/handler/Map.BoxZoom.js +104 -0
- data/lib/leaflet/src/map/handler/Map.DoubleClickZoom.js +23 -0
- data/lib/leaflet/src/map/handler/Map.Drag.js +146 -0
- data/lib/leaflet/src/map/handler/Map.Keyboard.js +147 -0
- data/lib/leaflet/src/map/handler/Map.ScrollWheelZoom.js +56 -0
- data/lib/leaflet/src/map/handler/Map.TouchZoom.js +121 -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.png +0 -0
- data/vendor/assets/javascripts/leaflet.draw.js +39 -0
- data/vendor/assets/javascripts/leaflet.js +145 -0
- data/vendor/assets/javascripts/leaflet.label.js +9 -0
- data/vendor/assets/stylesheets/leaflet.css.erb +459 -0
- data/vendor/assets/stylesheets/leaflet.draw.css.erb +212 -0
- data/vendor/assets/stylesheets/leaflet.draw.ie.css +44 -0
- data/vendor/assets/stylesheets/leaflet.ie.css +51 -0
- data/vendor/assets/stylesheets/leaflet.label.css +33 -0
- metadata +317 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Leaflet debug page</title>
|
5
|
+
|
6
|
+
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
7
|
+
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
|
8
|
+
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
10
|
+
|
11
|
+
<link rel="stylesheet" href="../css/screen.css" />
|
12
|
+
|
13
|
+
<script type="text/javascript" src="../../build/deps.js"></script>
|
14
|
+
<script src="../leaflet-include.js"></script>
|
15
|
+
</head>
|
16
|
+
<body>
|
17
|
+
|
18
|
+
<div id="map"></div>
|
19
|
+
|
20
|
+
<script type="text/javascript">
|
21
|
+
|
22
|
+
var map = L.map('map', {
|
23
|
+
crs: L.CRS.Simple
|
24
|
+
}).setView([0, 0], 0);
|
25
|
+
|
26
|
+
L.polygon([
|
27
|
+
[-200, -50],
|
28
|
+
[-40, 250],
|
29
|
+
[200, 100]
|
30
|
+
]).addTo(map);
|
31
|
+
|
32
|
+
|
33
|
+
L.marker([-200, -200]).addTo(map);
|
34
|
+
L.marker([200, -200]).addTo(map);
|
35
|
+
L.marker([200, 200]).addTo(map);
|
36
|
+
L.marker([-200, 200]).addTo(map);
|
37
|
+
|
38
|
+
L.marker([0, 0]).addTo(map);
|
39
|
+
|
40
|
+
L.imageOverlay('http://leafletjs.com/docs/images/logo.png', [[0, 0], [73, 220]]).addTo(map);
|
41
|
+
|
42
|
+
|
43
|
+
</script>
|
44
|
+
</body>
|
45
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Leaflet debug page</title>
|
5
|
+
|
6
|
+
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
7
|
+
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="../css/screen.css" />
|
10
|
+
|
11
|
+
<script type="text/javascript" src="../../build/deps.js"></script>
|
12
|
+
<script src="../leaflet-include.js"></script>
|
13
|
+
</head>
|
14
|
+
<body>
|
15
|
+
|
16
|
+
<div id="map" style="width: 1024px; height: 440px; border: 1px solid #ccc"></div>
|
17
|
+
|
18
|
+
<script type="text/javascript">
|
19
|
+
var map = new L.Map('map', {crs: L.CRS.EPSG4326});
|
20
|
+
|
21
|
+
var bluemarble = new L.TileLayer.WMS("http://maps.opengeo.org/geowebcache/service/wms", {
|
22
|
+
layers: 'bluemarble',
|
23
|
+
attribution: "Data © NASA Blue Marble, image service by OpenGeo",
|
24
|
+
minZoom: 2,
|
25
|
+
maxZoom: 5
|
26
|
+
});
|
27
|
+
|
28
|
+
map.addLayer(bluemarble).fitWorld();
|
29
|
+
</script>
|
30
|
+
</body>
|
31
|
+
</html>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Leaflet debug page</title>
|
5
|
+
|
6
|
+
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
7
|
+
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="../css/screen.css" />
|
10
|
+
|
11
|
+
<script type="text/javascript" src="../../build/deps.js"></script>
|
12
|
+
<script src="../leaflet-include.js"></script>
|
13
|
+
</head>
|
14
|
+
<body>
|
15
|
+
|
16
|
+
<div id="map" style="width: 800px; height: 600px; border: 1px solid #ccc"></div>
|
17
|
+
|
18
|
+
<script type="text/javascript">
|
19
|
+
var map = new L.Map('map');
|
20
|
+
|
21
|
+
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/{styleId}/256/{z}/{x}/{y}.png',
|
22
|
+
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
23
|
+
cloudmade = new L.TileLayer(cloudmadeUrl, {styleId: 997, attribution: cloudmadeAttribution}),
|
24
|
+
cloudmade2 = new L.TileLayer(cloudmadeUrl, {styleId: 998, attribution: cloudmadeAttribution});
|
25
|
+
|
26
|
+
var nexrad = new L.TileLayer.WMS("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi", {
|
27
|
+
layers: 'nexrad-n0r-900913',
|
28
|
+
format: 'image/png',
|
29
|
+
transparent: true,
|
30
|
+
attribution: "Weather data © 2011 IEM Nexrad",
|
31
|
+
opacity: 0.4
|
32
|
+
});
|
33
|
+
|
34
|
+
var bounds = new L.LatLngBounds(new L.LatLng(32, -126), new L.LatLng(50, -64));
|
35
|
+
|
36
|
+
map.addLayer(cloudmade).addLayer(nexrad).fitBounds(bounds);
|
37
|
+
|
38
|
+
L.control.layers({"CM": cloudmade, "CM2": cloudmade2}, {"NexRad": nexrad}).addTo(map);
|
39
|
+
</script>
|
40
|
+
</body>
|
41
|
+
</html>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Leaflet debug page</title>
|
5
|
+
|
6
|
+
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
7
|
+
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="../css/screen.css" />
|
10
|
+
|
11
|
+
<script type="text/javascript" src="../../build/deps.js"></script>
|
12
|
+
<script src="../leaflet-include.js"></script>
|
13
|
+
</head>
|
14
|
+
<body>
|
15
|
+
|
16
|
+
<div id="map"></div>
|
17
|
+
|
18
|
+
<script type="text/javascript">
|
19
|
+
// Test that changing between layers with differing zoomlevels also updates
|
20
|
+
// the zoomlevels in the map + also
|
21
|
+
|
22
|
+
function getCloudMadeUrl(styleId) {
|
23
|
+
return 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/' + styleId + '/256/{z}/{x}/{y}.png';
|
24
|
+
}
|
25
|
+
|
26
|
+
var map = L.map('map').setView(L.latLng(50.5, 30.51), 0);
|
27
|
+
|
28
|
+
var cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
29
|
+
cloudmade = L.tileLayer(getCloudMadeUrl(997), {attribution: cloudmadeAttribution, minZoom: 0, maxZoom: 10}).addTo(map),
|
30
|
+
cloudmade2 = L.tileLayer(getCloudMadeUrl(998), {attribution: 'Hello world', minZoom: 5, maxZoom: 18});
|
31
|
+
|
32
|
+
L.control.layers({
|
33
|
+
'CloudMade Pale Dawn (5-18)': cloudmade2,
|
34
|
+
'CloudMade Fresh (0-10)': cloudmade
|
35
|
+
}).addTo(map);
|
36
|
+
|
37
|
+
L.control.scale().addTo(map);
|
38
|
+
|
39
|
+
for (var i = 0; i < 1000; i++) {
|
40
|
+
L.marker(getRandomLatLng(map)).addTo(map);
|
41
|
+
}
|
42
|
+
|
43
|
+
|
44
|
+
</script>
|
45
|
+
</body>
|
46
|
+
</html>
|
@@ -0,0 +1,88 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Leaflet debug page</title>
|
5
|
+
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
7
|
+
|
8
|
+
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
9
|
+
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
|
10
|
+
|
11
|
+
<link rel="stylesheet" href="../css/screen.css" />
|
12
|
+
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.js'></script>
|
13
|
+
|
14
|
+
<script>
|
15
|
+
L_PREFER_CANVAS = true;
|
16
|
+
$(document).ready(function() {
|
17
|
+
var map;
|
18
|
+
var myLayerGroup = new L.LayerGroup();
|
19
|
+
|
20
|
+
initmap();
|
21
|
+
|
22
|
+
|
23
|
+
function initmap() {
|
24
|
+
|
25
|
+
// set up the map
|
26
|
+
map = new L.Map('map');
|
27
|
+
|
28
|
+
// create the tile layer with correct attribution
|
29
|
+
var osmUrl = 'http://a.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
30
|
+
var osmAttrib = 'Map data © OpenStreetMap contributors';
|
31
|
+
var osm = new L.TileLayer(osmUrl, { minZoom: 1, maxZoom: 17, attribution: osmAttrib, detectRetina: true });
|
32
|
+
map.addLayer(osm);
|
33
|
+
map.fitBounds(new L.LatLngBounds([51,7],[51,7]));
|
34
|
+
drawTestLine();
|
35
|
+
|
36
|
+
|
37
|
+
};
|
38
|
+
|
39
|
+
function drawTestLine() {
|
40
|
+
var lat = 51;
|
41
|
+
var long = 7;
|
42
|
+
for (var i = 0; i < 50; i++) {
|
43
|
+
|
44
|
+
var myCircle = new L.Circle(new L.LatLng(lat, long),3);
|
45
|
+
myCircle.on('click',
|
46
|
+
function (e) {
|
47
|
+
popup = new L.Popup();
|
48
|
+
popup.setLatLng(this.getLatLng());
|
49
|
+
|
50
|
+
var popuptxt = "Hello!";
|
51
|
+
alert("I am the click function");
|
52
|
+
popup.setContent(popuptxt);
|
53
|
+
|
54
|
+
map.openPopup(popup);
|
55
|
+
|
56
|
+
|
57
|
+
});
|
58
|
+
myLayerGroup.addLayer(myCircle);
|
59
|
+
lat = lat + 0.0001;
|
60
|
+
long = long + 0.0001;
|
61
|
+
|
62
|
+
}
|
63
|
+
|
64
|
+
map.addLayer(myLayerGroup);
|
65
|
+
|
66
|
+
};
|
67
|
+
|
68
|
+
$("#b1").click(function() {
|
69
|
+
map.addLayer(myLayerGroup);
|
70
|
+
});
|
71
|
+
|
72
|
+
$("#b2").click(function() {
|
73
|
+
map.removeLayer(myLayerGroup);
|
74
|
+
});
|
75
|
+
|
76
|
+
});
|
77
|
+
</script>
|
78
|
+
|
79
|
+
<script src="../leaflet-include.js"></script>
|
80
|
+
</head>
|
81
|
+
<body>
|
82
|
+
<div id="map"></div>
|
83
|
+
<div id="buttons">
|
84
|
+
<button type="button" id="b1"> Add Layer</button>
|
85
|
+
<button type="button" id="b2"> Remove Layer</button>
|
86
|
+
</div>
|
87
|
+
</body>
|
88
|
+
</html>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Leaflet debug page</title>
|
5
|
+
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
7
|
+
|
8
|
+
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
9
|
+
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
|
10
|
+
|
11
|
+
<link rel="stylesheet" href="../css/screen.css" />
|
12
|
+
<script type="text/javascript" src="../../build/deps.js"></script>
|
13
|
+
<script src="../leaflet-include.js"></script>
|
14
|
+
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.js'></script>
|
15
|
+
</head>
|
16
|
+
<body>
|
17
|
+
|
18
|
+
<div id="map"></div>
|
19
|
+
<button id="foo">Click to add layer, then zoom out or in</button>
|
20
|
+
|
21
|
+
<script type="text/javascript">
|
22
|
+
|
23
|
+
var map = new L.Map('map', { center: new L.LatLng(45.50144, -122.67599), zoom: 4 });
|
24
|
+
|
25
|
+
var demoUrl='http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Average_Household_Size/MapServer/tile/{z}/{y}/{x}';
|
26
|
+
var demoMap = new L.TileLayer(demoUrl, { maxZoom: 19, attribution: 'Tiles: © Esri' });
|
27
|
+
|
28
|
+
map.addLayer(demoMap);
|
29
|
+
|
30
|
+
$('#foo').click(function() {
|
31
|
+
var topoUrl='http://server.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}';
|
32
|
+
var topoMap = new L.TileLayer(topoUrl, { maxZoom: 19, attribution: 'Tiles: © Esri' });
|
33
|
+
map.addLayer(topoMap);
|
34
|
+
topoMap.bringToBack();
|
35
|
+
});
|
36
|
+
</script>
|
37
|
+
</body>
|
38
|
+
</html>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Leaflet debug page</title>
|
5
|
+
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
7
|
+
|
8
|
+
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
9
|
+
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
|
10
|
+
|
11
|
+
<link rel="stylesheet" href="../css/screen.css" />
|
12
|
+
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.js'></script>
|
13
|
+
|
14
|
+
<script>
|
15
|
+
L_PREFER_CANVAS = true;
|
16
|
+
$(document).ready(function() {
|
17
|
+
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
18
|
+
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
19
|
+
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution});
|
20
|
+
|
21
|
+
var map = L.map('map', {
|
22
|
+
minZoom: 1,
|
23
|
+
maxZoom: 19,
|
24
|
+
center: [51.505, -0.09],
|
25
|
+
zoom: 9,
|
26
|
+
layers: [cloudmade]
|
27
|
+
});
|
28
|
+
|
29
|
+
var polygons = new L.FeatureGroup();
|
30
|
+
var points = [[51.505, -0.01], [51.505, -0.09], [51.55, -0.09]];
|
31
|
+
|
32
|
+
polygons.addLayer(
|
33
|
+
new L.Polyline(
|
34
|
+
points, {
|
35
|
+
weight: 10,
|
36
|
+
opacity: 1,
|
37
|
+
smoothFactor: 1,
|
38
|
+
color: 'red',
|
39
|
+
clickable:true
|
40
|
+
}));
|
41
|
+
|
42
|
+
polygons.on('click', function(m) {
|
43
|
+
// m.layer is the clicked polygon here
|
44
|
+
//m.layer.bindPopup('hello!').openPopup();
|
45
|
+
console.log(m.layer)
|
46
|
+
});
|
47
|
+
|
48
|
+
polygons.addTo(map);
|
49
|
+
});
|
50
|
+
</script>
|
51
|
+
|
52
|
+
|
53
|
+
<script type="text/javascript" src="../../build/deps.js"></script>
|
54
|
+
<script src="../leaflet-include.js"></script>
|
55
|
+
</head>
|
56
|
+
<body>
|
57
|
+
<div id="map"></div>
|
58
|
+
</body>
|
59
|
+
</html>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Leaflet debug page</title>
|
5
|
+
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
7
|
+
|
8
|
+
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.css" />
|
9
|
+
<link rel="stylesheet" href="../css/screen.css" />
|
10
|
+
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.0.js'></script>
|
11
|
+
|
12
|
+
<script>
|
13
|
+
L_PREFER_CANVAS = true;
|
14
|
+
$(document).ready(function() {
|
15
|
+
var map = L.map('map', {
|
16
|
+
minZoom: 1,
|
17
|
+
maxZoom: 19,
|
18
|
+
center: [51.505, -0.09],
|
19
|
+
zoom: 9
|
20
|
+
});
|
21
|
+
|
22
|
+
var polygons = new L.FeatureGroup();
|
23
|
+
var points = [[51.505, -0.01], [51.505, -0.09], [51.55, -0.09]];
|
24
|
+
|
25
|
+
polygons.addLayer(
|
26
|
+
new L.Polyline(
|
27
|
+
points, {
|
28
|
+
weight: 2,
|
29
|
+
opacity: 1,
|
30
|
+
smoothFactor: 1,
|
31
|
+
color: 'red'
|
32
|
+
}));
|
33
|
+
|
34
|
+
polygons.on('click', function(m) {
|
35
|
+
// m.layer is the clicked polygon here
|
36
|
+
//m.layer.bindPopup('hello!').openPopup();
|
37
|
+
console.log(m.layer)
|
38
|
+
});
|
39
|
+
|
40
|
+
polygons.addTo(map);
|
41
|
+
});
|
42
|
+
</script>
|
43
|
+
|
44
|
+
<script src="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.js"></script>
|
45
|
+
</head>
|
46
|
+
<body>
|
47
|
+
<div id="map"></div>
|
48
|
+
</body>
|
49
|
+
</html>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Leaflet debug page</title>
|
5
|
+
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
7
|
+
|
8
|
+
<link rel="stylesheet" href="../../dist/leaflet.css" />
|
9
|
+
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
|
10
|
+
|
11
|
+
<link rel="stylesheet" href="../css/mobile.css" />
|
12
|
+
<style>
|
13
|
+
.mybox {
|
14
|
+
background-color: red;
|
15
|
+
}
|
16
|
+
|
17
|
+
</style>
|
18
|
+
<script type="text/javascript" src="../../build/deps.js"></script>
|
19
|
+
<script src="../leaflet-include.js"></script>
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
|
23
|
+
<div id="map"></div>
|
24
|
+
|
25
|
+
<script type="text/javascript">
|
26
|
+
|
27
|
+
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/d4fc77ea4a63471cab2423e66626cbb6/997/256/{z}/{x}/{y}.png',
|
28
|
+
cloudmadeAttribution = 'Map data © 2011 OpenStreetMap contributors, Imagery © 2011 CloudMade',
|
29
|
+
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttribution}),
|
30
|
+
latlng = new L.LatLng(50.5, 30.51);
|
31
|
+
|
32
|
+
var map = new L.Map('map', {center: latlng, zoom: 15, layers: [cloudmade]});
|
33
|
+
|
34
|
+
//Create a marker, clicking it toggles opacity
|
35
|
+
var marker = new L.Marker(latlng, { icon: new L.DivIcon({ className: 'mybox', iconSize: new L.Point(100,100), html: 'opaque. click to toggle' }) });
|
36
|
+
map.addLayer(marker);
|
37
|
+
|
38
|
+
var visible = true;
|
39
|
+
marker.on('click', function () {
|
40
|
+
if (visible) {
|
41
|
+
marker.setOpacity(0.3);
|
42
|
+
marker._icon.innerHTML = 'transparent';
|
43
|
+
} else {
|
44
|
+
marker.setOpacity(1);
|
45
|
+
marker._icon.innerHTML = 'opaque';
|
46
|
+
}
|
47
|
+
visible = !visible;
|
48
|
+
});
|
49
|
+
|
50
|
+
var marker2 = new L.Marker(new L.LatLng(50.5, 30.52));
|
51
|
+
map.addLayer(marker2);
|
52
|
+
marker2.bindPopup('This is an amazing message. I shouldn\'t of deleted the Ipsum text');
|
53
|
+
|
54
|
+
|
55
|
+
</script>
|
56
|
+
</body>
|
57
|
+
</html>
|