leaflet-js 0.6.beta4 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. checksums.yaml +6 -14
  2. data/CHANGELOG.rdoc +3 -0
  3. data/leaflet-js.gemspec +2 -2
  4. data/lib/leaflet.draw/CHANGELOG.md +45 -0
  5. data/lib/leaflet.draw/README.md +70 -23
  6. data/lib/leaflet.draw/build/deps.js +1 -0
  7. data/lib/leaflet.draw/dist/images/spritesheet-2x.png +0 -0
  8. data/lib/leaflet.draw/dist/images/spritesheet.png +0 -0
  9. data/lib/leaflet.draw/dist/leaflet.draw-src.js +489 -136
  10. data/lib/leaflet.draw/dist/leaflet.draw.css +34 -2
  11. data/lib/leaflet.draw/dist/leaflet.draw.ie.css +5 -0
  12. data/lib/leaflet.draw/dist/leaflet.draw.js +2 -2
  13. data/lib/leaflet.draw/examples/basic.html +14 -7
  14. data/lib/leaflet.draw/examples/libs/images/layers-2x.png +0 -0
  15. data/lib/leaflet.draw/examples/libs/images/layers.png +0 -0
  16. data/lib/leaflet.draw/examples/libs/images/marker-icon-2x.png +0 -0
  17. data/lib/leaflet.draw/examples/libs/leaflet-src.js +1129 -608
  18. data/lib/leaflet.draw/examples/libs/leaflet.css +85 -66
  19. data/lib/leaflet.draw/package.json +2 -2
  20. data/lib/leaflet.draw/spec/suites/DrawControlSpec.js +1 -1
  21. data/lib/leaflet.draw/spec/suites/GeometryUtilSpec.js +25 -0
  22. data/lib/leaflet.draw/spec/suites/LatLngUtilSpec.js +9 -0
  23. data/lib/leaflet.draw/src/Control.Draw.js +1 -0
  24. data/lib/leaflet.draw/src/Leaflet.draw.js +89 -1
  25. data/lib/leaflet.draw/src/Toolbar.js +2 -6
  26. data/lib/leaflet.draw/src/Tooltip.js +20 -7
  27. data/lib/leaflet.draw/src/draw/DrawToolbar.js +26 -22
  28. data/lib/leaflet.draw/src/draw/handler/Draw.Circle.js +11 -6
  29. data/lib/leaflet.draw/src/draw/handler/Draw.Feature.js +6 -2
  30. data/lib/leaflet.draw/src/draw/handler/Draw.Marker.js +7 -2
  31. data/lib/leaflet.draw/src/draw/handler/Draw.Polygon.js +29 -7
  32. data/lib/leaflet.draw/src/draw/handler/Draw.Polyline.js +44 -21
  33. data/lib/leaflet.draw/src/draw/handler/Draw.Rectangle.js +3 -3
  34. data/lib/leaflet.draw/src/draw/handler/Draw.SimpleShape.js +14 -1
  35. data/lib/leaflet.draw/src/edit/EditToolbar.js +86 -16
  36. data/lib/leaflet.draw/src/edit/handler/Edit.Poly.js +10 -7
  37. data/lib/leaflet.draw/src/edit/handler/Edit.SimpleShape.js +1 -2
  38. data/lib/leaflet.draw/src/edit/handler/EditToolbar.Delete.js +15 -3
  39. data/lib/leaflet.draw/src/edit/handler/EditToolbar.Edit.js +56 -38
  40. data/lib/leaflet.draw/src/ext/GeometryUtil.js +68 -0
  41. data/lib/leaflet.draw/src/images/spritesheet.svg +41 -0
  42. data/lib/leaflet.label/CHANGELOG.md +32 -0
  43. data/lib/leaflet.label/README.md +21 -4
  44. data/lib/leaflet.label/build/build.js +2 -2
  45. data/lib/leaflet.label/build/deps.js +2 -0
  46. data/lib/leaflet.label/build/hintrc.js +4 -0
  47. data/lib/leaflet.label/dist/leaflet.label-src.js +266 -83
  48. data/lib/leaflet.label/dist/leaflet.label.css +23 -4
  49. data/lib/leaflet.label/dist/leaflet.label.js +1 -1
  50. data/lib/leaflet.label/example/label.html +6 -3
  51. data/lib/leaflet.label/libs/leaflet/images/layers-2x.png +0 -0
  52. data/lib/leaflet.label/libs/leaflet/images/layers.png +0 -0
  53. data/lib/leaflet.label/libs/leaflet/images/marker-icon-2x.png +0 -0
  54. data/lib/leaflet.label/libs/leaflet/leaflet-src.js +1129 -608
  55. data/lib/leaflet.label/libs/leaflet/leaflet.css +85 -66
  56. data/lib/leaflet.label/libs/leaflet/leaflet.js +6 -5
  57. data/lib/leaflet.label/package.json +19 -0
  58. data/lib/leaflet.label/src/BaseMarkerMethods.js +129 -0
  59. data/lib/leaflet.label/src/CircleMarker.Label.js +7 -0
  60. data/lib/leaflet.label/src/Label.js +161 -37
  61. data/lib/leaflet.label/src/Leaflet.label.js +1 -1
  62. data/lib/leaflet.label/src/Map.Label.js +0 -2
  63. data/lib/leaflet.label/src/Marker.Label.js +15 -120
  64. data/lib/leaflet.label/src/Path.Label.js +11 -11
  65. data/lib/leaflet/CHANGELOG.md +299 -31
  66. data/lib/leaflet/CONTRIBUTING.md +3 -3
  67. data/lib/leaflet/FAQ.md +138 -0
  68. data/lib/leaflet/Jakefile.js +24 -4
  69. data/lib/leaflet/PLUGIN-GUIDE.md +127 -0
  70. data/lib/leaflet/README.md +10 -6
  71. data/lib/leaflet/build/build.html +3 -19
  72. data/lib/leaflet/build/build.js +21 -51
  73. data/lib/leaflet/build/deps.js +10 -7
  74. data/lib/leaflet/build/hintrc.js +6 -4
  75. data/lib/leaflet/debug/hacks/jitter.html +0 -1
  76. data/lib/leaflet/debug/map/canvas.html +11 -12
  77. data/lib/leaflet/debug/map/controls.html +3 -4
  78. data/lib/leaflet/debug/map/geolocation.html +0 -1
  79. data/lib/leaflet/debug/map/iframe.html +11 -0
  80. data/lib/leaflet/debug/map/image-overlay.html +0 -1
  81. data/lib/leaflet/debug/map/map-mobile.html +0 -1
  82. data/lib/leaflet/debug/map/map.html +1 -2
  83. data/lib/leaflet/debug/map/max-bounds.html +2 -1
  84. data/lib/leaflet/debug/map/opacity.html +223 -0
  85. data/lib/leaflet/debug/map/scroll.html +6 -1
  86. data/lib/leaflet/debug/map/simple-proj.html +0 -1
  87. data/lib/leaflet/debug/map/wms-marble.html +4 -5
  88. data/lib/leaflet/debug/map/wms.html +0 -1
  89. data/lib/leaflet/debug/map/zoomlevels.html +0 -1
  90. data/lib/leaflet/debug/tests/add_remove_layers.html +5 -6
  91. data/lib/leaflet/debug/tests/bringtoback.html +0 -1
  92. data/lib/leaflet/debug/tests/canvasloop.html +47 -0
  93. data/lib/leaflet/debug/tests/click_on_canvas.html +0 -1
  94. data/lib/leaflet/debug/tests/dragging_and_copyworldjump.html +61 -0
  95. data/lib/leaflet/debug/tests/opacity.html +0 -1
  96. data/lib/leaflet/debug/tests/popupcontextmenuclicks.html +59 -0
  97. data/lib/leaflet/debug/tests/remove_while_dragging.html +4 -5
  98. data/lib/leaflet/debug/tests/removetilewhilepan.html +0 -1
  99. data/lib/leaflet/debug/tests/reuse_popups.html +0 -1
  100. data/lib/leaflet/debug/tests/rtl.html +42 -0
  101. data/lib/leaflet/debug/tests/rtl2.html +27 -0
  102. data/lib/leaflet/debug/tests/set_icon_reuse_dom.html +43 -0
  103. data/lib/leaflet/debug/tests/svg_clicks.html +3 -4
  104. data/lib/leaflet/debug/vector/bounds-extend.html +0 -1
  105. data/lib/leaflet/debug/vector/feature-group-bounds.html +0 -1
  106. data/lib/leaflet/debug/vector/geojson.html +0 -1
  107. data/lib/leaflet/debug/vector/rectangle.html +0 -1
  108. data/lib/leaflet/debug/vector/touchzoomemu.html +2 -3
  109. data/lib/leaflet/debug/vector/vector-bounds.html +0 -1
  110. data/lib/leaflet/debug/vector/vector-canvas.html +0 -1
  111. data/lib/leaflet/debug/vector/vector-mobile.html +0 -1
  112. data/lib/leaflet/debug/vector/vector-simple.html +0 -1
  113. data/lib/leaflet/debug/vector/vector.html +0 -1
  114. data/lib/leaflet/dist/images/layers-2x.png +0 -0
  115. data/lib/leaflet/dist/images/layers.png +0 -0
  116. data/lib/leaflet/dist/leaflet.css +85 -66
  117. data/lib/leaflet/package.json +25 -20
  118. data/lib/leaflet/spec/after.js +1 -1
  119. data/lib/leaflet/spec/index.html +21 -13
  120. data/lib/leaflet/spec/karma.conf.js +51 -50
  121. data/lib/leaflet/spec/spec.hintrc.js +25 -0
  122. data/lib/leaflet/spec/suites/LeafletSpec.js +2 -2
  123. data/lib/leaflet/spec/suites/SpecHelper.js +37 -21
  124. data/lib/leaflet/spec/suites/control/Control.LayersSpec.js +1 -1
  125. data/lib/leaflet/spec/suites/core/ClassSpec.js +12 -12
  126. data/lib/leaflet/spec/suites/core/EventsSpec.js +74 -18
  127. data/lib/leaflet/spec/suites/core/UtilSpec.js +69 -25
  128. data/lib/leaflet/spec/suites/dom/DomEventSpec.js +16 -16
  129. data/lib/leaflet/spec/suites/dom/DomUtilSpec.js +9 -16
  130. data/lib/leaflet/spec/suites/dom/PosAnimationSpec.js +27 -0
  131. data/lib/leaflet/spec/suites/geo/CRSSpec.js +47 -0
  132. data/lib/leaflet/spec/suites/geo/LatLngBoundsSpec.js +22 -14
  133. data/lib/leaflet/spec/suites/geo/LatLngSpec.js +22 -8
  134. data/lib/leaflet/spec/suites/geo/ProjectionSpec.js +21 -20
  135. data/lib/leaflet/spec/suites/geometry/BoundsSpec.js +15 -15
  136. data/lib/leaflet/spec/suites/geometry/PointSpec.js +12 -12
  137. data/lib/leaflet/spec/suites/geometry/TransformationSpec.js +4 -4
  138. data/lib/leaflet/spec/suites/layer/FeatureGroupSpec.js +59 -9
  139. data/lib/leaflet/spec/suites/layer/GeoJSONSpec.js +213 -17
  140. data/lib/leaflet/spec/suites/layer/LayerGroupSpec.js +6 -6
  141. data/lib/leaflet/spec/suites/layer/PopupSpec.js +65 -5
  142. data/lib/leaflet/spec/suites/layer/TileLayerSpec.js +16 -15
  143. data/lib/leaflet/spec/suites/layer/marker/MarkerSpec.js +94 -0
  144. data/lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js +7 -7
  145. data/lib/leaflet/spec/suites/layer/vector/PolygonSpec.js +38 -2
  146. data/lib/leaflet/spec/suites/layer/vector/PolylineGeometrySpec.js +4 -4
  147. data/lib/leaflet/spec/suites/layer/vector/PolylineSpec.js +2 -2
  148. data/lib/leaflet/spec/suites/map/MapSpec.js +318 -26
  149. data/lib/leaflet/spec/suites/map/handler/Map.DragSpec.js +38 -0
  150. data/lib/leaflet/src/Leaflet.js +2 -2
  151. data/lib/leaflet/src/control/Control.Attribution.js +6 -0
  152. data/lib/leaflet/src/control/Control.Layers.js +33 -24
  153. data/lib/leaflet/src/control/Control.Zoom.js +12 -4
  154. data/lib/leaflet/src/control/Control.js +10 -0
  155. data/lib/leaflet/src/copyright.js +2 -1
  156. data/lib/leaflet/src/core/Browser.js +11 -10
  157. data/lib/leaflet/src/core/Events.js +15 -11
  158. data/lib/leaflet/src/core/Util.js +19 -14
  159. data/lib/leaflet/src/dom/DomEvent.DoubleTap.js +13 -12
  160. data/lib/leaflet/src/dom/DomEvent.Pointer.js +155 -0
  161. data/lib/leaflet/src/dom/DomEvent.js +57 -19
  162. data/lib/leaflet/src/dom/DomUtil.js +89 -34
  163. data/lib/leaflet/src/dom/Draggable.js +26 -89
  164. data/lib/leaflet/src/dom/PosAnimation.js +13 -2
  165. data/lib/leaflet/src/geo/LatLng.js +16 -5
  166. data/lib/leaflet/src/geo/LatLngBounds.js +5 -2
  167. data/lib/leaflet/src/geo/crs/CRS.EPSG3395.js +2 -2
  168. data/lib/leaflet/src/geo/crs/CRS.js +5 -0
  169. data/lib/leaflet/src/geo/projection/Projection.Mercator.js +3 -3
  170. data/lib/leaflet/src/geometry/LineUtil.js +2 -2
  171. data/lib/leaflet/src/images/layers.svg +8 -0
  172. data/lib/leaflet/src/images/marker.svg +61 -1
  173. data/lib/leaflet/src/layer/FeatureGroup.js +24 -7
  174. data/lib/leaflet/src/layer/GeoJSON.js +97 -56
  175. data/lib/leaflet/src/layer/ImageOverlay.js +9 -0
  176. data/lib/leaflet/src/layer/LayerGroup.js +8 -3
  177. data/lib/leaflet/src/layer/Popup.js +56 -34
  178. data/lib/leaflet/src/layer/marker/DivIcon.js +4 -2
  179. data/lib/leaflet/src/layer/marker/Icon.Default.js +1 -1
  180. data/lib/leaflet/src/layer/marker/Icon.js +15 -18
  181. data/lib/leaflet/src/layer/marker/Marker.Drag.js +7 -5
  182. data/lib/leaflet/src/layer/marker/Marker.Popup.js +22 -5
  183. data/lib/leaflet/src/layer/marker/Marker.js +75 -32
  184. data/lib/leaflet/src/layer/tile/TileLayer.Anim.js +14 -26
  185. data/lib/leaflet/src/layer/tile/TileLayer.Canvas.js +7 -6
  186. data/lib/leaflet/src/layer/tile/TileLayer.WMS.js +14 -10
  187. data/lib/leaflet/src/layer/tile/TileLayer.js +53 -32
  188. data/lib/leaflet/src/layer/vector/CircleMarker.js +11 -0
  189. data/lib/leaflet/src/layer/vector/MultiPoly.js +10 -0
  190. data/lib/leaflet/src/layer/vector/Path.SVG.js +14 -3
  191. data/lib/leaflet/src/layer/vector/Path.VML.js +12 -2
  192. data/lib/leaflet/src/layer/vector/Path.js +7 -3
  193. data/lib/leaflet/src/layer/vector/Polygon.js +14 -3
  194. data/lib/leaflet/src/layer/vector/canvas/CircleMarker.Canvas.js +9 -0
  195. data/lib/leaflet/src/layer/vector/canvas/Path.Canvas.js +1 -0
  196. data/lib/leaflet/src/map/Map.js +192 -125
  197. data/lib/leaflet/src/map/anim/Map.PanAnimation.js +29 -19
  198. data/lib/leaflet/src/map/anim/Map.ZoomAnimation.js +21 -9
  199. data/lib/leaflet/src/map/ext/Map.Geolocation.js +11 -4
  200. data/lib/leaflet/src/map/handler/Map.BoxZoom.js +26 -12
  201. data/lib/leaflet/src/map/handler/Map.DoubleClickZoom.js +10 -3
  202. data/lib/leaflet/src/map/handler/Map.Drag.js +12 -6
  203. data/lib/leaflet/src/map/handler/Map.Keyboard.js +5 -2
  204. data/lib/leaflet/src/map/handler/Map.ScrollWheelZoom.js +7 -1
  205. data/lib/leaflet/src/map/handler/Map.Tap.js +107 -0
  206. data/lib/leaflet/src/map/handler/Map.TouchZoom.js +9 -3
  207. data/vendor/assets/images/layers-2x.png +0 -0
  208. data/vendor/assets/images/layers.png +0 -0
  209. data/vendor/assets/images/spritesheet-2x.png +0 -0
  210. data/vendor/assets/images/spritesheet.png +0 -0
  211. data/vendor/assets/javascripts/leaflet.draw.js +2 -4
  212. data/vendor/assets/javascripts/leaflet.js +3 -1
  213. data/vendor/assets/javascripts/leaflet.label.js +2 -0
  214. data/vendor/assets/stylesheets/leaflet.css.erb +337 -318
  215. data/vendor/assets/stylesheets/leaflet.draw.css.erb +35 -3
  216. data/vendor/assets/stylesheets/leaflet.draw.ie.css +5 -0
  217. data/vendor/assets/stylesheets/leaflet.label.css +23 -4
  218. metadata +40 -14
  219. data/lib/leaflet.draw/examples/libs/leaflet.ie.css +0 -51
  220. data/lib/leaflet.label/libs/leaflet/leaflet.ie.css +0 -51
  221. data/lib/leaflet/dist/leaflet-src.js +0 -8579
  222. data/lib/leaflet/dist/leaflet.ie.css +0 -51
  223. data/lib/leaflet/dist/leaflet.js +0 -8
  224. data/lib/leaflet/spec/happen.js +0 -93
  225. data/lib/leaflet/src/dom/DomEvent.MsTouch.js +0 -146
  226. data/vendor/assets/stylesheets/leaflet.ie.css +0 -51
@@ -4,10 +4,9 @@
4
4
  <title>Leaflet debug page</title>
5
5
 
6
6
  <link rel="stylesheet" href="../../dist/leaflet.css" />
7
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
8
-
7
+
9
8
  <link rel="stylesheet" href="../css/screen.css" />
10
-
9
+
11
10
  <script type="text/javascript" src="../../build/deps.js"></script>
12
11
  <script src="../leaflet-include.js"></script>
13
12
  </head>
@@ -18,18 +17,18 @@
18
17
  <script type="text/javascript">
19
18
 
20
19
  var tiles = new L.TileLayer.Canvas();
21
-
20
+
22
21
  tiles.drawTile = function(canvas, tile, zoom) {
23
22
  var ctx = canvas.getContext('2d');
24
-
23
+
25
24
  ctx.fillStyle = 'white';
26
25
  ctx.fillRect(0, 0, 255, 255);
27
-
28
-
26
+
27
+
29
28
  ctx.fillStyle = 'black';
30
29
  ctx.fillText('x: ' + tile.x + ', y: ' + tile.y + ', zoom:' + zoom, 20, 20);
31
-
32
-
30
+
31
+
33
32
  ctx.strokeStyle = 'red';
34
33
  ctx.beginPath();
35
34
  ctx.moveTo(0, 0);
@@ -39,9 +38,9 @@
39
38
  ctx.closePath();
40
39
  ctx.stroke();
41
40
  }
42
-
41
+
43
42
  var map = new L.Map('map', {center: new L.LatLng(50.5, 30.51), zoom: 15, layers: [tiles]});
44
-
43
+
45
44
  </script>
46
45
  </body>
47
- </html>
46
+ </html>
@@ -4,7 +4,6 @@
4
4
  <title>Leaflet debug page</title>
5
5
 
6
6
  <link rel="stylesheet" href="../../dist/leaflet.css" />
7
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
8
7
 
9
8
  <link rel="stylesheet" href="../css/screen.css" />
10
9
 
@@ -25,11 +24,11 @@
25
24
  cloudmade = new L.TileLayer(getCloudMadeUrl(997), {attribution: cloudmadeAttribution}),
26
25
  cloudmade2 = new L.TileLayer(getCloudMadeUrl(998), {attribution: 'Hello world'});
27
26
 
28
- var map = new L.Map('map').addLayer(cloudmade).setView(new L.LatLng(50.5, 30.51), 15);
27
+ var map = new L.Map('map').addLayer(cloudmade).setView(new L.LatLng(50.5, 30.512), 15);
29
28
 
30
- var marker = new L.CircleMarker(new L.LatLng(50.5, 30.505), {color: 'red'});
29
+ var marker = new L.Marker(new L.LatLng(50.5, 30.505), {color: 'red'});
31
30
  map.addLayer(marker);
32
- marker.bindPopup("Hello World").openPopup();
31
+ marker.bindPopup("Leaflet is designed with simplicity, performance and usability in mind. It works efficiently across all major desktop and mobile platforms out of the box, taking advantage of HTML5 and CSS3 on modern browsers while still being accessible on older ones.").openPopup();
33
32
 
34
33
  var marker2 = new L.Marker(new L.LatLng(50.502, 30.515));
35
34
  map.addLayer(marker2);
@@ -4,7 +4,6 @@
4
4
  <title>Leaflet geolocation debug page</title>
5
5
 
6
6
  <link rel="stylesheet" href="../../dist/leaflet.css" />
7
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
8
7
 
9
8
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
9
 
@@ -0,0 +1,11 @@
1
+ <style>
2
+ iframe {
3
+ position: absolute;
4
+ top: 50px;
5
+ left: 50px;
6
+ width: 500px;
7
+ height: 500px;
8
+ }
9
+ </style>
10
+ <iframe src="map.html">
11
+ </iframe>
@@ -4,7 +4,6 @@
4
4
  <title>Leaflet debug page</title>
5
5
 
6
6
  <link rel="stylesheet" href="../../dist/leaflet.css" />
7
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
8
7
 
9
8
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
9
 
@@ -6,7 +6,6 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
7
7
 
8
8
  <link rel="stylesheet" href="../../dist/leaflet.css" />
9
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
10
9
 
11
10
  <link rel="stylesheet" href="../css/mobile.css" />
12
11
 
@@ -4,7 +4,6 @@
4
4
  <title>Leaflet debug page</title>
5
5
 
6
6
  <link rel="stylesheet" href="../../dist/leaflet.css" />
7
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
8
7
 
9
8
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
9
 
@@ -22,7 +21,7 @@
22
21
 
23
22
  var cloudmade = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/997/256/{z}/{x}/{y}.png', {
24
23
  maxZoom: 18,
25
- attribution: 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
24
+ attribution: 'Map data &copy; 2011 <a href="#">OpenStreetMap</a> contributors, Imagery &copy; 2011 <a href="#">CloudMade</a>',
26
25
  key: 'd4fc77ea4a63471cab2423e66626cbb6'
27
26
  });
28
27
 
@@ -6,7 +6,6 @@
6
6
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
7
7
 
8
8
  <link rel="stylesheet" href="../../dist/leaflet.css" />
9
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
10
9
 
11
10
  <link rel="stylesheet" href="../css/mobile.css" />
12
11
 
@@ -31,6 +30,8 @@
31
30
  maxBounds: bounds
32
31
  });
33
32
 
33
+ var latlngs = L.rectangle(bounds).getLatLngs();
34
+ L.polyline(latlngs.concat([latlngs[0]])).addTo(map);
34
35
 
35
36
  </script>
36
37
  </body>
@@ -0,0 +1,223 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Leaflet debug page</title>
5
+
6
+ <link rel="stylesheet" href="../../dist/leaflet.css" />
7
+
8
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+
10
+ <link rel="stylesheet" href="../css/screen.css" />
11
+
12
+ <script type="text/javascript" src="../../build/deps.js"></script>
13
+ <script src="../leaflet-include.js"></script>
14
+ <style>
15
+ .mapcontainer {
16
+ float:left;
17
+ position: relative;
18
+ width: 32%;
19
+ font-size: 12px;
20
+ font-family: sans-serif;
21
+ height: 340px;
22
+ margin-bottom: 15px;
23
+ background-color: #eee;
24
+ margin-right: 1%;
25
+ }
26
+
27
+ .map {
28
+ position: absolute;
29
+ width: 100%;
30
+ height: 280px;
31
+ bottom: 0px;
32
+ }
33
+ </style>
34
+ </head>
35
+ <body>
36
+ <p>These should all render identically.</p>
37
+ <div class="mapcontainer">
38
+ CASE 1: no opacity set on any layers
39
+ <br />
40
+ <div id="map1" class="map"></div>
41
+ </div>
42
+ <div class="mapcontainer">
43
+ CASE 2: opacity set to .99 on overlays but not on basemap
44
+ <br />
45
+ <div id="map2" class="map"></div>
46
+ </div>
47
+ <div class="mapcontainer">
48
+ CASE 3: opacity set on overlays but not on basemap, zIndex option set to 0 on basemap
49
+ <br />
50
+ <div id="map3" class="map"></div>
51
+ </div>
52
+ <div class="mapcontainer">
53
+ CASE 4: opacity set to .99 on overlays but set to 1 on basemap
54
+ <br />
55
+ <div id="map4" class="map"></div>
56
+ </div>
57
+ <div class="mapcontainer">
58
+ CASE 5: opacity set to .99 on all layers
59
+ <br />
60
+ <div id="map5" class="map"></div>
61
+ </div>
62
+ <div class="mapcontainer">
63
+ CASE 6: opacity set to .99 on 1st and 3rd layers and 1 on middle layer
64
+ <br />
65
+ <div id="map6" class="map"></div>
66
+ </div>
67
+
68
+ <script type="text/javascript">
69
+ var mapopts = {
70
+ center: [35, -122],
71
+ zoom : 5
72
+ };
73
+
74
+ var map1 = L.map('map1', mapopts);
75
+ var map2 = L.map('map2', mapopts);
76
+ var map3 = L.map('map3', mapopts);
77
+ var map4 = L.map('map4', mapopts);
78
+ var map5 = L.map('map5', mapopts);
79
+ var map6 = L.map('map6', mapopts);
80
+
81
+ /**********
82
+ CASE 1: no opacity set on any layers
83
+ **********/
84
+ // OSM Basemap
85
+ var osm1 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
86
+ attribution: '',
87
+ key: 'BC9A493B41014CAABB98F0471D759707',
88
+ styleId: 97941
89
+ }).addTo(map1);
90
+
91
+ // EEZs / Nations
92
+ var eez1 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
93
+ tms: true
94
+ }).addTo(map1);
95
+
96
+ // Marine Protected Areas overlay
97
+ var mpa1 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
98
+ tms: false
99
+ }).addTo(map1);
100
+
101
+
102
+ /**********
103
+ CASE 2: opacity set on overlays but not on basemap
104
+ **********/
105
+ // OSM Basemap
106
+ var osm2 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
107
+ attribution: '',
108
+ key: 'BC9A493B41014CAABB98F0471D759707',
109
+ styleId: 97941
110
+ }).addTo(map2);
111
+
112
+ // EEZs / Nations
113
+ var eez2 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
114
+ tms: true,
115
+ opacity: 0.99
116
+ }).addTo(map2);
117
+
118
+ // Marine Protected Areas overlay
119
+ var mpa2 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
120
+ tms: false,
121
+ opacity: 0.99
122
+ }).addTo(map2);
123
+
124
+
125
+ /**********
126
+ CASE 3: opacity set on overlays but not on basemap, zIndex option set to 0 on basemap
127
+ **********/
128
+ // OSM Basemap
129
+ var osm3 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
130
+ attribution: '',
131
+ key: 'BC9A493B41014CAABB98F0471D759707',
132
+ styleId: 97941,
133
+ zIndex: 0
134
+ }).addTo(map3);
135
+
136
+ // EEZs / Nations
137
+ var eez3 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
138
+ tms: true,
139
+ opacity: 0.99
140
+ }).addTo(map3);
141
+
142
+ // Marine Protected Areas overlay
143
+ var mpa3 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
144
+ tms: false,
145
+ opacity: 0.99
146
+ }).addTo(map3);
147
+
148
+
149
+ /**********
150
+ CASE 4: opacity set on overlays but set to 1 on basemap
151
+ **********/
152
+ // OSM Basemap
153
+ var osm4 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
154
+ attribution: '',
155
+ key: 'BC9A493B41014CAABB98F0471D759707',
156
+ styleId: 97941,
157
+ opacity: 1
158
+ }).addTo(map4);
159
+
160
+ // EEZs / Nations
161
+ var eez4 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
162
+ tms: true,
163
+ opacity: 0.99
164
+ }).addTo(map4);
165
+
166
+ // Marine Protected Areas overlay
167
+ var mpa4 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
168
+ tms: false,
169
+ opacity: 0.99
170
+ }).addTo(map4);
171
+
172
+
173
+ /**********
174
+ CASE 5: opacity set to .5 on all layers
175
+ **********/
176
+ // OSM Basemap
177
+ var osm5 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
178
+ attribution: '',
179
+ key: 'BC9A493B41014CAABB98F0471D759707',
180
+ styleId: 97941,
181
+ opacity: 0.99
182
+ }).addTo(map5);
183
+
184
+ // EEZs / Nations
185
+ var eez5 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
186
+ tms: true,
187
+ opacity: 0.99
188
+ }).addTo(map5);
189
+
190
+ // Marine Protected Areas overlay
191
+ var mpa5 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
192
+ tms: false,
193
+ opacity: 0.99
194
+ }).addTo(map5);
195
+
196
+
197
+ /**********
198
+ CASE 6: opacity set to .5 on 1st and 3rd layers and 1 on middle layer
199
+ **********/
200
+ // OSM Basemap
201
+ var osm6 = L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png?v=1', {
202
+ attribution: '',
203
+ key: 'BC9A493B41014CAABB98F0471D759707',
204
+ styleId: 97941,
205
+ opacity: 0.99
206
+ }).addTo(map6);
207
+
208
+ // EEZs / Nations
209
+ var eez6 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/eezs/{z}/{x}/{y}.png', {
210
+ tms: true,
211
+ opacity: 1
212
+ }).addTo(map6);
213
+
214
+ // Marine Protected Areas overlay
215
+ var mpa6 = new L.tileLayer('http://tile1.mpatlas.org/tilecache/mpas/{z}/{x}/{y}.png', {
216
+ tms: false,
217
+ opacity: 0.99
218
+ }).addTo(map6);
219
+
220
+
221
+ </script>
222
+ </body>
223
+ </html>
@@ -4,7 +4,6 @@
4
4
  <title>Leaflet debug page</title>
5
5
 
6
6
  <link rel="stylesheet" href="../../dist/leaflet.css" />
7
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
8
7
 
9
8
  <link rel="stylesheet" href="../css/screen.css" />
10
9
 
@@ -30,7 +29,13 @@
30
29
 
31
30
  var map = new L.Map('map', {center: latlng, zoom: 15, layers: [cloudmade]});
32
31
 
32
+ var s = '';
33
+ for (var i = 0; i < 100; i++) s += 'Test<br>';
33
34
 
35
+ var popup = L.popup({maxHeight: 100})
36
+ .setContent(s)
37
+ .setLatLng(latlng)
38
+ .openOn(map);
34
39
  </script>
35
40
  </body>
36
41
  </html>
@@ -4,7 +4,6 @@
4
4
  <title>Leaflet debug page</title>
5
5
 
6
6
  <link rel="stylesheet" href="../../dist/leaflet.css" />
7
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
8
7
 
9
8
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
9
 
@@ -4,10 +4,9 @@
4
4
  <title>Leaflet debug page</title>
5
5
 
6
6
  <link rel="stylesheet" href="../../dist/leaflet.css" />
7
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
8
-
7
+
9
8
  <link rel="stylesheet" href="../css/screen.css" />
10
-
9
+
11
10
  <script type="text/javascript" src="../../build/deps.js"></script>
12
11
  <script src="../leaflet-include.js"></script>
13
12
  </head>
@@ -17,7 +16,7 @@
17
16
 
18
17
  <script type="text/javascript">
19
18
  var map = new L.Map('map', {crs: L.CRS.EPSG4326});
20
-
19
+
21
20
  var bluemarble = new L.TileLayer.WMS("http://maps.opengeo.org/geowebcache/service/wms", {
22
21
  layers: 'bluemarble',
23
22
  attribution: "Data &copy; NASA Blue Marble, image service by OpenGeo",
@@ -28,4 +27,4 @@
28
27
  map.addLayer(bluemarble).fitWorld();
29
28
  </script>
30
29
  </body>
31
- </html>
30
+ </html>
@@ -4,7 +4,6 @@
4
4
  <title>Leaflet debug page</title>
5
5
 
6
6
  <link rel="stylesheet" href="../../dist/leaflet.css" />
7
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
8
7
 
9
8
  <link rel="stylesheet" href="../css/screen.css" />
10
9
 
@@ -4,7 +4,6 @@
4
4
  <title>Leaflet debug page</title>
5
5
 
6
6
  <link rel="stylesheet" href="../../dist/leaflet.css" />
7
- <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
8
7
 
9
8
  <link rel="stylesheet" href="../css/screen.css" />
10
9