columbus3 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (344) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/README.md +122 -0
  4. data/bin/console +0 -0
  5. data/bin/setup +0 -0
  6. data/bower.json +25 -0
  7. data/bower_components/jquery/.bower.json +7 -20
  8. data/bower_components/jquery/AUTHORS.txt +301 -0
  9. data/bower_components/jquery/{MIT-LICENSE.txt → LICENSE.txt} +17 -2
  10. data/bower_components/jquery/README.md +67 -0
  11. data/bower_components/jquery/bower.json +2 -16
  12. data/bower_components/jquery/dist/core.js +476 -0
  13. data/bower_components/jquery/dist/jquery.js +3861 -2818
  14. data/bower_components/jquery/dist/jquery.min.js +4 -5
  15. data/bower_components/jquery/dist/jquery.min.map +1 -1
  16. data/bower_components/jquery/dist/jquery.slim.js +8160 -0
  17. data/bower_components/jquery/dist/jquery.slim.min.js +4 -0
  18. data/bower_components/jquery/dist/jquery.slim.min.map +1 -0
  19. data/bower_components/jquery/external/sizzle/LICENSE.txt +36 -0
  20. data/bower_components/jquery/{src → external}/sizzle/dist/sizzle.js +445 -240
  21. data/bower_components/jquery/external/sizzle/dist/sizzle.min.js +3 -0
  22. data/bower_components/jquery/external/sizzle/dist/sizzle.min.map +1 -0
  23. data/bower_components/jquery/src/.eslintrc.json +5 -0
  24. data/bower_components/jquery/src/ajax.js +174 -105
  25. data/bower_components/jquery/src/ajax/jsonp.js +27 -14
  26. data/bower_components/jquery/src/ajax/load.js +24 -23
  27. data/bower_components/jquery/src/ajax/parseXML.js +8 -6
  28. data/bower_components/jquery/src/ajax/script.js +25 -12
  29. data/bower_components/jquery/src/ajax/var/location.js +5 -0
  30. data/bower_components/jquery/src/ajax/var/nonce.js +4 -2
  31. data/bower_components/jquery/src/ajax/var/rquery.js +5 -3
  32. data/bower_components/jquery/src/ajax/xhr.js +76 -43
  33. data/bower_components/jquery/src/attributes.js +4 -2
  34. data/bower_components/jquery/src/attributes/attr.js +60 -60
  35. data/bower_components/jquery/src/attributes/classes.js +87 -71
  36. data/bower_components/jquery/src/attributes/prop.js +81 -32
  37. data/bower_components/jquery/src/attributes/support.js +11 -13
  38. data/bower_components/jquery/src/attributes/val.js +66 -37
  39. data/bower_components/jquery/src/callbacks.js +119 -90
  40. data/bower_components/jquery/src/core.js +108 -134
  41. data/bower_components/jquery/src/core/DOMEval.js +16 -0
  42. data/bower_components/jquery/src/core/access.js +21 -11
  43. data/bower_components/jquery/src/core/init.js +33 -28
  44. data/bower_components/jquery/src/core/nodeName.js +13 -0
  45. data/bower_components/jquery/src/core/parseHTML.js +39 -13
  46. data/bower_components/jquery/src/core/ready-no-deferred.js +96 -0
  47. data/bower_components/jquery/src/core/ready.js +40 -51
  48. data/bower_components/jquery/src/core/readyException.js +13 -0
  49. data/bower_components/jquery/src/core/stripAndCollapse.js +14 -0
  50. data/bower_components/jquery/src/core/support.js +20 -0
  51. data/bower_components/jquery/src/core/var/rsingleTag.js +5 -3
  52. data/bower_components/jquery/src/css.js +146 -158
  53. data/bower_components/jquery/src/css/addGetHookIf.js +7 -3
  54. data/bower_components/jquery/src/css/adjustCSS.js +71 -0
  55. data/bower_components/jquery/src/css/curCSS.js +22 -14
  56. data/bower_components/jquery/src/css/hiddenVisibleSelectors.js +8 -8
  57. data/bower_components/jquery/src/css/showHide.js +105 -0
  58. data/bower_components/jquery/src/css/support.js +69 -76
  59. data/bower_components/jquery/src/css/var/cssExpand.js +4 -2
  60. data/bower_components/jquery/src/css/var/getStyles.js +11 -6
  61. data/bower_components/jquery/src/css/var/isHiddenWithinTree.js +34 -0
  62. data/bower_components/jquery/src/css/var/rmargin.js +5 -3
  63. data/bower_components/jquery/src/css/var/rnumnonpx.js +4 -2
  64. data/bower_components/jquery/src/css/{swap.js → var/swap.js} +5 -7
  65. data/bower_components/jquery/src/data.js +67 -66
  66. data/bower_components/jquery/src/data/Data.js +87 -107
  67. data/bower_components/jquery/src/data/{accepts.js → var/acceptData.js} +6 -7
  68. data/bower_components/jquery/src/data/var/{data_priv.js → dataPriv.js} +4 -2
  69. data/bower_components/jquery/src/data/var/{data_user.js → dataUser.js} +4 -2
  70. data/bower_components/jquery/src/deferred.js +314 -72
  71. data/bower_components/jquery/src/deferred/exceptionHook.js +21 -0
  72. data/bower_components/jquery/src/deprecated.js +36 -9
  73. data/bower_components/jquery/src/dimensions.js +16 -10
  74. data/bower_components/jquery/src/effects.js +257 -206
  75. data/bower_components/jquery/src/effects/Tween.js +18 -9
  76. data/bower_components/jquery/src/effects/animatedSelector.js +7 -5
  77. data/bower_components/jquery/src/event.js +297 -419
  78. data/bower_components/jquery/src/event/ajax.js +13 -4
  79. data/bower_components/jquery/src/event/alias.js +13 -23
  80. data/bower_components/jquery/src/event/focusin.js +55 -0
  81. data/bower_components/jquery/src/event/support.js +5 -3
  82. data/bower_components/jquery/src/event/trigger.js +185 -0
  83. data/bower_components/jquery/src/exports/amd.js +5 -3
  84. data/bower_components/jquery/src/exports/global.js +8 -6
  85. data/bower_components/jquery/src/jquery.js +6 -2
  86. data/bower_components/jquery/src/manipulation.js +218 -310
  87. data/bower_components/jquery/src/manipulation/_evalUrl.js +9 -4
  88. data/bower_components/jquery/src/manipulation/buildFragment.js +104 -0
  89. data/bower_components/jquery/src/manipulation/getAll.js +32 -0
  90. data/bower_components/jquery/src/manipulation/setGlobalEval.js +22 -0
  91. data/bower_components/jquery/src/manipulation/support.js +11 -8
  92. data/bower_components/jquery/src/manipulation/var/rcheckableType.js +5 -3
  93. data/bower_components/jquery/src/manipulation/var/rscriptType.js +5 -0
  94. data/bower_components/jquery/src/manipulation/var/rtagName.js +5 -0
  95. data/bower_components/jquery/src/manipulation/wrapMap.js +29 -0
  96. data/bower_components/jquery/src/offset.js +75 -53
  97. data/bower_components/jquery/src/queue.js +26 -23
  98. data/bower_components/jquery/src/queue/delay.js +8 -6
  99. data/bower_components/jquery/src/selector-native.js +133 -68
  100. data/bower_components/jquery/src/selector-sizzle.js +10 -5
  101. data/bower_components/jquery/src/selector.js +3 -1
  102. data/bower_components/jquery/src/serialize.js +52 -33
  103. data/bower_components/jquery/src/traversing.js +61 -69
  104. data/bower_components/jquery/src/traversing/findFilter.js +37 -31
  105. data/bower_components/jquery/src/traversing/var/dir.js +22 -0
  106. data/bower_components/jquery/src/traversing/var/rneedsContext.js +4 -2
  107. data/bower_components/jquery/src/traversing/var/siblings.js +17 -0
  108. data/bower_components/jquery/src/var/ObjectFunctionString.js +7 -0
  109. data/bower_components/jquery/src/var/arr.js +4 -2
  110. data/bower_components/jquery/src/var/class2type.js +4 -2
  111. data/bower_components/jquery/src/var/concat.js +4 -2
  112. data/bower_components/jquery/src/var/document.js +5 -0
  113. data/bower_components/jquery/src/var/documentElement.js +7 -0
  114. data/bower_components/jquery/src/var/fnToString.js +7 -0
  115. data/bower_components/jquery/src/var/getProto.js +5 -0
  116. data/bower_components/jquery/src/var/hasOwn.js +4 -2
  117. data/bower_components/jquery/src/var/indexOf.js +4 -2
  118. data/bower_components/jquery/src/var/pnum.js +5 -3
  119. data/bower_components/jquery/src/var/push.js +4 -2
  120. data/bower_components/jquery/src/var/rcssNum.js +9 -0
  121. data/bower_components/jquery/src/var/rnothtmlwhite.js +8 -0
  122. data/bower_components/jquery/src/var/slice.js +4 -2
  123. data/bower_components/jquery/src/var/support.js +4 -2
  124. data/bower_components/jquery/src/var/toString.js +4 -2
  125. data/bower_components/jquery/src/wrap.js +24 -26
  126. data/bower_components/leaflet-providers/.bower.json +6 -7
  127. data/bower_components/leaflet-providers/CHANGELOG.md +62 -0
  128. data/bower_components/leaflet-providers/README.md +12 -3
  129. data/bower_components/leaflet-providers/bower.json +1 -1
  130. data/bower_components/leaflet-providers/leaflet-providers.js +133 -92
  131. data/bower_components/leaflet-providers/package.json +14 -7
  132. data/bower_components/leaflet/.bower.json +10 -14
  133. data/bower_components/leaflet/CHANGELOG.md +648 -3
  134. data/bower_components/leaflet/CONTRIBUTING.md +88 -33
  135. data/bower_components/leaflet/ISSUE_TEMPLATE.md +25 -0
  136. data/bower_components/leaflet/Jakefile.js +73 -14
  137. data/bower_components/leaflet/LICENSE +1 -1
  138. data/bower_components/leaflet/PLUGIN-GUIDE.md +97 -3
  139. data/bower_components/leaflet/README.md +6 -8
  140. data/bower_components/leaflet/bower.json +3 -9
  141. data/bower_components/leaflet/dist/images/layers-2x.png +0 -0
  142. data/bower_components/leaflet/dist/images/layers.png +0 -0
  143. data/bower_components/leaflet/dist/images/marker-icon-2x.png +0 -0
  144. data/bower_components/leaflet/dist/images/marker-icon.png +0 -0
  145. data/bower_components/leaflet/dist/images/marker-shadow.png +0 -0
  146. data/bower_components/leaflet/dist/leaflet-src.js +12301 -7898
  147. data/bower_components/leaflet/dist/leaflet-src.js.map +1 -0
  148. data/bower_components/leaflet/dist/leaflet.css +196 -43
  149. data/bower_components/leaflet/dist/leaflet.js +6 -9
  150. data/bower_components/leaflet/dist/leaflet.js.map +1 -0
  151. data/bower_components/leaflet/docs/CNAME +1 -0
  152. data/bower_components/leaflet/docs/Gemfile +4 -0
  153. data/bower_components/leaflet/docs/_config.yml +19 -0
  154. data/bower_components/leaflet/docs/_includes/frame.html +9 -0
  155. data/bower_components/leaflet/docs/_includes/tutorial_link.html +8 -0
  156. data/bower_components/leaflet/docs/_layouts/post.html +30 -0
  157. data/bower_components/leaflet/docs/_layouts/redirected.html +14 -0
  158. data/bower_components/leaflet/docs/_layouts/tutorial.html +9 -0
  159. data/bower_components/leaflet/docs/_layouts/tutorial_frame.html +32 -0
  160. data/bower_components/leaflet/docs/_layouts/tutorial_v2.html +9 -0
  161. data/bower_components/leaflet/docs/_layouts/v2.html +159 -0
  162. data/bower_components/leaflet/docs/_posts/2012-07-30-leaflet-0-4-released.md +240 -0
  163. data/bower_components/leaflet/docs/_posts/2012-08-07-leaflet-0-4-3-and-a-new-tutorial.md +47 -0
  164. data/bower_components/leaflet/docs/_posts/2012-08-20-guest-post-markerclusterer-0-1-released.md +112 -0
  165. data/bower_components/leaflet/docs/_posts/2012-10-25-leaflet-0-4-5-bugfix-release-and-plans-for-0.5.md +36 -0
  166. data/bower_components/leaflet/docs/_posts/2013-01-17-leaflet-0-5-released.md +24 -0
  167. data/bower_components/leaflet/docs/_posts/2013-02-20-guest-post-draw.md +146 -0
  168. data/bower_components/leaflet/docs/_posts/2013-06-26-leaflet-0-6-released-dc-code-sprint-mapbox.md +31 -0
  169. data/bower_components/leaflet/docs/_posts/2013-06-28-leaflet-plugin-authoring-guide.md +111 -0
  170. data/bower_components/leaflet/docs/_posts/2013-11-18-leaflet-0-7-released-plans-for-future.md +56 -0
  171. data/bower_components/leaflet/docs/_posts/2015-07-01-leaflet-is-alive-and-kicking.md +21 -0
  172. data/bower_components/leaflet/docs/_posts/2015-07-15-leaflet-1.0-beta1-released.md +60 -0
  173. data/bower_components/leaflet/docs/_posts/2015-09-01-leaflet-0.7.4-released.md +29 -0
  174. data/bower_components/leaflet/docs/_posts/2015-10-14-leaflet-1.0-beta2-released.md +35 -0
  175. data/bower_components/leaflet/docs/_posts/2016-03-20-debugging-touch-interactions.md +101 -0
  176. data/bower_components/leaflet/docs/_posts/2016-04-18-leaflet-1.0-rc1.md +78 -0
  177. data/bower_components/leaflet/docs/_posts/2016-07-16-leaflet-1.0-rc2.md +60 -0
  178. data/bower_components/leaflet/docs/_posts/2016-08-05-leaflet-1.0-rc3.md +53 -0
  179. data/bower_components/leaflet/docs/_posts/2016-09-27-leaflet-1.0-final.md +50 -0
  180. data/bower_components/leaflet/docs/_posts/2016-11-21-leaflet-1.0.2.md +25 -0
  181. data/bower_components/leaflet/docs/_posts/2017-01-23-leaflet-1.0.3.md +27 -0
  182. data/bower_components/leaflet/docs/atom.xml +29 -0
  183. data/bower_components/leaflet/docs/blog.md +24 -0
  184. data/bower_components/leaflet/docs/docs/css/main.css +1092 -0
  185. data/bower_components/leaflet/docs/docs/css/normalize.css +426 -0
  186. data/bower_components/leaflet/docs/docs/highlight/LICENSE +24 -0
  187. data/bower_components/leaflet/docs/docs/highlight/highlight.pack.js +1 -0
  188. data/bower_components/leaflet/docs/docs/highlight/styles/github-gist.css +211 -0
  189. data/bower_components/leaflet/docs/docs/images/2016-03-20-prosthetic-hand-zooming.gif +0 -0
  190. data/bower_components/leaflet/docs/docs/images/2016-04-18-inheritances.gif +0 -0
  191. data/bower_components/leaflet/docs/docs/images/2016-04-18-leaflet-toilet-paper.jpeg +0 -0
  192. data/bower_components/leaflet/docs/docs/images/2016-04-18-madrid-leaflet-864px.jpg +0 -0
  193. data/bower_components/leaflet/docs/docs/images/2016-07-18-remote-session.png +0 -0
  194. data/bower_components/leaflet/docs/docs/images/2016-07-18-tooltip.png +0 -0
  195. data/bower_components/leaflet/docs/docs/images/2016-08-03-iraq-hacking.jpg +0 -0
  196. data/bower_components/leaflet/docs/docs/images/favicon.ico +0 -0
  197. data/bower_components/leaflet/docs/docs/images/forum-round.png +0 -0
  198. data/bower_components/leaflet/docs/docs/images/github-round.png +0 -0
  199. data/bower_components/leaflet/docs/docs/images/logo.png +0 -0
  200. data/bower_components/leaflet/docs/docs/images/logos.png +0 -0
  201. data/bower_components/leaflet/docs/docs/images/sprite.png +0 -0
  202. data/bower_components/leaflet/docs/docs/images/sprite.svg +75 -0
  203. data/bower_components/leaflet/docs/docs/images/twitter-round.png +0 -0
  204. data/bower_components/leaflet/docs/docs/images/twitter.png +0 -0
  205. data/bower_components/leaflet/docs/docs/js/docs.js +52 -0
  206. data/bower_components/leaflet/docs/download.md +95 -0
  207. data/bower_components/leaflet/docs/examples.md +125 -0
  208. data/bower_components/leaflet/docs/examples/choropleth-example.md +5 -0
  209. data/bower_components/leaflet/docs/examples/choropleth.md +5 -0
  210. data/bower_components/leaflet/docs/examples/choropleth/example-basic.md +20 -0
  211. data/bower_components/leaflet/docs/examples/choropleth/example-color.md +46 -0
  212. data/bower_components/leaflet/docs/examples/choropleth/example.md +159 -0
  213. data/bower_components/leaflet/docs/examples/choropleth/index.md +232 -0
  214. data/bower_components/leaflet/docs/examples/choropleth/thumbnail.png +0 -0
  215. data/bower_components/leaflet/docs/examples/choropleth/us-states.js +54 -0
  216. data/bower_components/leaflet/docs/examples/crs-simple/crs-simple-example1.md +16 -0
  217. data/bower_components/leaflet/docs/examples/crs-simple/crs-simple-example2.md +20 -0
  218. data/bower_components/leaflet/docs/examples/crs-simple/crs-simple-example3.md +38 -0
  219. data/bower_components/leaflet/docs/examples/crs-simple/crs-simple.md +117 -0
  220. data/bower_components/leaflet/docs/examples/crs-simple/thumbnail.png +0 -0
  221. data/bower_components/leaflet/docs/examples/crs-simple/uqm_map_400px.png +0 -0
  222. data/bower_components/leaflet/docs/examples/crs-simple/uqm_map_detail.png +0 -0
  223. data/bower_components/leaflet/docs/examples/crs-simple/uqm_map_full.png +0 -0
  224. data/bower_components/leaflet/docs/examples/custom-icons-example.md +5 -0
  225. data/bower_components/leaflet/docs/examples/custom-icons.md +5 -0
  226. data/bower_components/leaflet/docs/examples/custom-icons/example-one-icon.md +27 -0
  227. data/bower_components/leaflet/docs/examples/custom-icons/example.md +31 -0
  228. data/bower_components/leaflet/docs/examples/custom-icons/index.md +79 -0
  229. data/bower_components/leaflet/docs/examples/custom-icons/leaf-green.png +0 -0
  230. data/bower_components/leaflet/docs/examples/custom-icons/leaf-orange.png +0 -0
  231. data/bower_components/leaflet/docs/examples/custom-icons/leaf-red.png +0 -0
  232. data/bower_components/leaflet/docs/examples/custom-icons/leaf-shadow.png +0 -0
  233. data/bower_components/leaflet/docs/examples/custom-icons/thumbnail.png +0 -0
  234. data/bower_components/leaflet/docs/examples/extending/canvascircles.md +37 -0
  235. data/bower_components/leaflet/docs/examples/extending/class-diagram.md +24 -0
  236. data/bower_components/leaflet/docs/examples/extending/class-diagram.png +0 -0
  237. data/bower_components/leaflet/docs/examples/extending/class-diagram.txt +100 -0
  238. data/bower_components/leaflet/docs/examples/extending/extending-1-classes.md +196 -0
  239. data/bower_components/leaflet/docs/examples/extending/extending-2-layers.md +210 -0
  240. data/bower_components/leaflet/docs/examples/extending/extending-3-controls.md +100 -0
  241. data/bower_components/leaflet/docs/examples/extending/gridcoords.md +32 -0
  242. data/bower_components/leaflet/docs/examples/extending/kittenlayer.md +29 -0
  243. data/bower_components/leaflet/docs/examples/extending/pixelorigin.md +90 -0
  244. data/bower_components/leaflet/docs/examples/extending/thumbnail-1.png +0 -0
  245. data/bower_components/leaflet/docs/examples/extending/thumbnail-2.png +0 -0
  246. data/bower_components/leaflet/docs/examples/extending/thumbnail-3.png +0 -0
  247. data/bower_components/leaflet/docs/examples/extending/tilt.md +59 -0
  248. data/bower_components/leaflet/docs/examples/extending/watermark.md +36 -0
  249. data/bower_components/leaflet/docs/examples/geojson-example.md +5 -0
  250. data/bower_components/leaflet/docs/examples/geojson.md +5 -0
  251. data/bower_components/leaflet/docs/examples/geojson/baseball-marker.png +0 -0
  252. data/bower_components/leaflet/docs/examples/geojson/example.md +78 -0
  253. data/bower_components/leaflet/docs/examples/geojson/geojson-example.html +89 -0
  254. data/bower_components/leaflet/docs/examples/geojson/geojson.html +281 -0
  255. data/bower_components/leaflet/docs/examples/geojson/index.md +205 -0
  256. data/bower_components/leaflet/docs/examples/geojson/sample-geojson.js +248 -0
  257. data/bower_components/leaflet/docs/examples/geojson/thumbnail.png +0 -0
  258. data/bower_components/leaflet/docs/examples/layers-control-example.md +5 -0
  259. data/bower_components/leaflet/docs/examples/layers-control.md +5 -0
  260. data/bower_components/leaflet/docs/examples/layers-control/example.md +38 -0
  261. data/bower_components/leaflet/docs/examples/layers-control/index.md +72 -0
  262. data/bower_components/leaflet/docs/examples/layers-control/thumbnail.png +0 -0
  263. data/bower_components/leaflet/docs/examples/map-panes-example.md +5 -0
  264. data/bower_components/leaflet/docs/examples/map-panes.md +5 -0
  265. data/bower_components/leaflet/docs/examples/map-panes/eu-countries.js +79 -0
  266. data/bower_components/leaflet/docs/examples/map-panes/example.md +38 -0
  267. data/bower_components/leaflet/docs/examples/map-panes/index.md +105 -0
  268. data/bower_components/leaflet/docs/examples/map-panes/thumbnail.png +0 -0
  269. data/bower_components/leaflet/docs/examples/mobile-example.md +5 -0
  270. data/bower_components/leaflet/docs/examples/mobile.md +5 -0
  271. data/bower_components/leaflet/docs/examples/mobile/example.md +42 -0
  272. data/bower_components/leaflet/docs/examples/mobile/index.md +72 -0
  273. data/bower_components/leaflet/docs/examples/mobile/thumbnail.png +0 -0
  274. data/bower_components/leaflet/docs/examples/quick-start-example.md +5 -0
  275. data/bower_components/leaflet/docs/examples/quick-start.md +5 -0
  276. data/bower_components/leaflet/docs/examples/quick-start/example-basic.md +19 -0
  277. data/bower_components/leaflet/docs/examples/quick-start/example-overlays.md +35 -0
  278. data/bower_components/leaflet/docs/examples/quick-start/example-popups.md +37 -0
  279. data/bower_components/leaflet/docs/examples/quick-start/example.md +46 -0
  280. data/bower_components/leaflet/docs/examples/quick-start/index.md +143 -0
  281. data/bower_components/leaflet/docs/examples/quick-start/thumbnail.png +0 -0
  282. data/bower_components/leaflet/docs/examples/video-overlay/example-bounds.md +23 -0
  283. data/bower_components/leaflet/docs/examples/video-overlay/example-nocontrols.md +31 -0
  284. data/bower_components/leaflet/docs/examples/video-overlay/example.md +58 -0
  285. data/bower_components/leaflet/docs/examples/video-overlay/index.md +122 -0
  286. data/bower_components/leaflet/docs/examples/video-overlay/thumbnail.gif +0 -0
  287. data/bower_components/leaflet/docs/examples/wms/qgis-wms-layers.png +0 -0
  288. data/bower_components/leaflet/docs/examples/wms/thumbnail.png +0 -0
  289. data/bower_components/leaflet/docs/examples/wms/wms-example-crs.md +18 -0
  290. data/bower_components/leaflet/docs/examples/wms/wms-example1.md +16 -0
  291. data/bower_components/leaflet/docs/examples/wms/wms-example2.md +16 -0
  292. data/bower_components/leaflet/docs/examples/wms/wms-example3.md +34 -0
  293. data/bower_components/leaflet/docs/examples/wms/wms-example4.md +29 -0
  294. data/bower_components/leaflet/docs/examples/wms/wms.md +157 -0
  295. data/bower_components/leaflet/docs/examples/zoom-levels/example-delta.md +40 -0
  296. data/bower_components/leaflet/docs/examples/zoom-levels/example-fractional.md +56 -0
  297. data/bower_components/leaflet/docs/examples/zoom-levels/example-scale.md +29 -0
  298. data/bower_components/leaflet/docs/examples/zoom-levels/example-setzoom.md +44 -0
  299. data/bower_components/leaflet/docs/examples/zoom-levels/example-zero.md +19 -0
  300. data/bower_components/leaflet/docs/examples/zoom-levels/index.md +275 -0
  301. data/bower_components/leaflet/docs/examples/zoom-levels/thumbnail.png +0 -0
  302. data/bower_components/leaflet/docs/index.html +218 -0
  303. data/bower_components/leaflet/docs/plugins.md +3854 -0
  304. data/bower_components/leaflet/docs/reference-0.7.7.html +6424 -0
  305. data/bower_components/leaflet/docs/reference-1.0.0.html +22889 -0
  306. data/bower_components/leaflet/docs/reference-1.0.2.html +23382 -0
  307. data/bower_components/leaflet/docs/reference-1.0.3.html +23495 -0
  308. data/bower_components/leaflet/docs/reference-tpl.html +89 -0
  309. data/bower_components/leaflet/docs/reference-versions.html +16 -0
  310. data/bower_components/leaflet/docs/reference.html +3 -0
  311. data/bower_components/leaflet/package.json +77 -16
  312. data/columbus3.gemspec +1 -1
  313. data/doc/ChangeLog.org +10 -0
  314. data/doc/manual.txt +122 -0
  315. data/doc/todo.org +63 -0
  316. data/exe/columbus3 +2 -246
  317. data/lib/columbus3.rb +12 -7
  318. data/lib/columbus3/cli/command_semantics.rb +352 -0
  319. data/lib/columbus3/cli/command_syntax.rb +103 -0
  320. data/lib/columbus3/metadata/query_parser.racc +21 -7
  321. data/lib/columbus3/metadata/query_parser.tab.rb +34 -34
  322. data/lib/columbus3/metadata/sidecar.rb +1 -1
  323. data/lib/columbus3/renderer/flot_renderer.rb +3 -8
  324. data/lib/columbus3/renderer/leaflet_renderer.rb +18 -29
  325. data/lib/columbus3/renderer/sanitizer.rb +8 -0
  326. data/lib/columbus3/v900track/gpx2v900.rb +31 -0
  327. data/lib/columbus3/v900track/v900track.rb +34 -8
  328. data/lib/columbus3/v900track/v900waypoint.rb +9 -0
  329. data/lib/columbus3/version.rb +1 -1
  330. data/lib/html/flot.html.erb +6 -6
  331. data/lib/html/show.html.erb +53 -76
  332. data/lib/html/track.js.erb +58 -12
  333. metadata +222 -23
  334. data/README.textile +0 -67
  335. data/bower_components/jquery/src/ajax/parseJSON.js +0 -13
  336. data/bower_components/jquery/src/css/defaultDisplay.js +0 -70
  337. data/bower_components/jquery/src/css/var/isHidden.js +0 -13
  338. data/bower_components/jquery/src/intro.js +0 -44
  339. data/bower_components/jquery/src/outro.js +0 -1
  340. data/bower_components/jquery/src/sizzle/dist/sizzle.min.js +0 -3
  341. data/bower_components/jquery/src/sizzle/dist/sizzle.min.map +0 -1
  342. data/bower_components/jquery/src/var/rnotwhite.js +0 -3
  343. data/bower_components/jquery/src/var/strundefined.js +0 -3
  344. data/bower_components/leaflet/component.json +0 -20
@@ -0,0 +1,38 @@
1
+ ---
2
+ layout: tutorial_frame
3
+ title: Custom Icons Tutorial
4
+ ---
5
+ <script type="text/javascript" src="eu-countries.js"></script>
6
+
7
+ <script>
8
+
9
+ var map = L.map('map');
10
+
11
+ map.createPane('labels');
12
+
13
+ // This pane is above markers but below popups
14
+ map.getPane('labels').style.zIndex = 650;
15
+
16
+ // Layers in this pane are non-interactive and do not obscure mouse/touch events
17
+ map.getPane('labels').style.pointerEvents = 'none';
18
+
19
+
20
+ var cartodbAttribution = '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>';
21
+
22
+ var positron = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png', {
23
+ attribution: cartodbAttribution
24
+ }).addTo(map);
25
+
26
+ var positronLabels = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png', {
27
+ attribution: cartodbAttribution,
28
+ pane: 'labels'
29
+ }).addTo(map);
30
+
31
+ geojson = L.geoJson(euCountries).addTo(map);
32
+
33
+ geojson.eachLayer(function (layer) {
34
+ layer.bindPopup(layer.feature.properties.name);
35
+ });
36
+
37
+ map.setView({ lat: 47.040182144806664, lng: 9.667968750000002 }, 4);
38
+ </script>
@@ -0,0 +1,105 @@
1
+ ---
2
+ layout: tutorial_v2
3
+ title: Working with map panes
4
+ ---
5
+
6
+ ## What are panes?
7
+
8
+ In Leaflet, map panes group layers together implicitly, without the developer knowing about it. This grouping allows web browsers to work with several layers at once in a more efficient way than working with layers individually.
9
+
10
+ Map panes use the [z-index CSS property](https://developer.mozilla.org/docs/Web/CSS/z-index) to always show some layers on top of others. The [default order](../../reference.html#map-panes) is:
11
+
12
+ * `TileLayer`s and `GridLayer`s
13
+ * `Path`s, like lines, polylines, circles, or `GeoJSON` layers.
14
+ * `Marker` shadows
15
+ * `Marker` icons
16
+ * `Popup`s
17
+
18
+ This is why, in Leaflet maps, popups always show "on top" of other layers, markers always show on top of tile layers, etc.
19
+
20
+ A new feature of **Leaflet 1.0.0** (not present in 0.7.x) is custom map panes, which allows for customization of this order.
21
+
22
+ ## The default is not always right
23
+
24
+ In some particular cases, the default order is not the right one for the map. We can demonstrate this with the [Carto basemaps](https://cartodb.com/basemaps/) and labels:
25
+
26
+
27
+ <style>
28
+ .tiles img {
29
+ border: 1px solid #ccc;
30
+ border-radius: 5px;
31
+ }
32
+ </style>
33
+
34
+ <div class='tiles'>
35
+ <div style='display: inline-block'>
36
+ <img src="http://a.basemaps.cartocdn.com/light_nolabels/0/0/0.png" class="bordered-img" /><br/>
37
+ Basemap tile with no labels
38
+ </div>
39
+
40
+ <div style='display: inline-block'>
41
+ <img src="http://a.basemaps.cartocdn.com/light_only_labels/0/0/0.png" class="bordered-img" /><br/>
42
+ Transparent labels-only tile
43
+ </div>
44
+
45
+ <div style='display: inline-block; position:relative;'>
46
+ <img src="http://a.basemaps.cartocdn.com/light_nolabels/0/0/0.png" class="bordered-img" />
47
+ <img src="http://a.basemaps.cartocdn.com/light_only_labels/0/0/0.png" style='position:absolute; left:0; top:0;'/><br/>
48
+ Labels on top of basemap
49
+ </div>
50
+ </div>
51
+
52
+ If we create a Leaflet map with these two tile layers, any marker or polygon will show on top of both, but having the labels on top [looks much nicer](http://blog.cartodb.com/let-your-labels-shine/). How can we do that?
53
+
54
+ {% include frame.html url="example.html" %}
55
+
56
+ ## Custom pane
57
+
58
+ We can use the defaults for the basemap tiles and some overlays like GeoJSON layers, but we have to define a custom pane for the labels, so they show on top of the GeoJSON data.
59
+
60
+ Custom map panes are created on a per-map basis, so first create an instance of `L.Map` and the pane:
61
+
62
+
63
+ var map = L.map('map');
64
+ map.createPane('labels');
65
+
66
+
67
+ The next step is setting the z-index of the pane. Looking at the [defaults](https://github.com/Leaflet/Leaflet/blob/v1.0.0/dist/leaflet.css#L87), a value of 650 will make the `TileLayer` with the labels show on top of markers but below pop-ups. By using `getPane()`, we have a reference to the [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) representing the pane, and change its z-index:
68
+
69
+
70
+ map.getPane('labels').style.zIndex = 650;
71
+
72
+
73
+ One of the problems of having image tiles on top of other map layers is that the tiles will capture clicks and touches. If a user clicks anywhere on the map, the web browser will assume she clicked on the labels tiles, and not on the GeoJSON or on the markers. This can be solved using [the `pointer-events` CSS property](https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events):
74
+
75
+
76
+ map.getPane('labels').style.pointerEvents = 'none';
77
+
78
+
79
+ With the pane now ready, we can add the layers, paying attention to use the `pane` option on the labels tiles:
80
+
81
+
82
+ var positron = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png', {
83
+ attribution: '©OpenStreetMap, ©CartoDB'
84
+ }).addTo(map);
85
+
86
+ var positronLabels = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png', {
87
+ attribution: '©OpenStreetMap, ©CartoDB',
88
+ pane: 'labels'
89
+ }).addTo(map);
90
+
91
+ var geojson = L.geoJson(GeoJsonData, geoJsonOptions).addTo(map);
92
+
93
+ Finally, add some interaction to each feature on the GeoJSON layer:
94
+
95
+ geojson.eachLayer(function (layer) {
96
+ layer.bindPopup(layer.feature.properties.name);
97
+ });
98
+
99
+ map.fitBounds(geojson.getBounds());
100
+
101
+
102
+ Now the [example map](example.html) is complete!
103
+
104
+
105
+
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: redirected
3
+ sitemap: false
4
+ redirect_to: mobile/example.html
5
+ ---
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: redirected
3
+ sitemap: false
4
+ redirect_to: mobile/
5
+ ---
@@ -0,0 +1,42 @@
1
+ ---
2
+ layout: tutorial_frame
3
+ title: Mobile tutorial
4
+ css: "body {
5
+ padding: 0;
6
+ margin: 0;
7
+ }
8
+ html, body, #map {
9
+ height: 100vh;
10
+ width: 100vw;
11
+ }"
12
+ ---
13
+ <script>
14
+ var map = L.map('map').fitWorld();
15
+
16
+ L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
17
+ maxZoom: 18,
18
+ attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
19
+ '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
20
+ 'Imagery © <a href="http://mapbox.com">Mapbox</a>',
21
+ id: 'mapbox.streets'
22
+ }).addTo(map);
23
+
24
+ function onLocationFound(e) {
25
+ var radius = e.accuracy / 2;
26
+
27
+ L.marker(e.latlng).addTo(map)
28
+ .bindPopup("You are within " + radius + " meters from this point").openPopup();
29
+
30
+ L.circle(e.latlng, radius).addTo(map);
31
+ }
32
+
33
+ function onLocationError(e) {
34
+ alert(e.message);
35
+ }
36
+
37
+ map.on('locationfound', onLocationFound);
38
+ map.on('locationerror', onLocationError);
39
+
40
+ map.locate({setView: true, maxZoom: 16});
41
+ </script>
42
+
@@ -0,0 +1,72 @@
1
+ ---
2
+ layout: tutorial_v2
3
+ title: Leaflet on Mobile
4
+ ---
5
+
6
+ ## Leaflet on Mobile
7
+
8
+ In this example, you'll learn how to create a fullscreen map tuned for mobile devices like iPhone, iPad or Android phones, and how to easily detect and use the current user location.
9
+
10
+ {% include frame.html url="example.html" %}
11
+
12
+ ### Preparing the page
13
+
14
+ First we'll take a look at the HTML &amp; CSS code of the page. To make our map `div` element stretch to all available space (fullscreen), we can use the following CSS code:
15
+
16
+ {: .css}
17
+ body {
18
+ padding: 0;
19
+ margin: 0;
20
+ }
21
+ html, body, #map {
22
+ height: 100vh;
23
+ width: 100vw;
24
+ }
25
+
26
+ Also, we need to tell the mobile browser to disable unwanted scaling of the page and set it to its actual size by placing the following line in the `head` section or our HTML page:
27
+
28
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
29
+
30
+ ### Initializing the map
31
+
32
+ We'll now initialize the map in the JavaScript code like we did in the [quick start guide](../quick-start/), showing the whole world:
33
+
34
+ <pre><code class="javascript">var map = L.map('map').fitWorld();
35
+
36
+ L.tileLayer('https://api.tiles.mapbox.com/v4/<a href="https://mapbox.com">MapID</a>/997/256/{z}/{x}/{y}.png?access_token={accessToken}', {
37
+ attribution: 'Map data &amp;copy; <span class="text-cut" data-cut="[&hellip;]">&lt;a href="http://openstreetmap.org"&gt;OpenStreetMap&lt;/a&gt; contributors, &lt;a href="http://creativecommons.org/licenses/by-sa/2.0/"&gt;CC-BY-SA&lt;/a&gt;, Imagery &copy; &lt;a href="http://mapbox.com"&gt;Mapbox&lt;/a&gt;</span>',
38
+ maxZoom: 18
39
+ }).addTo(map);</code></pre>
40
+
41
+ ### Geolocation
42
+
43
+ Leaflet has a very handy shortcut for zooming the map view to the detected location --- `locate` method with the `setView` option, replacing the usual `setView` method in the code:
44
+
45
+ map.locate({setView: true, maxZoom: 16});
46
+
47
+ Here we specify 16 as the maximum zoom when setting the map view automatically. As soon as the user agrees to share its location and it's detected by the browser, the map will set the view to it. Now we have a working fullscreen mobile map! But what if we need to do something after the geolocation completed? Here's what the `locationfound` and `locationerror` events are for. Let's for example add a marker in the detected location, showing accuracy in a popup, by adding an event listener to `locationfound` event before the `locateAndSetView` call:
48
+
49
+ function onLocationFound(e) {
50
+ var radius = e.accuracy / 2;
51
+
52
+ L.marker(e.latlng).addTo(map)
53
+ .bindPopup("You are within " + radius + " meters from this point").openPopup();
54
+
55
+ L.circle(e.latlng, radius).addTo(map);
56
+ }
57
+
58
+ map.on('locationfound', onLocationFound);
59
+
60
+ Excellent! But it would also be nice to show an error message if the geolocation failed:
61
+
62
+ function onLocationError(e) {
63
+ alert(e.message);
64
+ }
65
+
66
+ map.on('locationerror', onLocationError);
67
+
68
+ If you have `setView` option set to true and the geolocation failed, it will set the view to the whole world.
69
+
70
+ Now the example is complete --- try it on your mobile phone: [View the full example &rarr;](example.html)
71
+
72
+ Next steps would be to take a look at the detailed [documentation](../../reference.html) and browse [other examples](../../examples.html).
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: redirected
3
+ sitemap: false
4
+ redirect_to: quick-start/example.html
5
+ ---
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: redirected
3
+ sitemap: false
4
+ redirect_to: quick-start/
5
+ ---
@@ -0,0 +1,19 @@
1
+ ---
2
+ layout: tutorial_frame
3
+ title: Quick Start
4
+ customMapContainer: "true"
5
+ ---
6
+ <div id='mapid' style='width: 600px; height: 400px;'></div>
7
+ <script>
8
+
9
+ var mymap = L.map('mapid').setView([51.505, -0.09], 13);
10
+
11
+ L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
12
+ maxZoom: 18,
13
+ attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
14
+ '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
15
+ 'Imagery © <a href="http://mapbox.com">Mapbox</a>',
16
+ id: 'mapbox.streets'
17
+ }).addTo(mymap);
18
+
19
+ </script>
@@ -0,0 +1,35 @@
1
+ ---
2
+ layout: tutorial_frame
3
+ title: Quick Start
4
+ customMapContainer: "true"
5
+ ---
6
+ <div id='mapid' style='width: 600px; height: 400px;'></div>
7
+ <script>
8
+
9
+ var mymap = L.map('mapid').setView([51.505, -0.09], 13);
10
+
11
+ L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
12
+ maxZoom: 18,
13
+ attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
14
+ '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
15
+ 'Imagery © <a href="http://mapbox.com">Mapbox</a>',
16
+ id: 'mapbox.streets'
17
+ }).addTo(mymap);
18
+
19
+ L.marker([51.5, -0.09]).addTo(mymap);
20
+
21
+ L.circle([51.508, -0.11], {
22
+ color: 'red',
23
+ fillColor: '#f03',
24
+ fillOpacity: 0.5,
25
+ radius: 500
26
+ }).addTo(mymap);
27
+
28
+ L.polygon([
29
+ [51.509, -0.08],
30
+ [51.503, -0.06],
31
+ [51.51, -0.047]
32
+ ]).addTo(mymap);
33
+
34
+
35
+ </script>
@@ -0,0 +1,37 @@
1
+ ---
2
+ layout: tutorial_frame
3
+ title: Quick Start
4
+ customMapContainer: "true"
5
+ ---
6
+ <div id='mapid' style='width: 600px; height: 400px;'></div>
7
+ <script>
8
+
9
+ var mymap = L.map('mapid').setView([51.505, -0.09], 13);
10
+
11
+ L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
12
+ maxZoom: 18,
13
+ attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
14
+ '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
15
+ 'Imagery © <a href="http://mapbox.com">Mapbox</a>',
16
+ id: 'mapbox.streets'
17
+ }).addTo(mymap);
18
+
19
+ L.marker([51.5, -0.09]).addTo(mymap)
20
+ .bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup();
21
+
22
+ L.circle([51.508, -0.11], 500, {
23
+ color: 'red',
24
+ fillColor: '#f03',
25
+ fillOpacity: 0.5
26
+ }).addTo(mymap).bindPopup("I am a circle.");
27
+
28
+ L.polygon([
29
+ [51.509, -0.08],
30
+ [51.503, -0.06],
31
+ [51.51, -0.047]
32
+ ]).addTo(mymap).bindPopup("I am a polygon.");
33
+
34
+
35
+ var popup = L.popup();
36
+
37
+ </script>
@@ -0,0 +1,46 @@
1
+ ---
2
+ layout: tutorial_frame
3
+ title: Quick Start
4
+ customMapContainer: "true"
5
+ ---
6
+ <div id='mapid' style='width: 600px; height: 400px;'></div>
7
+ <script>
8
+
9
+ var mymap = L.map('mapid').setView([51.505, -0.09], 13);
10
+
11
+ L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
12
+ maxZoom: 18,
13
+ attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
14
+ '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
15
+ 'Imagery © <a href="http://mapbox.com">Mapbox</a>',
16
+ id: 'mapbox.streets'
17
+ }).addTo(mymap);
18
+
19
+ L.marker([51.5, -0.09]).addTo(mymap)
20
+ .bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup();
21
+
22
+ L.circle([51.508, -0.11], 500, {
23
+ color: 'red',
24
+ fillColor: '#f03',
25
+ fillOpacity: 0.5
26
+ }).addTo(mymap).bindPopup("I am a circle.");
27
+
28
+ L.polygon([
29
+ [51.509, -0.08],
30
+ [51.503, -0.06],
31
+ [51.51, -0.047]
32
+ ]).addTo(mymap).bindPopup("I am a polygon.");
33
+
34
+
35
+ var popup = L.popup();
36
+
37
+ function onMapClick(e) {
38
+ popup
39
+ .setLatLng(e.latlng)
40
+ .setContent("You clicked the map at " + e.latlng.toString())
41
+ .openOn(mymap);
42
+ }
43
+
44
+ mymap.on('click', onMapClick);
45
+
46
+ </script>
@@ -0,0 +1,143 @@
1
+ ---
2
+ layout: tutorial_v2
3
+ title: Quick Start Guide
4
+ ---
5
+
6
+ ## Leaflet Quick Start Guide
7
+
8
+ This step-by-step guide will quickly get you started on Leaflet basics, including setting up a Leaflet map, working with markers, polylines and popups, and dealing with events.
9
+
10
+ {% include frame.html url="example.html" %}
11
+
12
+ ### Preparing your page
13
+
14
+ Before writing any code for the map, you need to do the following preparation steps on your page:
15
+
16
+ * Include Leaflet CSS file in the head section of your document:
17
+
18
+ <link rel="stylesheet" href="https://unpkg.com/leaflet@{{ site.latest_leaflet_version}}/dist/leaflet.css"
19
+ integrity="{{site.integrity_hash_css}}"
20
+ crossorigin=""/>
21
+
22
+ * Include Leaflet JavaScript file:
23
+
24
+ <script src="https://unpkg.com/leaflet@{{ site.latest_leaflet_version}}/dist/leaflet.js"
25
+ integrity="{{site.integrity_hash_uglified}}"
26
+ crossorigin=""></script>
27
+
28
+ * Put a `div` element with a certain `id` where you want your map to be:
29
+
30
+ <div id="mapid"></div>
31
+
32
+ * Make sure the map container has a defined height, for example by setting it in CSS:
33
+
34
+ <pre><code class="css">#mapid { height: 180px; }</code></pre>
35
+
36
+ Now you're ready to initialize the map and do some stuff with it.
37
+
38
+
39
+ ### Setting up the map
40
+
41
+
42
+ {% include frame.html url="example-basic.html" %}
43
+
44
+ Let's create a map of the center of London with pretty Mapbox Streets tiles. First we'll initialize the map and set its view to our chosen geographical coordinates and a zoom level:
45
+
46
+ var mymap = L.map('mapid').setView([51.505, -0.09], 13);
47
+
48
+ By default (as we didn't pass any options when creating the map instance), all mouse and touch interactions on the map are enabled, and it has zoom and attribution controls.
49
+
50
+ Note that `setView` call also returns the map object --- most Leaflet methods act like this when they don't return an explicit value, which allows convenient jQuery-like method chaining.
51
+
52
+ Next we'll add a tile layer to add to our map, in this case it's a Mapbox Streets tile layer. Creating a tile layer usually involves setting the [URL template](http://leafletjs.com/reference.html#url-template) for the tile images, the attribution text and the maximum zoom level of the layer. In this example we'll use the `mapbox.streets` tiles from [Mapbox's "Classic maps"](https://www.mapbox.com/api-documentation/#maps) (in order to use tiles from Mapbox, you must also [request an access token](https://www.mapbox.com/studio/account/tokens/)).
53
+
54
+ <pre><code class="javascript">L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
55
+ attribution: 'Map data &amp;copy; <span class="text-cut" data-cut="[&hellip;]">&lt;a href="http://openstreetmap.org"&gt;OpenStreetMap&lt;/a&gt; contributors, &lt;a href="http://creativecommons.org/licenses/by-sa/2.0/"&gt;CC-BY-SA&lt;/a&gt;, Imagery &copy; &lt;a href="http://mapbox.com"&gt;Mapbox&lt;/a&gt;</span>',
56
+ maxZoom: 18,
57
+ id: 'mapbox.streets',
58
+ accessToken: 'your.mapbox.access.token'
59
+ }).addTo(mymap);</code></pre>
60
+
61
+ Make sure all the code is called after the `div` and `leaflet.js` inclusion. That's it! You have a working Leaflet map now.
62
+
63
+ It's worth noting that Leaflet is provider-agnostic, meaning that it doesn't enforce a particular choice of providers for tiles. You can try replacing `mapbox.streets` with `mapbox.satellite`, and see what happens. Also, Leaflet doesn't even contain a single provider-specific line of code, so you're free to use other providers if you need to (we'd suggest Mapbox though, it looks beautiful).
64
+
65
+
66
+ ### Markers, circles and polygons
67
+
68
+ {% include frame.html url="example-overlays.html" %}
69
+
70
+
71
+ Besides tile layers, you can easily add other things to your map, including markers, polylines, polygons, circles, and popups. Let's add a marker:
72
+
73
+ var marker = L.marker([51.5, -0.09]).addTo(mymap);
74
+
75
+ Adding a circle is the same (except for specifying the radius in meters as a second argument), but lets you control how it looks by passing options as the last argument when creating the object:
76
+
77
+ var circle = L.circle([51.508, -0.11], {
78
+ color: 'red',
79
+ fillColor: '#f03',
80
+ fillOpacity: 0.5,
81
+ radius: 500
82
+ }).addTo(mymap);
83
+
84
+ Adding a polygon is as easy:
85
+
86
+ var polygon = L.polygon([
87
+ [51.509, -0.08],
88
+ [51.503, -0.06],
89
+ [51.51, -0.047]
90
+ ]).addTo(mymap);
91
+
92
+
93
+ ### Working with popups
94
+
95
+ {% include frame.html url="example-popups.html" %}
96
+
97
+ Popups are usually used when you want to attach some information to a particular object on a map. Leaflet has a very handy shortcut for this:
98
+
99
+ marker.bindPopup("<b>Hello world!</b><br>I am a popup.").openPopup();
100
+ circle.bindPopup("I am a circle.");
101
+ polygon.bindPopup("I am a polygon.");
102
+
103
+ Try clicking on our objects. The `bindPopup` method attaches a popup with the specified HTML content to your marker so the popup appears when you click on the object, and the `openPopup` method (for markers only) immediately opens the attached popup.
104
+
105
+ You can also use popups as layers (when you need something more than attaching a popup to an object):
106
+
107
+ var popup = L.popup()
108
+ .setLatLng([51.5, -0.09])
109
+ .setContent("I am a standalone popup.")
110
+ .openOn(mymap);
111
+
112
+ Here we use `openOn` instead of `addTo` because it handles automatic closing of a previously opened popup when opening a new one which is good for usability.
113
+
114
+
115
+ ### Dealing with events
116
+
117
+ Every time something happens in Leaflet, e.g. user clicks on a marker or map zoom changes, the corresponding object sends an event which you can subscribe to with a function. It allows you to react to user interaction:
118
+
119
+ function onMapClick(e) {
120
+ alert("You clicked the map at " + e.latlng);
121
+ }
122
+
123
+ mymap.on('click', onMapClick);
124
+
125
+ Each object has its own set of events --- see [documentation](../../reference.html) for details. The first argument of the listener function is an event object --- it contains useful information about the event that happened. For example, map click event object (`e` in the example above) has `latlng` property which is a location at which the click occured.
126
+
127
+ Let's improve our example by using a popup instead of an alert:
128
+
129
+ var popup = L.popup();
130
+
131
+ function onMapClick(e) {
132
+ popup
133
+ .setLatLng(e.latlng)
134
+ .setContent("You clicked the map at " + e.latlng.toString())
135
+ .openOn(mymap);
136
+ }
137
+
138
+ mymap.on('click', onMapClick);
139
+
140
+ Try clicking on the map and you will see the coordinates in a popup. <a target="_blank" href="example.html">View the full example &rarr;</a>
141
+
142
+ Now you've learned Leaflet basics and can start building map apps straight away! Don't forget to take a look at the detailed <a href="../../reference.html">documentation</a> or <a href="../../examples.html">other examples</a>.
143
+