leaflet-js 0.7.0.4 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (308) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.rdoc +10 -3
  3. data/Rakefile +3 -3
  4. data/leaflet-js.gemspec +13 -7
  5. data/lib/leaflet-js.rb +2 -10
  6. data/lib/leaflet-js/engine.rb +7 -0
  7. data/lib/leaflet-js/version.rb +3 -0
  8. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/dist/images/spritesheet-2x.png +0 -0
  9. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/dist/images/spritesheet.png +0 -0
  10. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/Control.Draw.js +21 -19
  11. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/Leaflet.draw.js +8 -3
  12. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/Toolbar.js +75 -14
  13. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/Tooltip.js +0 -0
  14. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/copyright.js +0 -0
  15. data/vendor/assets/Leaflet.draw/src/draw/DrawToolbar.js +87 -0
  16. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/draw/handler/Draw.Circle.js +2 -3
  17. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/draw/handler/Draw.Feature.js +4 -4
  18. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/draw/handler/Draw.Marker.js +0 -0
  19. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/draw/handler/Draw.Polygon.js +9 -7
  20. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/draw/handler/Draw.Polyline.js +86 -36
  21. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/draw/handler/Draw.Rectangle.js +19 -1
  22. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/draw/handler/Draw.SimpleShape.js +18 -4
  23. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/edit/EditToolbar.js +34 -43
  24. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/edit/handler/Edit.Circle.js +0 -0
  25. data/vendor/assets/Leaflet.draw/src/edit/handler/Edit.Marker.js +75 -0
  26. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/edit/handler/Edit.Poly.js +16 -2
  27. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/edit/handler/Edit.Rectangle.js +3 -3
  28. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/edit/handler/Edit.SimpleShape.js +13 -3
  29. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/edit/handler/EditToolbar.Delete.js +11 -7
  30. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/edit/handler/EditToolbar.Edit.js +26 -94
  31. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/ext/GeometryUtil.js +3 -3
  32. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/ext/LatLngUtil.js +0 -0
  33. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/ext/LineUtil.Intersect.js +0 -0
  34. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/ext/Polygon.Intersect.js +0 -0
  35. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/ext/Polyline.Intersect.js +3 -3
  36. data/{lib/leaflet.draw → vendor/assets/Leaflet.draw}/src/images/spritesheet.svg +0 -0
  37. data/{lib/leaflet.label → vendor/assets/Leaflet.label}/src/BaseMarkerMethods.js +0 -0
  38. data/{lib/leaflet.label → vendor/assets/Leaflet.label}/src/CircleMarker.Label.js +0 -0
  39. data/{lib/leaflet.label → vendor/assets/Leaflet.label}/src/FeatureGroup.Label.js +0 -0
  40. data/{lib/leaflet.label → vendor/assets/Leaflet.label}/src/Label.js +5 -2
  41. data/{lib/leaflet.label → vendor/assets/Leaflet.label}/src/Leaflet.label.js +1 -1
  42. data/{lib/leaflet.label → vendor/assets/Leaflet.label}/src/Map.Label.js +0 -0
  43. data/{lib/leaflet.label → vendor/assets/Leaflet.label}/src/Marker.Label.js +0 -0
  44. data/{lib/leaflet.label → vendor/assets/Leaflet.label}/src/Path.Label.js +0 -0
  45. data/{lib/leaflet.label → vendor/assets/Leaflet.label}/src/copyright.js +0 -0
  46. data/{lib/leaflet.draw/examples/libs → vendor/assets/Leaflet/dist}/images/layers-2x.png +0 -0
  47. data/{lib/leaflet.draw/examples/libs → vendor/assets/Leaflet/dist}/images/layers.png +0 -0
  48. data/{lib/leaflet.draw/examples/libs → vendor/assets/Leaflet/dist}/images/marker-icon-2x.png +0 -0
  49. data/{lib/leaflet.draw/examples/libs → vendor/assets/Leaflet/dist}/images/marker-icon.png +0 -0
  50. data/{lib/leaflet.draw/examples/libs → vendor/assets/Leaflet/dist}/images/marker-shadow.png +0 -0
  51. data/{lib/leaflet → vendor/assets/Leaflet}/src/Leaflet.js +1 -1
  52. data/{lib/leaflet → vendor/assets/Leaflet}/src/control/Control.Attribution.js +0 -0
  53. data/{lib/leaflet → vendor/assets/Leaflet}/src/control/Control.Layers.js +2 -2
  54. data/{lib/leaflet → vendor/assets/Leaflet}/src/control/Control.Scale.js +0 -0
  55. data/{lib/leaflet → vendor/assets/Leaflet}/src/control/Control.Zoom.js +0 -0
  56. data/{lib/leaflet → vendor/assets/Leaflet}/src/control/Control.js +0 -0
  57. data/{lib/leaflet → vendor/assets/Leaflet}/src/copyright.js +0 -0
  58. data/{lib/leaflet → vendor/assets/Leaflet}/src/core/Browser.js +5 -36
  59. data/{lib/leaflet → vendor/assets/Leaflet}/src/core/Class.js +0 -0
  60. data/{lib/leaflet → vendor/assets/Leaflet}/src/core/Events.js +0 -0
  61. data/{lib/leaflet → vendor/assets/Leaflet}/src/core/Handler.js +0 -0
  62. data/{lib/leaflet → vendor/assets/Leaflet}/src/core/Util.js +9 -14
  63. data/{lib/leaflet → vendor/assets/Leaflet}/src/dom/DomEvent.DoubleTap.js +0 -0
  64. data/{lib/leaflet → vendor/assets/Leaflet}/src/dom/DomEvent.Pointer.js +3 -2
  65. data/{lib/leaflet → vendor/assets/Leaflet}/src/dom/DomEvent.js +7 -18
  66. data/{lib/leaflet → vendor/assets/Leaflet}/src/dom/DomUtil.js +0 -5
  67. data/{lib/leaflet → vendor/assets/Leaflet}/src/dom/Draggable.js +10 -4
  68. data/{lib/leaflet → vendor/assets/Leaflet}/src/dom/PosAnimation.Timer.js +0 -0
  69. data/{lib/leaflet → vendor/assets/Leaflet}/src/dom/PosAnimation.js +0 -0
  70. data/{lib/leaflet → vendor/assets/Leaflet}/src/geo/LatLng.js +0 -0
  71. data/{lib/leaflet → vendor/assets/Leaflet}/src/geo/LatLngBounds.js +0 -0
  72. data/{lib/leaflet → vendor/assets/Leaflet}/src/geo/crs/CRS.EPSG3395.js +0 -0
  73. data/{lib/leaflet → vendor/assets/Leaflet}/src/geo/crs/CRS.EPSG3857.js +0 -0
  74. data/{lib/leaflet → vendor/assets/Leaflet}/src/geo/crs/CRS.EPSG4326.js +0 -0
  75. data/{lib/leaflet → vendor/assets/Leaflet}/src/geo/crs/CRS.Simple.js +0 -0
  76. data/{lib/leaflet → vendor/assets/Leaflet}/src/geo/crs/CRS.js +0 -0
  77. data/{lib/leaflet → vendor/assets/Leaflet}/src/geo/projection/Projection.LonLat.js +0 -0
  78. data/{lib/leaflet → vendor/assets/Leaflet}/src/geo/projection/Projection.Mercator.js +0 -0
  79. data/{lib/leaflet → vendor/assets/Leaflet}/src/geo/projection/Projection.SphericalMercator.js +0 -0
  80. data/{lib/leaflet → vendor/assets/Leaflet}/src/geo/projection/Projection.js +0 -0
  81. data/{lib/leaflet → vendor/assets/Leaflet}/src/geometry/Bounds.js +0 -0
  82. data/{lib/leaflet → vendor/assets/Leaflet}/src/geometry/LineUtil.js +1 -1
  83. data/{lib/leaflet → vendor/assets/Leaflet}/src/geometry/Point.js +0 -0
  84. data/{lib/leaflet → vendor/assets/Leaflet}/src/geometry/PolyUtil.js +0 -0
  85. data/{lib/leaflet → vendor/assets/Leaflet}/src/geometry/Transformation.js +0 -0
  86. data/{lib/leaflet → vendor/assets/Leaflet}/src/images/layers.svg +0 -0
  87. data/{lib/leaflet → vendor/assets/Leaflet}/src/images/marker.svg +0 -0
  88. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/FeatureGroup.js +5 -3
  89. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/GeoJSON.js +0 -0
  90. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/ImageOverlay.js +0 -0
  91. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/LayerGroup.js +0 -0
  92. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/Popup.js +0 -0
  93. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/marker/DivIcon.js +0 -0
  94. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/marker/Icon.Default.js +0 -0
  95. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/marker/Icon.js +0 -0
  96. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/marker/Marker.Drag.js +0 -0
  97. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/marker/Marker.Popup.js +1 -0
  98. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/marker/Marker.js +2 -4
  99. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/tile/TileLayer.Anim.js +5 -0
  100. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/tile/TileLayer.Canvas.js +0 -0
  101. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/tile/TileLayer.WMS.js +0 -0
  102. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/tile/TileLayer.js +3 -5
  103. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/Circle.js +0 -0
  104. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/CircleMarker.js +1 -0
  105. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/MultiPoly.js +0 -0
  106. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/Path.Popup.js +0 -0
  107. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/Path.SVG.js +1 -1
  108. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/Path.VML.js +0 -0
  109. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/Path.js +0 -0
  110. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/Polygon.js +0 -0
  111. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/Polyline.js +0 -0
  112. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/Rectangle.js +0 -0
  113. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/canvas/Circle.Canvas.js +0 -0
  114. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/canvas/CircleMarker.Canvas.js +0 -0
  115. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/canvas/Path.Canvas.js +13 -6
  116. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/canvas/Polygon.Canvas.js +0 -0
  117. data/{lib/leaflet → vendor/assets/Leaflet}/src/layer/vector/canvas/Polyline.Canvas.js +0 -0
  118. data/{lib/leaflet → vendor/assets/Leaflet}/src/map/Map.js +9 -8
  119. data/{lib/leaflet → vendor/assets/Leaflet}/src/map/anim/Map.PanAnimation.js +0 -0
  120. data/{lib/leaflet → vendor/assets/Leaflet}/src/map/anim/Map.ZoomAnimation.js +25 -16
  121. data/{lib/leaflet → vendor/assets/Leaflet}/src/map/ext/Map.Geolocation.js +0 -0
  122. data/{lib/leaflet → vendor/assets/Leaflet}/src/map/handler/Map.BoxZoom.js +0 -0
  123. data/{lib/leaflet → vendor/assets/Leaflet}/src/map/handler/Map.DoubleClickZoom.js +0 -0
  124. data/{lib/leaflet → vendor/assets/Leaflet}/src/map/handler/Map.Drag.js +0 -0
  125. data/{lib/leaflet → vendor/assets/Leaflet}/src/map/handler/Map.Keyboard.js +0 -0
  126. data/{lib/leaflet → vendor/assets/Leaflet}/src/map/handler/Map.ScrollWheelZoom.js +0 -0
  127. data/{lib/leaflet → vendor/assets/Leaflet}/src/map/handler/Map.Tap.js +0 -0
  128. data/{lib/leaflet → vendor/assets/Leaflet}/src/map/handler/Map.TouchZoom.js +1 -1
  129. data/vendor/assets/{stylesheets/leaflet-js.css → leaflet-js.css} +0 -0
  130. data/vendor/assets/{javascripts/leaflet-js.js → leaflet-js.js} +2 -2
  131. data/{lib/leaflet.label/libs/leaflet/leaflet.css → vendor/assets/leaflet.css.erb} +2 -2
  132. data/vendor/assets/{stylesheets/leaflet.draw.css.erb → leaflet.draw.css.erb} +2 -2
  133. data/{lib/leaflet.draw/dist → vendor/assets}/leaflet.draw.ie.css +0 -0
  134. data/vendor/assets/leaflet.draw.js +38 -0
  135. data/vendor/assets/leaflet.js +155 -0
  136. data/{lib/leaflet.label/dist → vendor/assets}/leaflet.label.css +0 -0
  137. data/vendor/assets/leaflet.label.js +11 -0
  138. metadata +139 -302
  139. data/lib/leaflet.draw/BREAKINGCHANGES.md +0 -54
  140. data/lib/leaflet.draw/CHANGELOG.md +0 -118
  141. data/lib/leaflet.draw/Jakefile.js +0 -26
  142. data/lib/leaflet.draw/MIT-LICENCE.txt +0 -20
  143. data/lib/leaflet.draw/README.md +0 -411
  144. data/lib/leaflet.draw/TODO.md +0 -62
  145. data/lib/leaflet.draw/build/build.html +0 -243
  146. data/lib/leaflet.draw/build/build.js +0 -189
  147. data/lib/leaflet.draw/build/deps.js +0 -76
  148. data/lib/leaflet.draw/build/hintrc.js +0 -47
  149. data/lib/leaflet.draw/build/leaflet.draw-include.js +0 -42
  150. data/lib/leaflet.draw/dist/leaflet.draw-src.js +0 -2782
  151. data/lib/leaflet.draw/dist/leaflet.draw.css +0 -244
  152. data/lib/leaflet.draw/dist/leaflet.draw.js +0 -10
  153. data/lib/leaflet.draw/examples/basic.html +0 -113
  154. data/lib/leaflet.draw/examples/edithandlers.html +0 -67
  155. data/lib/leaflet.draw/examples/libs/images/marker-icon@2x.png +0 -0
  156. data/lib/leaflet.draw/examples/libs/leaflet-src.js +0 -9108
  157. data/lib/leaflet.draw/examples/libs/leaflet.css +0 -478
  158. data/lib/leaflet.draw/package.json +0 -37
  159. data/lib/leaflet.draw/spec/after.js +0 -2
  160. data/lib/leaflet.draw/spec/before.js +0 -3
  161. data/lib/leaflet.draw/spec/expect.js +0 -1253
  162. data/lib/leaflet.draw/spec/happen.js +0 -93
  163. data/lib/leaflet.draw/spec/index.html +0 -36
  164. data/lib/leaflet.draw/spec/karma.conf.js +0 -69
  165. data/lib/leaflet.draw/spec/sinon.js +0 -4223
  166. data/lib/leaflet.draw/spec/suites/DrawControlSpec.js +0 -15
  167. data/lib/leaflet.draw/spec/suites/GeometryUtilSpec.js +0 -25
  168. data/lib/leaflet.draw/spec/suites/LatLngUtilSpec.js +0 -9
  169. data/lib/leaflet.draw/spec/suites/SpecHelper.js +0 -26
  170. data/lib/leaflet.draw/src/draw/DrawToolbar.js +0 -111
  171. data/lib/leaflet.label/CHANGELOG.md +0 -67
  172. data/lib/leaflet.label/Jakefile.js +0 -21
  173. data/lib/leaflet.label/MIT-LICENCE.txt +0 -20
  174. data/lib/leaflet.label/README.md +0 -103
  175. data/lib/leaflet.label/build/build.js +0 -155
  176. data/lib/leaflet.label/build/deps.js +0 -26
  177. data/lib/leaflet.label/build/hint.js +0 -30
  178. data/lib/leaflet.label/build/hintrc.js +0 -51
  179. data/lib/leaflet.label/dist/images/death.png +0 -0
  180. data/lib/leaflet.label/dist/leaflet.label-src.js +0 -542
  181. data/lib/leaflet.label/dist/leaflet.label.js +0 -9
  182. data/lib/leaflet.label/example/label.html +0 -85
  183. data/lib/leaflet.label/libs/leaflet/images/layers-2x.png +0 -0
  184. data/lib/leaflet.label/libs/leaflet/images/layers.png +0 -0
  185. data/lib/leaflet.label/libs/leaflet/images/marker-icon-2x.png +0 -0
  186. data/lib/leaflet.label/libs/leaflet/images/marker-icon.png +0 -0
  187. data/lib/leaflet.label/libs/leaflet/images/marker-icon@2x.png +0 -0
  188. data/lib/leaflet.label/libs/leaflet/images/marker-shadow.png +0 -0
  189. data/lib/leaflet.label/libs/leaflet/leaflet-src.js +0 -9108
  190. data/lib/leaflet.label/libs/leaflet/leaflet.js +0 -9
  191. data/lib/leaflet.label/package.json +0 -19
  192. data/lib/leaflet/CHANGELOG.md +0 -905
  193. data/lib/leaflet/CONTRIBUTING.md +0 -155
  194. data/lib/leaflet/FAQ.md +0 -138
  195. data/lib/leaflet/Jakefile.js +0 -46
  196. data/lib/leaflet/LICENSE +0 -23
  197. data/lib/leaflet/PLUGIN-GUIDE.md +0 -127
  198. data/lib/leaflet/README.md +0 -34
  199. data/lib/leaflet/build/build.html +0 -227
  200. data/lib/leaflet/build/build.js +0 -163
  201. data/lib/leaflet/build/deps.js +0 -259
  202. data/lib/leaflet/build/hintrc.js +0 -39
  203. data/lib/leaflet/debug/css/mobile.css +0 -6
  204. data/lib/leaflet/debug/css/screen.css +0 -5
  205. data/lib/leaflet/debug/hacks/jitter.html +0 -42
  206. data/lib/leaflet/debug/leaflet-include.js +0 -59
  207. data/lib/leaflet/debug/map/canvas.html +0 -46
  208. data/lib/leaflet/debug/map/controls.html +0 -49
  209. data/lib/leaflet/debug/map/geolocation.html +0 -34
  210. data/lib/leaflet/debug/map/iframe.html +0 -11
  211. data/lib/leaflet/debug/map/image-overlay.html +0 -43
  212. data/lib/leaflet/debug/map/map-mobile.html +0 -34
  213. data/lib/leaflet/debug/map/map.html +0 -59
  214. data/lib/leaflet/debug/map/max-bounds.html +0 -38
  215. data/lib/leaflet/debug/map/opacity.html +0 -223
  216. data/lib/leaflet/debug/map/scroll.html +0 -41
  217. data/lib/leaflet/debug/map/simple-proj.html +0 -44
  218. data/lib/leaflet/debug/map/wms-marble.html +0 -30
  219. data/lib/leaflet/debug/map/wms.html +0 -40
  220. data/lib/leaflet/debug/map/zoomlevels.html +0 -45
  221. data/lib/leaflet/debug/tests/add_remove_layers.html +0 -87
  222. data/lib/leaflet/debug/tests/bringtoback.html +0 -37
  223. data/lib/leaflet/debug/tests/canvasloop.html +0 -47
  224. data/lib/leaflet/debug/tests/click_on_canvas.html +0 -58
  225. data/lib/leaflet/debug/tests/click_on_canvas_broken.html +0 -49
  226. data/lib/leaflet/debug/tests/dragging_and_copyworldjump.html +0 -61
  227. data/lib/leaflet/debug/tests/opacity.html +0 -56
  228. data/lib/leaflet/debug/tests/popupcontextmenuclicks.html +0 -59
  229. data/lib/leaflet/debug/tests/remove_while_dragging.html +0 -28
  230. data/lib/leaflet/debug/tests/removetilewhilepan.html +0 -41
  231. data/lib/leaflet/debug/tests/reuse_popups.html +0 -40
  232. data/lib/leaflet/debug/tests/rtl.html +0 -42
  233. data/lib/leaflet/debug/tests/rtl2.html +0 -27
  234. data/lib/leaflet/debug/tests/set_icon_reuse_dom.html +0 -43
  235. data/lib/leaflet/debug/tests/svg_clicks.html +0 -54
  236. data/lib/leaflet/debug/vector/bounds-extend.html +0 -88
  237. data/lib/leaflet/debug/vector/feature-group-bounds.html +0 -90
  238. data/lib/leaflet/debug/vector/geojson-sample.js +0 -53
  239. data/lib/leaflet/debug/vector/geojson.html +0 -173
  240. data/lib/leaflet/debug/vector/rectangle.html +0 -53
  241. data/lib/leaflet/debug/vector/route.js +0 -1
  242. data/lib/leaflet/debug/vector/touchzoomemu.html +0 -194
  243. data/lib/leaflet/debug/vector/us-states.js +0 -54
  244. data/lib/leaflet/debug/vector/vector-bounds.html +0 -69
  245. data/lib/leaflet/debug/vector/vector-canvas.html +0 -92
  246. data/lib/leaflet/debug/vector/vector-mobile.html +0 -38
  247. data/lib/leaflet/debug/vector/vector-simple.html +0 -48
  248. data/lib/leaflet/debug/vector/vector.html +0 -37
  249. data/lib/leaflet/dist/images/layers-2x.png +0 -0
  250. data/lib/leaflet/dist/images/layers.png +0 -0
  251. data/lib/leaflet/dist/images/marker-icon-2x.png +0 -0
  252. data/lib/leaflet/dist/images/marker-icon.png +0 -0
  253. data/lib/leaflet/dist/images/marker-shadow.png +0 -0
  254. data/lib/leaflet/dist/leaflet.css +0 -478
  255. data/lib/leaflet/package.json +0 -27
  256. data/lib/leaflet/spec/after.js +0 -2
  257. data/lib/leaflet/spec/before.js +0 -3
  258. data/lib/leaflet/spec/expect.js +0 -1253
  259. data/lib/leaflet/spec/index.html +0 -86
  260. data/lib/leaflet/spec/karma.conf.js +0 -65
  261. data/lib/leaflet/spec/sinon.js +0 -4223
  262. data/lib/leaflet/spec/spec.hintrc.js +0 -25
  263. data/lib/leaflet/spec/suites/LeafletSpec.js +0 -13
  264. data/lib/leaflet/spec/suites/SpecHelper.js +0 -42
  265. data/lib/leaflet/spec/suites/control/Control.AttributionSpec.js +0 -68
  266. data/lib/leaflet/spec/suites/control/Control.LayersSpec.js +0 -67
  267. data/lib/leaflet/spec/suites/control/Control.ScaleSpec.js +0 -6
  268. data/lib/leaflet/spec/suites/core/ClassSpec.js +0 -156
  269. data/lib/leaflet/spec/suites/core/EventsSpec.js +0 -392
  270. data/lib/leaflet/spec/suites/core/UtilSpec.js +0 -256
  271. data/lib/leaflet/spec/suites/dom/DomEventSpec.js +0 -102
  272. data/lib/leaflet/spec/suites/dom/DomUtilSpec.js +0 -82
  273. data/lib/leaflet/spec/suites/dom/PosAnimationSpec.js +0 -27
  274. data/lib/leaflet/spec/suites/geo/CRSSpec.js +0 -47
  275. data/lib/leaflet/spec/suites/geo/LatLngBoundsSpec.js +0 -144
  276. data/lib/leaflet/spec/suites/geo/LatLngSpec.js +0 -132
  277. data/lib/leaflet/spec/suites/geo/ProjectionSpec.js +0 -48
  278. data/lib/leaflet/spec/suites/geometry/BoundsSpec.js +0 -87
  279. data/lib/leaflet/spec/suites/geometry/LineUtilSpec.js +0 -75
  280. data/lib/leaflet/spec/suites/geometry/PointSpec.js +0 -104
  281. data/lib/leaflet/spec/suites/geometry/PolyUtilSpec.js +0 -27
  282. data/lib/leaflet/spec/suites/geometry/TransformationSpec.js +0 -31
  283. data/lib/leaflet/spec/suites/layer/FeatureGroupSpec.js +0 -86
  284. data/lib/leaflet/spec/suites/layer/GeoJSONSpec.js +0 -282
  285. data/lib/leaflet/spec/suites/layer/LayerGroupSpec.js +0 -58
  286. data/lib/leaflet/spec/suites/layer/PopupSpec.js +0 -119
  287. data/lib/leaflet/spec/suites/layer/TileLayerSpec.js +0 -88
  288. data/lib/leaflet/spec/suites/layer/marker/MarkerSpec.js +0 -94
  289. data/lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js +0 -53
  290. data/lib/leaflet/spec/suites/layer/vector/CircleSpec.js +0 -17
  291. data/lib/leaflet/spec/suites/layer/vector/PolygonSpec.js +0 -91
  292. data/lib/leaflet/spec/suites/layer/vector/PolylineGeometrySpec.js +0 -35
  293. data/lib/leaflet/spec/suites/layer/vector/PolylineSpec.js +0 -55
  294. data/lib/leaflet/spec/suites/map/MapSpec.js +0 -536
  295. data/lib/leaflet/spec/suites/map/handler/Map.DragSpec.js +0 -38
  296. data/vendor/assets/images/layers-2x.png +0 -0
  297. data/vendor/assets/images/layers.png +0 -0
  298. data/vendor/assets/images/marker-icon-2x.png +0 -0
  299. data/vendor/assets/images/marker-icon.png +0 -0
  300. data/vendor/assets/images/marker-shadow.png +0 -0
  301. data/vendor/assets/images/spritesheet-2x.png +0 -0
  302. data/vendor/assets/images/spritesheet.png +0 -0
  303. data/vendor/assets/javascripts/leaflet.draw.js +0 -37
  304. data/vendor/assets/javascripts/leaflet.js +0 -147
  305. data/vendor/assets/javascripts/leaflet.label.js +0 -11
  306. data/vendor/assets/stylesheets/leaflet.css.erb +0 -478
  307. data/vendor/assets/stylesheets/leaflet.draw.ie.css +0 -49
  308. data/vendor/assets/stylesheets/leaflet.label.css +0 -52
@@ -1,155 +0,0 @@
1
- Contributing to Leaflet
2
- =======================
3
-
4
- 1. [Getting Involved](#getting-involved)
5
- 2. [Reporting Bugs](#reporting-bugs)
6
- 3. [Contributing Code](#contributing-code)
7
- 4. [Improving Documentation](#improving-documentation)
8
-
9
- ## Getting Involved
10
-
11
- Third-party patches are absolutely essential on our quest to create the best mapping library that will ever exist.
12
- However, they're not the only way to get involved with the development of Leaflet.
13
- You can help the project tremendously by discovering and [reporting bugs](#reporting-bugs),
14
- [improving documentation](#improving-documentation),
15
- helping others on the [Leaflet forum](https://groups.google.com/forum/#!forum/leaflet-js)
16
- and [GitHub issues](https://github.com/Leaflet/Leaflet/issues),
17
- showing your support for your favorite feature suggestions on [Leaflet UserVoice page](http://leaflet.uservoice.com),
18
- tweeting to [@LeafletJS](http://twitter.com/LeafletJS)
19
- and spreading the word about Leaflet among your colleagues and friends.
20
-
21
- ## Reporting Bugs
22
-
23
- Before reporting a bug on the project's [issues page](https://github.com/Leaflet/Leaflet/issues),
24
- first make sure that your issue is caused by Leaflet, not your application code
25
- (e.g. passing incorrect arguments to methods, etc.).
26
- Second, search the already reported issues for similar cases,
27
- and if it's already reported, just add any additional details in the comments.
28
-
29
- After you made sure that you've found a new Leaflet bug,
30
- here are some tips for creating a helpful report that will make fixing it much easier and quicker:
31
-
32
- * Write a **descriptive, specific title**. Bad: *Problem with polylines*. Good: *Doing X in IE9 causes Z*.
33
- * Include **browser, OS and Leaflet version** info in the description.
34
- * Create a **simple test case** that demonstrates the bug (e.g. using [JSFiddle](http://jsfiddle.net/)).
35
- * Check whether the bug can be reproduced in **other browsers**.
36
- * Check if the bug occurs in the stable version, master, or both.
37
- * *Bonus tip:* if the bug only appears in the master version but the stable version is fine,
38
- use `git bisect` to find the exact commit that introduced the bug.
39
-
40
- If you just want some help with your project,
41
- try asking [on the Leaflet forum](https://groups.google.com/forum/#!forum/leaflet-js) instead.
42
-
43
- ## Contributing Code
44
-
45
- ### Considerations for Accepting Patches
46
-
47
- While we happily accept patches, we're also commited to keeping Leaflet simple, lightweight and blazingly fast.
48
- So bugfixes, performance optimizations and small improvements that don't add a lot of code
49
- are much more likely to get accepted quickly.
50
-
51
- Before sending a pull request with a new feature, first check if it's been discussed before already
52
- (either on [GitHub issues](https://github.com/Leaflet/Leaflet/issues)
53
- or [Leaflet UserVoice](http://leaflet.uservoice.com/)),
54
- and then ask yourself two questions:
55
-
56
- 1. Are you sure that this new feature is important enough to justify its presense in the Leaflet core?
57
- Or will it look better as a plugin in a separate repository?
58
- 2. Is it written in a simple, concise way that doesn't add bulk to the codebase?
59
-
60
- If your feature or API improvement did get merged into master,
61
- please consider submitting another pull request with the corresponding [documentation update](#improving-documentation).
62
-
63
- ### Setting up the Build System
64
-
65
- To set up the Leaflet build system, install [Node](http://nodejs.org/),
66
- then run the following commands in the project root:
67
-
68
- ```
69
- npm install -g jake
70
- npm install
71
- ```
72
-
73
- You can build minified Leaflet by running `jake` (it will be built from source in the `dist` folder).
74
- For a custom build with selected components, open `build/build.html` in the browser and follow the instructions from there.
75
-
76
- ### Making Changes to Leaflet Source
77
-
78
- If you're not yet familiar with the way GitHub works (forking, pull requests, etc.),
79
- be sure to check out the awesome [article about forking](https://help.github.com/articles/fork-a-repo)
80
- on the GitHub Help website — it will get you started quickly.
81
-
82
- You should always write each batch of changes (feature, bugfix, etc.) in **its own topic branch**.
83
- Please do not commit to the `master` branch, or your unrelated changes will go into the same pull request.
84
-
85
- You should also follow the code style and whitespace conventions of the original codebase.
86
- In particular, use tabs for indentation and spaces for alignment.
87
-
88
- Before commiting your changes, run `jake lint` to catch any JS errors in the code and fix them.
89
- If you add any new files to the Leaflet source, make sure to also add them to `build/deps.js`
90
- so that the build system knows about them.
91
-
92
- Also, please make sure that you have [line endings configured properly](https://help.github.com/articles/dealing-with-line-endings) in Git! Otherwise the diff will show that all lines of a file were changed even if you touched only one.
93
-
94
- Happy coding!
95
-
96
- ## Running the Tests
97
-
98
- To run the tests from the command line,
99
- install [PhantomJS](http://phantomjs.org/) (and make sure it's in your `PATH`),
100
- then run:
101
-
102
- ```
103
- jake test
104
- ```
105
-
106
- To run all the tests in actual browsers at the same time, you can do:
107
-
108
- ```
109
- jake test --ff --chrome --safari --ie
110
- ```
111
-
112
- To run the tests in a browser manually, open `spec/index.html`.
113
-
114
- ## Code Coverage
115
-
116
- To generate a detailed report about test coverage (which helps tremendously when working on test improvements), run:
117
-
118
- ```
119
- jake test --cov
120
- ```
121
-
122
- After that, open `spec/coverage/<environment>/index.html` in a browser to see the report.
123
- From there you can click through folders/files to get details on their individual coverage.
124
-
125
- ## Improving Documentation
126
-
127
- The code of the live Leaflet website that contains all documentation and examples is located in the `gh-pages` branch
128
- and is automatically generated from a set of HTML and Markdown files by [Jekyll](https://github.com/mojombo/jekyll).
129
-
130
- The easiest way to make little improvements such as fixing typos without even leaving the browser
131
- is by editing one of the files with the online GitHub editor:
132
- browse the [gh-pages branch](https://github.com/Leaflet/Leaflet/tree/gh-pages),
133
- choose a certain file for editing (e.g. `reference.html` for API reference),
134
- click the Edit button, make changes and follow instructions from there.
135
- Once it gets merged, the changes will immediately appear on the website.
136
-
137
- If you need to make edits in a local repository to see how it looks in the process, do the following:
138
-
139
- 1. [Install Ruby](http://www.ruby-lang.org/en/) if don't have it yet.
140
- 2. Run `gem install jekyll`.
141
- 3. Run `jekyll serve --watch` in the root `Leaflet` folder.
142
- 4. Open `localhost:4000` in your browser.
143
-
144
- Now any file changes will be updated when you reload pages automatically.
145
- After commiting the changes, just send a pull request.
146
-
147
- If you need to update documentation according to a new feature that only appeared in the master version (not stable one),
148
- you need to make changes to `gh-pages-master` branch instead of `gh-pages`.
149
- It will get merged into the latter when released as stable.
150
-
151
- ## Thank You
152
-
153
- Not only are we grateful for any contributions, &mdash; helping Leaflet and its community actually makes you AWESOME.
154
- Join [this approved list of awesome people](https://github.com/Leaflet/Leaflet/graphs/contributors)
155
- and help us push the limits of what's possible with online maps!
@@ -1,138 +0,0 @@
1
- # Leaflet FAQ
2
-
3
- This is a collection of answers to the most frequently asked questions about Leaflet.
4
-
5
- 1. [Data Providers](#data-providers)
6
- 2. [Commercial Use and Licensing](#commercial-use-and-licensing)
7
- 3. [Features](#features)
8
- 4. [Performance](#performance)
9
- 5. [Misc](#misc)
10
-
11
- ## Data Providers
12
-
13
- #### The map is wrong in my neighborhood, could you fix it?
14
-
15
- Nope, but you can.
16
- The map you see on Leaflet examples is based on [OpenStreetMap](http://openstreetmap.org),
17
- a free editable map of the world.
18
- Signing up and editing the map there is easy,
19
- and the changes will be reflected on the map in a few minutes.
20
-
21
- #### What map tiles can I use with Leaflet? Is it limited to OpenStreetMap?
22
-
23
- Leaflet is provider-agnostic, meaning you can use any map provider as long as you conform to its terms of use.
24
- You can roll your own tiles as well.
25
- [OpenStreetMap](http://openstreetmap.org) is the most popular data source among different tile providers,
26
- but there are providers that use other sources.
27
-
28
- Check out [this example](http://leaflet-extras.github.io/leaflet-providers/preview/)
29
- with half a hundred different layers to choose from.
30
- Popular commercial options, free up to a particular number of requests, include
31
- [MapBox](http://mapbox.com),
32
- [CloudMade](http://cloudmade.com),
33
- [Bing Maps](http://www.microsoft.com/maps/choose-your-binge's-maps-API.aspx) (using a [plugin](https://github.com/shramov/leaflet-plugins)),
34
- [Esri ArcGIS](http://www.arcgis.com/features/maps/imagery.html) ([official plugin](https://github.com/Esri/esri-leaflet))
35
- and [Nokia Here](http://developer.here.com/web-experiences).
36
- A notable exception is [MapQuest Open](http://developer.mapquest.com/web/products/open/map), which is free for any number of requests.
37
-
38
- Always be sure to **read the terms of use** of a chosen tile provider, **know its limitations**, and **attribute it properly** in your app.
39
-
40
- #### I'm looking for satellite imagery to use with my Leaflet map, any options?
41
-
42
- [MapBox](http://mapbox.com),
43
- [Bing Maps](http://www.microsoft.com/maps/choose-your-bing-maps-API.aspx),
44
- [ArcGIS](http://www.arcgis.com/features/maps/imagery.html)
45
- and [MapQuest Open](http://developer.mapquest.com/web/products/open/map) provide satellite imagery among others.
46
-
47
- #### I want to use Google Maps API tiles with Leaflet, can I do that?
48
-
49
- The problem with Google is that its [Terms of Use](https://developers.google.com/maps/terms?hl=ru) forbid any means of tile access other than through the Google Maps API.
50
-
51
- You can add the Google Maps API as a Leaflet layer with a [plugin](https://github.com/shramov/leaflet-plugins). But note that the map experience will not be perfect, because Leaflet will just act as a proxy to the Google Maps JS engine, so you won't get all the performance and usability benefits of using Leaflet when the Google layer is on.
52
-
53
- #### I want to roll my own OSM tile server for Leaflet, where do I start?
54
-
55
- Check out [this excellent guide](http://switch2osm.org/serving-tiles/).
56
-
57
- #### I want to create tiles from my own data for use with Leaflet, what are the options?
58
-
59
- There's a number of services that allow you to do this easily,
60
- notably [MapBox](https://www.mapbox.com/), [CartoDB](http://cartodb.com/) and [GIS Cloud](http://www.giscloud.com/).
61
- If you want to make tiles on your own, probably the easiest way is using [TileMill](https://www.mapbox.com/tilemill/).
62
- TileMill can export your map as a single [.mbtiles](https://www.mapbox.com/developers/mbtiles/) file, which can be copied to a webserver and accessed by Leaflet with [a small PHP script](https://github.com/infostreams/mbtiles-php).
63
- Alternatively, you can [extract](https://github.com/mapbox/mbutil) the tiled images from the .mbtiles database and place them directly on your webserver with absolutely no server-side dependencies.
64
-
65
- ## Commercial Use and Licensing
66
-
67
- #### I have an app that gets lots of hits a day, and I want to switch from Google/Bing/whatever to Leaflet. Is there a fee for using it?
68
-
69
- Leaflet, unlike Google Maps and other all-in-one solutions, is just a JavaScript library.
70
- It's free to use, but doesn't provide map imagery on its own &mdash;
71
- you have to choose a tile service to combine with it.
72
-
73
- There are [plenty of options](#what-map-tiles-can-i-use-with-leaflet-is-it-limited-to-openstreetmap) for a tile service,
74
- each with their own terms of use, prices (some of them free), features, limitations, etc.
75
- Choice is yours.
76
-
77
- #### I'm building a commercial app that I plan to sell. Can I use Leaflet in it?
78
-
79
- You're welcome, as the code is published under the very permissive [2-clause BSD License](https://github.com/Leaflet/Leaflet/blob/master/LICENSE).
80
- Just make sure to attribute the use of the library somewhere in the app UI or the distribution
81
- (e.g. keep the Leaflet link on the map, or mention the use on the About page or a Readme file, etc.) and you'll be fine.
82
-
83
- That only applies to the code though.
84
- Make sure you conform to the terms of use of the tile images provider(s) that you choose as well.
85
-
86
-
87
- ## Features
88
-
89
- #### Why is there still no feature X in Leaflet?
90
-
91
- First of all, did you check out the [Leaflet plugins page](http://leafletjs.com/plugins.html)?
92
- It lists about a hundred plugins doing all kinds of crazy stuff,
93
- and there's a high possibility that it has what you're looking for.
94
-
95
- Generally, we do our best to keep the Leaflet core small, lightweight and simple,
96
- focusing on _quality_ instead of _quantity_, and leaving all the rest to plugin authors.
97
-
98
- Check out [this video](http://www.youtube.com/watch?v=_P2SaCPbJ4w) of a talk by the Leaflet creator for more background on the story and philosophy behind Leaflet.
99
- Another essential read is [Advocating Simplicity in Open Source](http://blog.universalmind.com/advocating-simplicity-in-open-source/) by the same guy.
100
-
101
-
102
- ## Performance
103
-
104
- #### I have thousands of markers on my map. How do I make it faster and more usable?
105
-
106
- Check out the [Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster) plugin. It's amazing.
107
-
108
- #### I have vector data with many thousands of points on my map. Any performance tips?
109
-
110
- Leaflet generally does a pretty good job of handling heavy vector data
111
- with its real-time clipping and simplification algorithms,
112
- but browser technology still has its limits.
113
- Try [switching from SVG to Canvas as the default rendering back-end](http://leafletjs.com/reference.html#global),
114
- it may help considerably (depends on the app and the data).
115
-
116
- If you still have too much data to render, you'll have to use some help of a server-side service
117
- like [MapBox](https://www.mapbox.com/),
118
- [CartoDB](http://cartodb.com/)
119
- and [GIS Cloud](http://www.giscloud.com/)
120
- (they all work great with Leaflet).
121
- What they do under the hood is serving rendered data as image tiles,
122
- along with additional data to enable interactivity like hovering shapes
123
- (e.g. done using [UTFGrid](https://www.mapbox.com/developers/utfgrid/) &mdash;
124
- Leaflet [has a nice plugin](https://github.com/danzel/Leaflet.utfgrid) for it).
125
-
126
-
127
- ## Misc
128
-
129
- #### I downloaded the Leaflet source but didn't find `leaflet.js` there. Why is that?
130
-
131
- You can download the built versions using links from the [download page](http://leafletjs.com/download.html).
132
- It even includes the latest build of the development version (`master` branch),
133
- updated automatically on each commit to the repo.
134
-
135
- We removed the built versions from the repository because it's a chore to build and commit them manually on each change,
136
- and it often complicates merging branches and managing contributions.
137
-
138
- There's a common complaint that Leaflet can't be used with [Bower](http://bower.io/) because of that, but we'll resolve the issue soon.
@@ -1,46 +0,0 @@
1
- /*
2
- Leaflet building, testing and linting scripts.
3
-
4
- To use, install Node, then run the following commands in the project root:
5
-
6
- npm install -g jake
7
- npm install
8
-
9
- To check the code for errors and build Leaflet from source, run "jake".
10
- To run the tests, run "jake test".
11
-
12
- For a custom build, open build/build.html in the browser and follow the instructions.
13
- */
14
-
15
- var build = require('./build/build.js');
16
-
17
- function hint(msg, paths) {
18
- return function () {
19
- console.log(msg);
20
- jake.exec('node node_modules/jshint/bin/jshint -c ' + paths,
21
- {printStdout: true}, function () {
22
- console.log('\tCheck passed.\n');
23
- complete();
24
- });
25
- }
26
- }
27
-
28
- desc('Check Leaflet source for errors with JSHint');
29
- task('lint', {async: true}, hint('Checking for JS errors...', 'build/hintrc.js src'));
30
-
31
- desc('Check Leaflet specs source for errors with JSHint');
32
- task('lintspec', {async: true}, hint('Checking for specs JS errors...', 'spec/spec.hintrc.js spec/suites'));
33
-
34
- desc('Combine and compress Leaflet source files');
35
- task('build', build.build);
36
-
37
- desc('Run PhantomJS tests');
38
- task('test', ['lint', 'lintspec'], {async: true}, function () {
39
- build.test(complete);
40
- });
41
-
42
- task('default', ['test', 'build']);
43
-
44
- jake.addListener('complete', function () {
45
- process.exit();
46
- });
@@ -1,23 +0,0 @@
1
- Copyright (c) 2010-2013, Vladimir Agafonkin
2
- Copyright (c) 2010-2011, CloudMade
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without modification, are
6
- permitted provided that the following conditions are met:
7
-
8
- 1. Redistributions of source code must retain the above copyright notice, this list of
9
- conditions and the following disclaimer.
10
-
11
- 2. Redistributions in binary form must reproduce the above copyright notice, this list
12
- of conditions and the following disclaimer in the documentation and/or other materials
13
- provided with the distribution.
14
-
15
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
16
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
18
- COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
22
- TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,127 +0,0 @@
1
- # Leaflet Plugin Authoring Guide
2
-
3
- One of the greatest things about Leaflet is its powerful plugin ecosystem.
4
- The [Leaflet plugins page](http://leafletjs.com/plugins.html) lists dozens of awesome plugins, and more are being added every week.
5
-
6
- This guide lists a number of best practices for publishing a Leaflet plugin that meets the quality standards of Leaflet itself.
7
-
8
- 1. [Presentation](#presentation)
9
- - [Repository](#repository)
10
- - [Name](#name)
11
- - [Demo](#demo)
12
- - [Readme](#readme)
13
- - [License](#license)
14
- 2. [Code](#code)
15
- - [File Structure](#file-structure)
16
- - [Code Conventions](#code-conventions)
17
- - [Plugin API](#plugin-api)
18
-
19
- ## Presentation
20
-
21
- ### Repository
22
-
23
- The best place to put your Leaflet plugin to is a separate [GitHub](http://github.com) repository.
24
- If you create a collection of plugins for different uses,
25
- don't put them in one repo &mdash;
26
- it's usually easier to work with small, self-contained plugins in individual repositories.
27
-
28
- ### Name
29
-
30
- Most existing plugins follow the convention of naming plugins (and repos) like this: `Leaflet.MyPluginName`.
31
- You can use other forms (e.g. "leaflet-my-plugin-name"),
32
- just make sure to include the word "Leaflet" in the name so that it's obvious that it's a Leaflet plugin.
33
-
34
- ### Demo
35
-
36
- The most essential thing to do when publishing a plugin is to include a demo that showcases what the plugin does &mdash;
37
- it's usually the first thing people will look for.
38
-
39
- The easiest way to put up a demo is using [GitHub Pages](http://pages.github.com/).
40
- A good [starting point](https://help.github.com/articles/creating-project-pages-manually) is creating a `gh-pages` branch in your repo and adding an `index.html` page to it &mdash;
41
- after pushing, it'll be published as `http://<user>.github.io/<repo>`.
42
-
43
- ### Readme
44
-
45
- The next thing you need to have is a descriptive `README.md` in the root of the repo (or a link to a website with a similar content).
46
- At a minimum it should contain the following items:
47
-
48
- - name of the plugin
49
- - a simple, concise description of what it does
50
- - requirements
51
- - Leaflet version
52
- - other external dependencies (if any)
53
- - browser / device compatibility
54
- - links to demos
55
- - instructions for including the plugin
56
- - simple usage code example
57
- - API reference (methods, options, events)
58
-
59
- ### License
60
-
61
- Every open source repository should include a license.
62
- If you don't know what open source license to choose for your code,
63
- [MIT License](http://opensource.org/licenses/MIT) and [BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause) are both good choices.
64
- You can either put it in the repo as a `LICENSE` file or just link to the license from the Readme.
65
-
66
- ## Code
67
-
68
- ### File Structure
69
-
70
- Keep the file structure clean and simple,
71
- don't pile up lots of files in one place &mdash;
72
- make it easy for a new person to find their way in your repo.
73
-
74
- A barebones repo for a simple plugin would look like this:
75
-
76
- ```
77
- my-plugin.js
78
- README.md
79
- ```
80
-
81
- An example of a more sophisticated plugin file structure:
82
-
83
- ```
84
- /src - JS source files
85
- /dist - minified plugin JS, CSS, images
86
- /spec - test files
87
- /lib - any external libraries/plugins if necessary
88
- /examples - HTML examples of plugin usage
89
- README.md
90
- LICENSE
91
- package.json
92
- ```
93
-
94
- ### Code Conventions
95
-
96
- Everyone's tastes are different, but it's important to be consistent with whatever conventions you choose for your plugin.
97
-
98
- For a good starting point, check out [Airbnb JavaScript Guide](https://github.com/airbnb/javascript).
99
- Leaflet follows pretty much the same conventions
100
- except for using smart tabs (hard tabs for indentation, spaces for alignment)
101
- and putting a space after the `function` keyword.
102
-
103
- ### Plugin API
104
-
105
- Never expose global variables in your plugin.<br>
106
- If you have a new class, put it directly in the `L` namespace (`L.MyPlugin`).<br>
107
- If you inherit one of the existing classes, make it a sub-property (`L.TileLayer.Banana`).<br>
108
- If you want to add new methods to existing Leaflet classes, you can do it like this: `L.Marker.include({myPlugin: …})`.
109
-
110
- Function, method and property names should be in `camelCase`.<br>
111
- Class names should be in `CapitalizedCamelCase`.
112
-
113
- If you have a lot of arguments in your function, consider accepting an options object instead
114
- (putting default values where possible so that users don't need specify all of them):
115
-
116
- ```js
117
- // bad
118
- marker.myPlugin('bla', 'foo', null, {}, 5, 0);
119
-
120
- // good
121
- marker.myPlugin('bla', {
122
- optionOne: 'foo',
123
- optionThree: 5
124
- });
125
- ```
126
-
127
- And most importantly, keep it simple. Leaflet is all about *simplicity*.