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.
Files changed (341) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.rdoc +0 -10
  3. data/Rakefile +3 -3
  4. data/leaflet-js.gemspec +7 -13
  5. data/lib/leaflet-js.rb +10 -2
  6. data/lib/leaflet.draw/BREAKINGCHANGES.md +54 -0
  7. data/lib/leaflet.draw/CHANGELOG.md +130 -0
  8. data/lib/leaflet.draw/Jakefile.js +48 -0
  9. data/lib/leaflet.draw/MIT-LICENCE.txt +20 -0
  10. data/lib/leaflet.draw/README.md +427 -0
  11. data/lib/leaflet.draw/TODO.md +62 -0
  12. data/lib/leaflet.draw/build/build.html +243 -0
  13. data/lib/leaflet.draw/build/build.js +187 -0
  14. data/lib/leaflet.draw/build/deps.js +76 -0
  15. data/lib/leaflet.draw/build/hintrc.js +39 -0
  16. data/lib/leaflet.draw/build/leaflet.draw-include.js +42 -0
  17. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/dist/images/spritesheet-2x.png +0 -0
  18. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/dist/images/spritesheet.png +0 -0
  19. data/lib/leaflet.draw/dist/leaflet.draw-src.js +2872 -0
  20. data/lib/leaflet.draw/dist/leaflet.draw.css +295 -0
  21. data/lib/leaflet.draw/dist/leaflet.draw.js +10 -0
  22. data/lib/leaflet.draw/examples/basic.html +113 -0
  23. data/lib/leaflet.draw/examples/edithandlers.html +66 -0
  24. data/{vendor/assets/Leaflet/dist → lib/leaflet.draw/examples/libs}/images/layers-2x.png +0 -0
  25. data/{vendor/assets/Leaflet/dist → lib/leaflet.draw/examples/libs}/images/layers.png +0 -0
  26. data/{vendor/assets/Leaflet/dist → lib/leaflet.draw/examples/libs}/images/marker-icon-2x.png +0 -0
  27. data/{vendor/assets/Leaflet/dist → lib/leaflet.draw/examples/libs}/images/marker-icon.png +0 -0
  28. data/lib/leaflet.draw/examples/libs/images/marker-icon@2x.png +0 -0
  29. data/{vendor/assets/Leaflet/dist → lib/leaflet.draw/examples/libs}/images/marker-shadow.png +0 -0
  30. data/lib/leaflet.draw/examples/libs/leaflet-src.js +9191 -0
  31. data/{vendor/assets/leaflet.css.erb → lib/leaflet.draw/examples/libs/leaflet.css} +2 -2
  32. data/lib/leaflet.draw/package.json +40 -0
  33. data/lib/leaflet.draw/spec/after.js +2 -0
  34. data/lib/leaflet.draw/spec/before.js +3 -0
  35. data/lib/leaflet.draw/spec/expect.js +1253 -0
  36. data/lib/leaflet.draw/spec/happen.js +93 -0
  37. data/lib/leaflet.draw/spec/index.html +38 -0
  38. data/lib/leaflet.draw/spec/karma.conf.js +72 -0
  39. data/lib/leaflet.draw/spec/sinon.js +4223 -0
  40. data/lib/leaflet.draw/spec/spec.hintrc.js +25 -0
  41. data/lib/leaflet.draw/spec/suites/DrawControlSpec.js +14 -0
  42. data/lib/leaflet.draw/spec/suites/GeometryUtilSpec.js +25 -0
  43. data/lib/leaflet.draw/spec/suites/LatLngUtilSpec.js +11 -0
  44. data/lib/leaflet.draw/spec/suites/SpecHelper.js +28 -0
  45. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/Control.Draw.js +9 -9
  46. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/Leaflet.draw.js +1 -2
  47. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/Toolbar.js +0 -0
  48. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/Tooltip.js +0 -0
  49. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/copyright.js +0 -0
  50. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/DrawToolbar.js +0 -4
  51. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Circle.js +1 -1
  52. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Feature.js +2 -2
  53. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Marker.js +0 -0
  54. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Polygon.js +0 -0
  55. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Polyline.js +0 -0
  56. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.Rectangle.js +1 -19
  57. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/draw/handler/Draw.SimpleShape.js +1 -7
  58. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/EditToolbar.js +2 -9
  59. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/Edit.Circle.js +0 -0
  60. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/Edit.Poly.js +2 -14
  61. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/Edit.Rectangle.js +0 -0
  62. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/Edit.SimpleShape.js +3 -11
  63. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/EditToolbar.Delete.js +1 -4
  64. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/edit/handler/EditToolbar.Edit.js +83 -17
  65. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/ext/GeometryUtil.js +1 -1
  66. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/ext/LatLngUtil.js +0 -0
  67. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/ext/LineUtil.Intersect.js +0 -0
  68. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/ext/Polygon.Intersect.js +0 -0
  69. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/ext/Polyline.Intersect.js +0 -0
  70. data/{vendor/assets/Leaflet.draw → lib/leaflet.draw}/src/images/spritesheet.svg +0 -0
  71. data/lib/leaflet.label/CHANGELOG.md +67 -0
  72. data/lib/leaflet.label/Jakefile.js +21 -0
  73. data/lib/leaflet.label/MIT-LICENCE.txt +20 -0
  74. data/lib/leaflet.label/README.md +103 -0
  75. data/lib/leaflet.label/build/build.js +155 -0
  76. data/lib/leaflet.label/build/deps.js +26 -0
  77. data/lib/leaflet.label/build/hint.js +30 -0
  78. data/lib/leaflet.label/build/hintrc.js +51 -0
  79. data/lib/leaflet.label/dist/images/death.png +0 -0
  80. data/lib/leaflet.label/dist/leaflet.label-src.js +542 -0
  81. data/{vendor/assets → lib/leaflet.label/dist}/leaflet.label.css +0 -0
  82. data/lib/leaflet.label/dist/leaflet.label.js +9 -0
  83. data/lib/leaflet.label/example/label.html +85 -0
  84. data/lib/leaflet.label/libs/leaflet/images/layers-2x.png +0 -0
  85. data/lib/leaflet.label/libs/leaflet/images/layers.png +0 -0
  86. data/lib/leaflet.label/libs/leaflet/images/marker-icon-2x.png +0 -0
  87. data/lib/leaflet.label/libs/leaflet/images/marker-icon.png +0 -0
  88. data/lib/leaflet.label/libs/leaflet/images/marker-icon@2x.png +0 -0
  89. data/lib/leaflet.label/libs/leaflet/images/marker-shadow.png +0 -0
  90. data/lib/leaflet.label/libs/leaflet/leaflet-src.js +9108 -0
  91. data/lib/leaflet.label/libs/leaflet/leaflet.css +478 -0
  92. data/lib/leaflet.label/libs/leaflet/leaflet.js +9 -0
  93. data/lib/leaflet.label/package.json +19 -0
  94. data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/BaseMarkerMethods.js +0 -0
  95. data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/CircleMarker.Label.js +0 -0
  96. data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/FeatureGroup.Label.js +0 -0
  97. data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/Label.js +2 -5
  98. data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/Leaflet.label.js +1 -1
  99. data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/Map.Label.js +0 -0
  100. data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/Marker.Label.js +0 -0
  101. data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/Path.Label.js +0 -0
  102. data/{vendor/assets/Leaflet.label → lib/leaflet.label}/src/copyright.js +0 -0
  103. data/lib/leaflet/CHANGELOG.md +1007 -0
  104. data/lib/leaflet/CONTRIBUTING.md +155 -0
  105. data/lib/leaflet/FAQ.md +138 -0
  106. data/lib/leaflet/Jakefile.js +56 -0
  107. data/lib/leaflet/LICENSE +23 -0
  108. data/lib/leaflet/PLUGIN-GUIDE.md +127 -0
  109. data/lib/leaflet/README.md +34 -0
  110. data/lib/leaflet/build/build.html +227 -0
  111. data/lib/leaflet/build/build.js +190 -0
  112. data/lib/leaflet/build/deps.js +258 -0
  113. data/lib/leaflet/build/hintrc.js +40 -0
  114. data/lib/leaflet/debug/css/mobile.css +6 -0
  115. data/lib/leaflet/debug/css/screen.css +5 -0
  116. data/lib/leaflet/debug/hacks/jitter.html +42 -0
  117. data/lib/leaflet/debug/leaflet-include.js +59 -0
  118. data/lib/leaflet/debug/map/canvas.html +49 -0
  119. data/lib/leaflet/debug/map/controls.html +49 -0
  120. data/lib/leaflet/debug/map/geolocation.html +34 -0
  121. data/lib/leaflet/debug/map/grid.html +45 -0
  122. data/lib/leaflet/debug/map/iframe.html +11 -0
  123. data/lib/leaflet/debug/map/image-overlay.html +43 -0
  124. data/lib/leaflet/debug/map/map-mobile.html +34 -0
  125. data/lib/leaflet/debug/map/map.html +61 -0
  126. data/lib/leaflet/debug/map/max-bounds.html +38 -0
  127. data/lib/leaflet/debug/map/opacity.html +223 -0
  128. data/lib/leaflet/debug/map/scroll.html +41 -0
  129. data/lib/leaflet/debug/map/simple-proj.html +59 -0
  130. data/lib/leaflet/debug/map/wms-marble.html +30 -0
  131. data/lib/leaflet/debug/map/wms.html +40 -0
  132. data/lib/leaflet/debug/map/zoomlevels.html +45 -0
  133. data/lib/leaflet/debug/tests/add_remove_layers.html +87 -0
  134. data/lib/leaflet/debug/tests/bringtoback.html +37 -0
  135. data/lib/leaflet/debug/tests/canvasloop.html +47 -0
  136. data/lib/leaflet/debug/tests/click_on_canvas.html +58 -0
  137. data/lib/leaflet/debug/tests/click_on_canvas_broken.html +49 -0
  138. data/lib/leaflet/debug/tests/dragging_and_copyworldjump.html +61 -0
  139. data/lib/leaflet/debug/tests/opacity.html +56 -0
  140. data/lib/leaflet/debug/tests/popupcontextmenuclicks.html +59 -0
  141. data/lib/leaflet/debug/tests/remove_while_dragging.html +28 -0
  142. data/lib/leaflet/debug/tests/removetilewhilepan.html +41 -0
  143. data/lib/leaflet/debug/tests/reuse_popups.html +40 -0
  144. data/lib/leaflet/debug/tests/rtl.html +42 -0
  145. data/lib/leaflet/debug/tests/rtl2.html +27 -0
  146. data/lib/leaflet/debug/tests/set_icon_reuse_dom.html +43 -0
  147. data/lib/leaflet/debug/tests/svg_clicks.html +54 -0
  148. data/lib/leaflet/debug/vector/bounds-extend.html +88 -0
  149. data/lib/leaflet/debug/vector/feature-group-bounds.html +90 -0
  150. data/lib/leaflet/debug/vector/geojson-sample.js +53 -0
  151. data/lib/leaflet/debug/vector/geojson.html +173 -0
  152. data/lib/leaflet/debug/vector/rectangle.html +53 -0
  153. data/lib/leaflet/debug/vector/route.js +1 -0
  154. data/lib/leaflet/debug/vector/touchzoomemu.html +194 -0
  155. data/lib/leaflet/debug/vector/us-states.js +54 -0
  156. data/lib/leaflet/debug/vector/vector-bounds.html +69 -0
  157. data/lib/leaflet/debug/vector/vector-canvas.html +92 -0
  158. data/lib/leaflet/debug/vector/vector-mobile.html +38 -0
  159. data/lib/leaflet/debug/vector/vector-simple.html +47 -0
  160. data/lib/leaflet/debug/vector/vector.html +37 -0
  161. data/lib/leaflet/debug/vector/vector2.html +58 -0
  162. data/lib/leaflet/dist/images/layers-2x.png +0 -0
  163. data/lib/leaflet/dist/images/layers.png +0 -0
  164. data/lib/leaflet/dist/images/marker-icon-2x.png +0 -0
  165. data/lib/leaflet/dist/images/marker-icon.png +0 -0
  166. data/lib/leaflet/dist/images/marker-shadow.png +0 -0
  167. data/lib/leaflet/dist/leaflet.css +494 -0
  168. data/lib/leaflet/package.json +28 -0
  169. data/lib/leaflet/spec/after.js +2 -0
  170. data/lib/leaflet/spec/expect.js +1253 -0
  171. data/lib/leaflet/spec/index.html +87 -0
  172. data/lib/leaflet/spec/karma.conf.js +68 -0
  173. data/lib/leaflet/spec/sinon.js +4223 -0
  174. data/lib/leaflet/spec/spec.hintrc.js +25 -0
  175. data/lib/leaflet/spec/suites/SpecHelper.js +42 -0
  176. data/lib/leaflet/spec/suites/control/Control.AttributionSpec.js +68 -0
  177. data/lib/leaflet/spec/suites/control/Control.LayersSpec.js +67 -0
  178. data/lib/leaflet/spec/suites/control/Control.ScaleSpec.js +6 -0
  179. data/lib/leaflet/spec/suites/core/ClassSpec.js +166 -0
  180. data/lib/leaflet/spec/suites/core/EventsSpec.js +416 -0
  181. data/lib/leaflet/spec/suites/core/UtilSpec.js +237 -0
  182. data/lib/leaflet/spec/suites/dom/DomEventSpec.js +102 -0
  183. data/lib/leaflet/spec/suites/dom/DomUtilSpec.js +59 -0
  184. data/lib/leaflet/spec/suites/dom/PosAnimationSpec.js +27 -0
  185. data/lib/leaflet/spec/suites/geo/CRSSpec.js +151 -0
  186. data/lib/leaflet/spec/suites/geo/LatLngBoundsSpec.js +144 -0
  187. data/lib/leaflet/spec/suites/geo/LatLngSpec.js +102 -0
  188. data/lib/leaflet/spec/suites/geo/ProjectionSpec.js +96 -0
  189. data/lib/leaflet/spec/suites/geometry/BoundsSpec.js +87 -0
  190. data/lib/leaflet/spec/suites/geometry/LineUtilSpec.js +75 -0
  191. data/lib/leaflet/spec/suites/geometry/PointSpec.js +104 -0
  192. data/lib/leaflet/spec/suites/geometry/PolyUtilSpec.js +27 -0
  193. data/lib/leaflet/spec/suites/geometry/TransformationSpec.js +31 -0
  194. data/lib/leaflet/spec/suites/layer/FeatureGroupSpec.js +86 -0
  195. data/lib/leaflet/spec/suites/layer/GeoJSONSpec.js +282 -0
  196. data/lib/leaflet/spec/suites/layer/LayerGroupSpec.js +71 -0
  197. data/lib/leaflet/spec/suites/layer/PopupSpec.js +119 -0
  198. data/lib/leaflet/spec/suites/layer/marker/MarkerSpec.js +117 -0
  199. data/lib/leaflet/spec/suites/layer/tile/GridLayerSpec.js +70 -0
  200. data/lib/leaflet/spec/suites/layer/tile/TileLayerSpec.js +88 -0
  201. data/lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js +53 -0
  202. data/lib/leaflet/spec/suites/layer/vector/CircleSpec.js +18 -0
  203. data/lib/leaflet/spec/suites/layer/vector/PolygonSpec.js +96 -0
  204. data/lib/leaflet/spec/suites/layer/vector/PolylineGeometrySpec.js +35 -0
  205. data/lib/leaflet/spec/suites/layer/vector/PolylineSpec.js +55 -0
  206. data/lib/leaflet/spec/suites/map/MapSpec.js +553 -0
  207. data/lib/leaflet/spec/suites/map/handler/Map.DragSpec.js +38 -0
  208. data/{vendor/assets/Leaflet → lib/leaflet}/src/Leaflet.js +16 -11
  209. data/{vendor/assets/Leaflet → lib/leaflet}/src/control/Control.Attribution.js +1 -23
  210. data/{vendor/assets/Leaflet → lib/leaflet}/src/control/Control.Layers.js +42 -57
  211. data/lib/leaflet/src/control/Control.Scale.js +102 -0
  212. data/{vendor/assets/Leaflet → lib/leaflet}/src/control/Control.Zoom.js +11 -18
  213. data/{vendor/assets/Leaflet → lib/leaflet}/src/control/Control.js +7 -9
  214. data/lib/leaflet/src/copyright.js +4 -0
  215. data/lib/leaflet/src/core/Browser.js +65 -0
  216. data/{vendor/assets/Leaflet → lib/leaflet}/src/core/Class.js +8 -13
  217. data/lib/leaflet/src/core/Events.js +226 -0
  218. data/{vendor/assets/Leaflet → lib/leaflet}/src/core/Handler.js +0 -0
  219. data/lib/leaflet/src/core/Util.js +196 -0
  220. data/{vendor/assets/Leaflet → lib/leaflet}/src/dom/DomEvent.DoubleTap.js +20 -27
  221. data/lib/leaflet/src/dom/DomEvent.Pointer.js +107 -0
  222. data/{vendor/assets/Leaflet → lib/leaflet}/src/dom/DomEvent.js +70 -59
  223. data/lib/leaflet/src/dom/DomUtil.js +213 -0
  224. data/{vendor/assets/Leaflet → lib/leaflet}/src/dom/Draggable.js +10 -19
  225. data/{vendor/assets/Leaflet → lib/leaflet}/src/dom/PosAnimation.Timer.js +0 -0
  226. data/{vendor/assets/Leaflet → lib/leaflet}/src/dom/PosAnimation.js +4 -3
  227. data/lib/leaflet/src/geo/LatLng.js +67 -0
  228. data/{vendor/assets/Leaflet → lib/leaflet}/src/geo/LatLngBounds.js +0 -0
  229. data/lib/leaflet/src/geo/crs/CRS.EPSG3395.js +13 -0
  230. data/lib/leaflet/src/geo/crs/CRS.EPSG3857.js +17 -0
  231. data/{vendor/assets/Leaflet → lib/leaflet}/src/geo/crs/CRS.EPSG4326.js +2 -3
  232. data/lib/leaflet/src/geo/crs/CRS.Earth.js +19 -0
  233. data/{vendor/assets/Leaflet → lib/leaflet}/src/geo/crs/CRS.Simple.js +10 -1
  234. data/lib/leaflet/src/geo/crs/CRS.js +63 -0
  235. data/{vendor/assets/Leaflet → lib/leaflet}/src/geo/projection/Projection.LonLat.js +5 -1
  236. data/lib/leaflet/src/geo/projection/Projection.Mercator.js +43 -0
  237. data/lib/leaflet/src/geo/projection/Projection.SphericalMercator.js +31 -0
  238. data/{vendor/assets/Leaflet → lib/leaflet}/src/geometry/Bounds.js +0 -0
  239. data/{vendor/assets/Leaflet → lib/leaflet}/src/geometry/LineUtil.js +16 -5
  240. data/{vendor/assets/Leaflet → lib/leaflet}/src/geometry/Point.js +10 -0
  241. data/{vendor/assets/Leaflet → lib/leaflet}/src/geometry/PolyUtil.js +0 -0
  242. data/{vendor/assets/Leaflet → lib/leaflet}/src/geometry/Transformation.js +0 -0
  243. data/{vendor/assets/Leaflet → lib/leaflet}/src/images/layers.svg +0 -0
  244. data/lib/leaflet/src/images/logo.svg +85 -0
  245. data/{vendor/assets/Leaflet → lib/leaflet}/src/images/marker.svg +0 -0
  246. data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/FeatureGroup.js +3 -20
  247. data/lib/leaflet/src/layer/GeoJSON.js +275 -0
  248. data/lib/leaflet/src/layer/ImageOverlay.js +123 -0
  249. data/lib/leaflet/src/layer/Layer.Popup.js +87 -0
  250. data/lib/leaflet/src/layer/Layer.js +150 -0
  251. data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/LayerGroup.js +12 -14
  252. data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/Popup.js +65 -83
  253. data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/marker/DivIcon.js +3 -8
  254. data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/marker/Icon.Default.js +6 -12
  255. data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/marker/Icon.js +8 -25
  256. data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/marker/Marker.Drag.js +13 -11
  257. data/lib/leaflet/src/layer/marker/Marker.Popup.js +16 -0
  258. data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/marker/Marker.js +52 -103
  259. data/lib/leaflet/src/layer/tile/GridLayer.js +536 -0
  260. data/lib/leaflet/src/layer/tile/TileLayer.WMS.js +79 -0
  261. data/lib/leaflet/src/layer/tile/TileLayer.js +148 -0
  262. data/lib/leaflet/src/layer/vector/Canvas.js +292 -0
  263. data/lib/leaflet/src/layer/vector/Circle.js +67 -0
  264. data/lib/leaflet/src/layer/vector/CircleMarker.js +72 -0
  265. data/lib/leaflet/src/layer/vector/Path.js +79 -0
  266. data/lib/leaflet/src/layer/vector/Polygon.js +75 -0
  267. data/lib/leaflet/src/layer/vector/Polyline.js +223 -0
  268. data/{vendor/assets/Leaflet → lib/leaflet}/src/layer/vector/Rectangle.js +27 -27
  269. data/lib/leaflet/src/layer/vector/Renderer.js +75 -0
  270. data/lib/leaflet/src/layer/vector/SVG.VML.js +134 -0
  271. data/lib/leaflet/src/layer/vector/SVG.js +189 -0
  272. data/{vendor/assets/Leaflet → lib/leaflet}/src/map/Map.js +83 -199
  273. data/{vendor/assets/Leaflet → lib/leaflet}/src/map/anim/Map.PanAnimation.js +0 -0
  274. data/{vendor/assets/Leaflet → lib/leaflet}/src/map/anim/Map.ZoomAnimation.js +30 -38
  275. data/{vendor/assets/Leaflet → lib/leaflet}/src/map/ext/Map.Geolocation.js +8 -8
  276. data/lib/leaflet/src/map/handler/Map.BoxZoom.js +105 -0
  277. data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.DoubleClickZoom.js +0 -0
  278. data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.Drag.js +12 -10
  279. data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.Keyboard.js +19 -17
  280. data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.ScrollWheelZoom.js +10 -6
  281. data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.Tap.js +8 -6
  282. data/{vendor/assets/Leaflet → lib/leaflet}/src/map/handler/Map.TouchZoom.js +16 -32
  283. data/vendor/assets/images/layers-2x.png +0 -0
  284. data/vendor/assets/images/layers.png +0 -0
  285. data/vendor/assets/images/marker-icon-2x.png +0 -0
  286. data/vendor/assets/images/marker-icon.png +0 -0
  287. data/vendor/assets/images/marker-shadow.png +0 -0
  288. data/vendor/assets/images/spritesheet-2x.png +0 -0
  289. data/vendor/assets/images/spritesheet.png +0 -0
  290. data/vendor/assets/{leaflet-js.js → javascripts/leaflet-js.js} +2 -2
  291. data/vendor/assets/javascripts/leaflet.draw.js +37 -0
  292. data/vendor/assets/javascripts/leaflet.js +149 -0
  293. data/vendor/assets/javascripts/leaflet.label.js +11 -0
  294. data/vendor/assets/{leaflet-js.css → stylesheets/leaflet-js.css} +0 -0
  295. data/vendor/assets/stylesheets/leaflet.css.erb +478 -0
  296. data/vendor/assets/{leaflet.draw.css.erb → stylesheets/leaflet.draw.css.erb} +2 -2
  297. data/vendor/assets/{leaflet.draw.ie.css → stylesheets/leaflet.draw.ie.css} +0 -0
  298. data/vendor/assets/stylesheets/leaflet.label.css +52 -0
  299. metadata +298 -137
  300. data/lib/leaflet-js/engine.rb +0 -7
  301. data/lib/leaflet-js/version.rb +0 -3
  302. data/vendor/assets/Leaflet.draw/src/edit/handler/Edit.Marker.js +0 -75
  303. data/vendor/assets/Leaflet/src/control/Control.Scale.js +0 -112
  304. data/vendor/assets/Leaflet/src/copyright.js +0 -5
  305. data/vendor/assets/Leaflet/src/core/Browser.js +0 -66
  306. data/vendor/assets/Leaflet/src/core/Events.js +0 -178
  307. data/vendor/assets/Leaflet/src/core/Util.js +0 -182
  308. data/vendor/assets/Leaflet/src/dom/DomEvent.Pointer.js +0 -156
  309. data/vendor/assets/Leaflet/src/dom/DomUtil.js +0 -289
  310. data/vendor/assets/Leaflet/src/geo/LatLng.js +0 -99
  311. data/vendor/assets/Leaflet/src/geo/crs/CRS.EPSG3395.js +0 -14
  312. data/vendor/assets/Leaflet/src/geo/crs/CRS.EPSG3857.js +0 -21
  313. data/vendor/assets/Leaflet/src/geo/crs/CRS.js +0 -32
  314. data/vendor/assets/Leaflet/src/geo/projection/Projection.Mercator.js +0 -56
  315. data/vendor/assets/Leaflet/src/geo/projection/Projection.SphericalMercator.js +0 -27
  316. data/vendor/assets/Leaflet/src/geo/projection/Projection.js +0 -5
  317. data/vendor/assets/Leaflet/src/layer/GeoJSON.js +0 -286
  318. data/vendor/assets/Leaflet/src/layer/ImageOverlay.js +0 -141
  319. data/vendor/assets/Leaflet/src/layer/marker/Marker.Popup.js +0 -90
  320. data/vendor/assets/Leaflet/src/layer/tile/TileLayer.Anim.js +0 -110
  321. data/vendor/assets/Leaflet/src/layer/tile/TileLayer.Canvas.js +0 -61
  322. data/vendor/assets/Leaflet/src/layer/tile/TileLayer.WMS.js +0 -87
  323. data/vendor/assets/Leaflet/src/layer/tile/TileLayer.js +0 -597
  324. data/vendor/assets/Leaflet/src/layer/vector/Circle.js +0 -98
  325. data/vendor/assets/Leaflet/src/layer/vector/CircleMarker.js +0 -45
  326. data/vendor/assets/Leaflet/src/layer/vector/MultiPoly.js +0 -57
  327. data/vendor/assets/Leaflet/src/layer/vector/Path.Popup.js +0 -65
  328. data/vendor/assets/Leaflet/src/layer/vector/Path.SVG.js +0 -230
  329. data/vendor/assets/Leaflet/src/layer/vector/Path.VML.js +0 -135
  330. data/vendor/assets/Leaflet/src/layer/vector/Path.js +0 -119
  331. data/vendor/assets/Leaflet/src/layer/vector/Polygon.js +0 -92
  332. data/vendor/assets/Leaflet/src/layer/vector/Polyline.js +0 -164
  333. data/vendor/assets/Leaflet/src/layer/vector/canvas/Circle.Canvas.js +0 -18
  334. data/vendor/assets/Leaflet/src/layer/vector/canvas/CircleMarker.Canvas.js +0 -9
  335. data/vendor/assets/Leaflet/src/layer/vector/canvas/Path.Canvas.js +0 -204
  336. data/vendor/assets/Leaflet/src/layer/vector/canvas/Polygon.Canvas.js +0 -37
  337. data/vendor/assets/Leaflet/src/layer/vector/canvas/Polyline.Canvas.js +0 -30
  338. data/vendor/assets/Leaflet/src/map/handler/Map.BoxZoom.js +0 -118
  339. data/vendor/assets/leaflet.draw.js +0 -38
  340. data/vendor/assets/leaflet.js +0 -155
  341. data/vendor/assets/leaflet.label.js +0 -11
@@ -2,9 +2,7 @@
2
2
  * L.Map is the central class of the API - it is used to create a map.
3
3
  */
4
4
 
5
- L.Map = L.Class.extend({
6
-
7
- includes: L.Mixin.Events,
5
+ L.Map = L.Evented.extend({
8
6
 
9
7
  options: {
10
8
  crs: L.CRS.EPSG3857,
@@ -15,15 +13,14 @@ L.Map = L.Class.extend({
15
13
  layers: Array,
16
14
  */
17
15
 
18
- fadeAnimation: L.DomUtil.TRANSITION && !L.Browser.android23,
16
+ fadeAnimation: true,
19
17
  trackResize: true,
20
- markerZoomAnimation: L.DomUtil.TRANSITION && L.Browser.any3d
18
+ markerZoomAnimation: true
21
19
  },
22
20
 
23
21
  initialize: function (id, options) { // (HTMLElement or String, Object)
24
22
  options = L.setOptions(this, options);
25
23
 
26
-
27
24
  this._initContainer(id);
28
25
  this._initLayout();
29
26
 
@@ -41,14 +38,12 @@ L.Map = L.Class.extend({
41
38
  }
42
39
 
43
40
  this._handlers = [];
44
-
45
41
  this._layers = {};
46
42
  this._zoomBoundLayers = {};
47
- this._tileLayersNum = 0;
48
43
 
49
44
  this.callInitHooks();
50
45
 
51
- this._addLayers(options.layers);
46
+ this._addLayers(this.options.layers);
52
47
  },
53
48
 
54
49
 
@@ -96,16 +91,15 @@ L.Map = L.Class.extend({
96
91
  var paddingTL = L.point(options.paddingTopLeft || options.padding || [0, 0]),
97
92
  paddingBR = L.point(options.paddingBottomRight || options.padding || [0, 0]),
98
93
 
99
- zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR));
100
-
101
- zoom = (options.maxZoom) ? Math.min(options.maxZoom, zoom) : zoom;
102
-
103
- var paddingOffset = paddingBR.subtract(paddingTL).divideBy(2),
94
+ zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR)),
95
+ paddingOffset = paddingBR.subtract(paddingTL).divideBy(2),
104
96
 
105
97
  swPoint = this.project(bounds.getSouthWest(), zoom),
106
98
  nePoint = this.project(bounds.getNorthEast(), zoom),
107
99
  center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom);
108
100
 
101
+ zoom = options && options.maxZoom ? Math.min(options.maxZoom, zoom) : zoom;
102
+
109
103
  return this.setView(center, zoom, options);
110
104
  },
111
105
 
@@ -133,14 +127,14 @@ L.Map = L.Class.extend({
133
127
  this.options.maxBounds = bounds;
134
128
 
135
129
  if (!bounds) {
136
- return this.off('moveend', this._panInsideMaxBounds, this);
130
+ return this.off('moveend', this._panInsideMaxBounds);
137
131
  }
138
132
 
139
133
  if (this._loaded) {
140
134
  this._panInsideMaxBounds();
141
135
  }
142
136
 
143
- return this.on('moveend', this._panInsideMaxBounds, this);
137
+ return this.on('moveend', this._panInsideMaxBounds);
144
138
  },
145
139
 
146
140
  panInsideBounds: function (bounds, options) {
@@ -152,78 +146,6 @@ L.Map = L.Class.extend({
152
146
  return this.panTo(newCenter, options);
153
147
  },
154
148
 
155
- addLayer: function (layer) {
156
- // TODO method is too big, refactor
157
-
158
- var id = L.stamp(layer);
159
-
160
- if (this._layers[id]) { return this; }
161
-
162
- this._layers[id] = layer;
163
-
164
- // TODO getMaxZoom, getMinZoom in ILayer (instead of options)
165
- if (layer.options && (!isNaN(layer.options.maxZoom) || !isNaN(layer.options.minZoom))) {
166
- this._zoomBoundLayers[id] = layer;
167
- this._updateZoomLevels();
168
- }
169
-
170
- // TODO looks ugly, refactor!!!
171
- if (this.options.zoomAnimation && L.TileLayer && (layer instanceof L.TileLayer)) {
172
- this._tileLayersNum++;
173
- this._tileLayersToLoad++;
174
- layer.on('load', this._onTileLayerLoad, this);
175
- }
176
-
177
- if (this._loaded) {
178
- this._layerAdd(layer);
179
- }
180
-
181
- return this;
182
- },
183
-
184
- removeLayer: function (layer) {
185
- var id = L.stamp(layer);
186
-
187
- if (!this._layers[id]) { return this; }
188
-
189
- if (this._loaded) {
190
- layer.onRemove(this);
191
- }
192
-
193
- delete this._layers[id];
194
-
195
- if (this._loaded) {
196
- this.fire('layerremove', {layer: layer});
197
- }
198
-
199
- if (this._zoomBoundLayers[id]) {
200
- delete this._zoomBoundLayers[id];
201
- this._updateZoomLevels();
202
- }
203
-
204
- // TODO looks ugly, refactor
205
- if (this.options.zoomAnimation && L.TileLayer && (layer instanceof L.TileLayer)) {
206
- this._tileLayersNum--;
207
- this._tileLayersToLoad--;
208
- layer.off('load', this._onTileLayerLoad, this);
209
- }
210
-
211
- return this;
212
- },
213
-
214
- hasLayer: function (layer) {
215
- if (!layer) { return false; }
216
-
217
- return (L.stamp(layer) in this._layers);
218
- },
219
-
220
- eachLayer: function (method, context) {
221
- for (var i in this._layers) {
222
- method.call(context, this._layers[i]);
223
- }
224
- return this;
225
- },
226
-
227
149
  invalidateSize: function (options) {
228
150
  if (!this._loaded) { return this; }
229
151
 
@@ -283,9 +205,6 @@ L.Map = L.Class.extend({
283
205
  },
284
206
 
285
207
  remove: function () {
286
- if (this._loaded) {
287
- this.fire('unload');
288
- }
289
208
 
290
209
  this._initEvents('off');
291
210
 
@@ -296,16 +215,31 @@ L.Map = L.Class.extend({
296
215
  this._container._leaflet = undefined;
297
216
  }
298
217
 
299
- this._clearPanes();
218
+ L.DomUtil.remove(this._mapPane);
219
+
300
220
  if (this._clearControlPos) {
301
221
  this._clearControlPos();
302
222
  }
303
223
 
304
224
  this._clearHandlers();
225
+
226
+ if (this._loaded) {
227
+ this.fire('unload');
228
+ }
305
229
 
306
230
  return this;
307
231
  },
308
232
 
233
+ createPane: function (name, container) {
234
+ var className = 'leaflet-pane' + (name ? ' leaflet-' + name.replace('Pane', '') + '-pane' : ''),
235
+ pane = L.DomUtil.create('div', className, container || this._mapPane);
236
+
237
+ if (name) {
238
+ this._panes[name] = pane;
239
+ }
240
+ return pane;
241
+ },
242
+
309
243
 
310
244
  // public methods for getting map state
311
245
 
@@ -331,9 +265,7 @@ L.Map = L.Class.extend({
331
265
  },
332
266
 
333
267
  getMinZoom: function () {
334
- return this.options.minZoom === undefined ?
335
- (this._layersMinZoom === undefined ? 0 : this._layersMinZoom) :
336
- this.options.minZoom;
268
+ return this.options.minZoom === undefined ? this._layersMinZoom || 0 : this.options.minZoom;
337
269
  },
338
270
 
339
271
  getMaxZoom: function () {
@@ -392,6 +324,14 @@ L.Map = L.Class.extend({
392
324
  return this._initialTopLeftPoint;
393
325
  },
394
326
 
327
+ getPixelWorldBounds: function () {
328
+ return this.options.crs.getProjectedBounds(this.getZoom());
329
+ },
330
+
331
+ getPane: function (pane) {
332
+ return typeof pane === 'string' ? this._panes[pane] : pane;
333
+ },
334
+
395
335
  getPanes: function () {
396
336
  return this._panes;
397
337
  },
@@ -435,6 +375,14 @@ L.Map = L.Class.extend({
435
375
  return projectedPoint._subtract(this.getPixelOrigin());
436
376
  },
437
377
 
378
+ wrapLatLng: function (latlng) {
379
+ return this.options.crs.wrapLatLng(L.latLng(latlng));
380
+ },
381
+
382
+ distance: function (latlng1, latlng2) {
383
+ return this.options.crs.distance(L.latLng(latlng1), L.latLng(latlng2));
384
+ },
385
+
438
386
  containerPointToLayerPoint: function (point) { // (Point)
439
387
  return L.point(point).subtract(this._getMapPanePos());
440
388
  },
@@ -482,11 +430,14 @@ L.Map = L.Class.extend({
482
430
  _initLayout: function () {
483
431
  var container = this._container;
484
432
 
433
+ this._fadeAnimated = this.options.fadeAnimation && L.Browser.any3d;
434
+
485
435
  L.DomUtil.addClass(container, 'leaflet-container' +
486
436
  (L.Browser.touch ? ' leaflet-touch' : '') +
487
437
  (L.Browser.retina ? ' leaflet-retina' : '') +
488
438
  (L.Browser.ielt9 ? ' leaflet-oldie' : '') +
489
- (this.options.fadeAnimation ? ' leaflet-fade-anim' : ''));
439
+ (L.Browser.safari ? ' leaflet-safari' : '') +
440
+ (this._fadeAnimated ? ' leaflet-fade-anim' : ''));
490
441
 
491
442
  var position = L.DomUtil.getStyle(container, 'position');
492
443
 
@@ -504,37 +455,17 @@ L.Map = L.Class.extend({
504
455
  _initPanes: function () {
505
456
  var panes = this._panes = {};
506
457
 
507
- this._mapPane = panes.mapPane = this._createPane('leaflet-map-pane', this._container);
458
+ this._mapPane = this.createPane('mapPane', this._container);
508
459
 
509
- this._tilePane = panes.tilePane = this._createPane('leaflet-tile-pane', this._mapPane);
510
- panes.objectsPane = this._createPane('leaflet-objects-pane', this._mapPane);
511
- panes.shadowPane = this._createPane('leaflet-shadow-pane');
512
- panes.overlayPane = this._createPane('leaflet-overlay-pane');
513
- panes.markerPane = this._createPane('leaflet-marker-pane');
514
- panes.popupPane = this._createPane('leaflet-popup-pane');
515
-
516
- var zoomHide = ' leaflet-zoom-hide';
460
+ this.createPane('tilePane');
461
+ this.createPane('shadowPane');
462
+ this.createPane('overlayPane');
463
+ this.createPane('markerPane');
464
+ this.createPane('popupPane');
517
465
 
518
466
  if (!this.options.markerZoomAnimation) {
519
- L.DomUtil.addClass(panes.markerPane, zoomHide);
520
- L.DomUtil.addClass(panes.shadowPane, zoomHide);
521
- L.DomUtil.addClass(panes.popupPane, zoomHide);
522
- }
523
- },
524
-
525
- _createPane: function (className, container) {
526
- return L.DomUtil.create('div', className, container || this._panes.objectsPane);
527
- },
528
-
529
- _clearPanes: function () {
530
- this._container.removeChild(this._mapPane);
531
- },
532
-
533
- _addLayers: function (layers) {
534
- layers = layers ? (L.Util.isArray(layers) ? layers : [layers]) : [];
535
-
536
- for (var i = 0, len = layers.length; i < len; i++) {
537
- this.addLayer(layers[i]);
467
+ L.DomUtil.addClass(panes.markerPane, 'leaflet-zoom-hide');
468
+ L.DomUtil.addClass(panes.shadowPane, 'leaflet-zoom-hide');
538
469
  }
539
470
  },
540
471
 
@@ -564,18 +495,15 @@ L.Map = L.Class.extend({
564
495
  this._initialTopLeftPoint._add(this._getMapPanePos());
565
496
  }
566
497
 
567
- this._tileLayersToLoad = this._tileLayersNum;
568
-
569
498
  var loading = !this._loaded;
570
499
  this._loaded = true;
571
500
 
572
- this.fire('viewreset', {hard: !preserveMapOffset});
573
-
574
501
  if (loading) {
575
502
  this.fire('load');
576
- this.eachLayer(this._layerAdd, this);
577
503
  }
578
504
 
505
+ this.fire('viewreset', {hard: !preserveMapOffset});
506
+
579
507
  this.fire('move');
580
508
 
581
509
  if (zoomChanged || afterZoomAnim) {
@@ -593,34 +521,6 @@ L.Map = L.Class.extend({
593
521
  return this.getMaxZoom() - this.getMinZoom();
594
522
  },
595
523
 
596
- _updateZoomLevels: function () {
597
- var i,
598
- minZoom = Infinity,
599
- maxZoom = -Infinity,
600
- oldZoomSpan = this._getZoomSpan();
601
-
602
- for (i in this._zoomBoundLayers) {
603
- var layer = this._zoomBoundLayers[i];
604
- if (!isNaN(layer.options.minZoom)) {
605
- minZoom = Math.min(minZoom, layer.options.minZoom);
606
- }
607
- if (!isNaN(layer.options.maxZoom)) {
608
- maxZoom = Math.max(maxZoom, layer.options.maxZoom);
609
- }
610
- }
611
-
612
- if (i === undefined) { // we have no tilelayers
613
- this._layersMaxZoom = this._layersMinZoom = undefined;
614
- } else {
615
- this._layersMaxZoom = maxZoom;
616
- this._layersMinZoom = minZoom;
617
- }
618
-
619
- if (oldZoomSpan !== this._getZoomSpan()) {
620
- this.fire('zoomlevelschange');
621
- }
622
- },
623
-
624
524
  _panInsideMaxBounds: function () {
625
525
  this.panInsideBounds(this.options.maxBounds);
626
526
  },
@@ -638,15 +538,9 @@ L.Map = L.Class.extend({
638
538
 
639
539
  onOff = onOff || 'on';
640
540
 
641
- L.DomEvent[onOff](this._container, 'click', this._onMouseClick, this);
642
-
643
- var events = ['dblclick', 'mousedown', 'mouseup', 'mouseenter',
644
- 'mouseleave', 'mousemove', 'contextmenu'],
645
- i, len;
646
-
647
- for (i = 0, len = events.length; i < len; i++) {
648
- L.DomEvent[onOff](this._container, events[i], this._fireMouseEvent, this);
649
- }
541
+ L.DomEvent[onOff](this._container,
542
+ 'click dblclick mousedown mouseup mouseenter mouseleave mousemove contextmenu',
543
+ this._handleMouseEvent, this);
650
544
 
651
545
  if (this.options.trackResize) {
652
546
  L.DomEvent[onOff](window, 'resize', this._onResize, this);
@@ -659,46 +553,41 @@ L.Map = L.Class.extend({
659
553
  function () { this.invalidateSize({debounceMoveend: true}); }, this, false, this._container);
660
554
  },
661
555
 
662
- _onMouseClick: function (e) {
663
- if (!this._loaded || (!e._simulated &&
664
- ((this.dragging && this.dragging.moved()) ||
665
- (this.boxZoom && this.boxZoom.moved()))) ||
666
- L.DomEvent._skipped(e)) { return; }
556
+ _handleMouseEvent: function (e) {
557
+ if (!this._loaded) { return; }
667
558
 
668
- this.fire('preclick');
669
- this._fireMouseEvent(e);
559
+ this._fireMouseEvent(this, e,
560
+ e.type === 'mouseenter' ? 'mouseover' :
561
+ e.type === 'mouseleave' ? 'mouseout' : e.type);
670
562
  },
671
563
 
672
- _fireMouseEvent: function (e) {
673
- if (!this._loaded || L.DomEvent._skipped(e)) { return; }
674
-
675
- var type = e.type;
564
+ _fireMouseEvent: function (obj, e, type, propagate, latlng) {
565
+ type = type || e.type;
676
566
 
677
- type = (type === 'mouseenter' ? 'mouseover' : (type === 'mouseleave' ? 'mouseout' : type));
567
+ if (type === 'click') {
568
+ if (!e._simulated && ((this.dragging && this.dragging.moved()) ||
569
+ (this.boxZoom && this.boxZoom.moved()))) { return; }
570
+ obj.fire('preclick');
571
+ }
678
572
 
679
- if (!this.hasEventListeners(type)) { return; }
573
+ if (!obj.listens(type, propagate) || L.DomEvent._skipped(e)) { return; }
680
574
 
681
575
  if (type === 'contextmenu') {
682
576
  L.DomEvent.preventDefault(e);
683
577
  }
578
+ if (type === 'click' || type === 'dblclick' || type === 'contextmenu') {
579
+ L.DomEvent.stopPropagation(e);
580
+ }
684
581
 
685
- var containerPoint = this.mouseEventToContainerPoint(e),
686
- layerPoint = this.containerPointToLayerPoint(containerPoint),
687
- latlng = this.layerPointToLatLng(layerPoint);
582
+ var data = {
583
+ originalEvent: e,
584
+ containerPoint: this.mouseEventToContainerPoint(e)
585
+ };
688
586
 
689
- this.fire(type, {
690
- latlng: latlng,
691
- layerPoint: layerPoint,
692
- containerPoint: containerPoint,
693
- originalEvent: e
694
- });
695
- },
587
+ data.layerPoint = this.containerPointToLayerPoint(data.containerPoint);
588
+ data.latlng = latlng || this.layerPointToLatLng(data.layerPoint);
696
589
 
697
- _onTileLayerLoad: function () {
698
- this._tileLayersToLoad--;
699
- if (this._tileLayersNum && !this._tileLayersToLoad) {
700
- this.fire('tilelayersload');
701
- }
590
+ obj.fire(type, data, propagate);
702
591
  },
703
592
 
704
593
  _clearHandlers: function () {
@@ -716,11 +605,6 @@ L.Map = L.Class.extend({
716
605
  return this;
717
606
  },
718
607
 
719
- _layerAdd: function (layer) {
720
- layer.onAdd(this);
721
- this.fire('layeradd', {layer: layer});
722
- },
723
-
724
608
 
725
609
  // private methods for getting map state
726
610