leaflet-js 0.6.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CHANGELOG.rdoc +32 -0
- data/LICENSE +21 -0
- data/README.rdoc +54 -0
- data/Rakefile +15 -0
- data/leaflet-js.gemspec +28 -0
- data/lib/leaflet-js.rb +10 -0
- data/lib/leaflet.draw/BREAKINGCHANGES.md +54 -0
- data/lib/leaflet.draw/CHANGELOG.md +73 -0
- data/lib/leaflet.draw/Jakefile.js +26 -0
- data/lib/leaflet.draw/MIT-LICENCE.txt +20 -0
- data/lib/leaflet.draw/README.md +364 -0
- data/lib/leaflet.draw/TODO.md +62 -0
- data/lib/leaflet.draw/build/build.html +243 -0
- data/lib/leaflet.draw/build/build.js +189 -0
- data/lib/leaflet.draw/build/deps.js +75 -0
- data/lib/leaflet.draw/build/hintrc.js +47 -0
- data/lib/leaflet.draw/build/leaflet.draw-include.js +42 -0
- data/lib/leaflet.draw/dist/images/spritesheet.png +0 -0
- data/lib/leaflet.draw/dist/leaflet.draw-src.js +2429 -0
- data/lib/leaflet.draw/dist/leaflet.draw.css +212 -0
- data/lib/leaflet.draw/dist/leaflet.draw.ie.css +44 -0
- data/lib/leaflet.draw/dist/leaflet.draw.js +10 -0
- data/lib/leaflet.draw/examples/basic.html +106 -0
- data/lib/leaflet.draw/examples/edithandlers.html +67 -0
- data/lib/leaflet.draw/examples/libs/images/layers.png +0 -0
- data/lib/leaflet.draw/examples/libs/images/marker-icon.png +0 -0
- data/lib/leaflet.draw/examples/libs/images/marker-icon@2x.png +0 -0
- data/lib/leaflet.draw/examples/libs/images/marker-shadow.png +0 -0
- data/lib/leaflet.draw/examples/libs/leaflet-src.js +8587 -0
- data/lib/leaflet.draw/examples/libs/leaflet.css +459 -0
- data/lib/leaflet.draw/examples/libs/leaflet.ie.css +51 -0
- data/lib/leaflet.draw/package.json +37 -0
- data/lib/leaflet.draw/spec/after.js +2 -0
- data/lib/leaflet.draw/spec/before.js +3 -0
- data/lib/leaflet.draw/spec/expect.js +1253 -0
- data/lib/leaflet.draw/spec/happen.js +93 -0
- data/lib/leaflet.draw/spec/index.html +36 -0
- data/lib/leaflet.draw/spec/karma.conf.js +69 -0
- data/lib/leaflet.draw/spec/sinon.js +4223 -0
- data/lib/leaflet.draw/spec/suites/DrawControlSpec.js +15 -0
- data/lib/leaflet.draw/spec/suites/SpecHelper.js +26 -0
- data/lib/leaflet.draw/src/Control.Draw.js +101 -0
- data/lib/leaflet.draw/src/Leaflet.draw.js +5 -0
- data/lib/leaflet.draw/src/Toolbar.js +187 -0
- data/lib/leaflet.draw/src/Tooltip.js +52 -0
- data/lib/leaflet.draw/src/copyright.js +8 -0
- data/lib/leaflet.draw/src/draw/DrawToolbar.js +107 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Circle.js +59 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Feature.js +74 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Marker.js +97 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Polygon.js +79 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Polyline.js +360 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.Rectangle.js +41 -0
- data/lib/leaflet.draw/src/draw/handler/Draw.SimpleShape.js +67 -0
- data/lib/leaflet.draw/src/edit/EditToolbar.js +93 -0
- data/lib/leaflet.draw/src/edit/handler/Edit.Circle.js +63 -0
- data/lib/leaflet.draw/src/edit/handler/Edit.Poly.js +267 -0
- data/lib/leaflet.draw/src/edit/handler/Edit.Rectangle.js +117 -0
- data/lib/leaflet.draw/src/edit/handler/Edit.SimpleShape.js +138 -0
- data/lib/leaflet.draw/src/edit/handler/EditToolbar.Delete.js +109 -0
- data/lib/leaflet.draw/src/edit/handler/EditToolbar.Edit.js +233 -0
- data/lib/leaflet.draw/src/ext/LatLngUtil.js +18 -0
- data/lib/leaflet.draw/src/ext/LineUtil.Intersect.js +15 -0
- data/lib/leaflet.draw/src/ext/Polygon.Intersect.js +27 -0
- data/lib/leaflet.draw/src/ext/Polyline.Intersect.js +85 -0
- data/lib/leaflet.label/CHANGELOG.md +35 -0
- data/lib/leaflet.label/Jakefile.js +21 -0
- data/lib/leaflet.label/MIT-LICENCE.txt +20 -0
- data/lib/leaflet.label/README.md +86 -0
- data/lib/leaflet.label/build/build.js +155 -0
- data/lib/leaflet.label/build/deps.js +24 -0
- data/lib/leaflet.label/build/hint.js +30 -0
- data/lib/leaflet.label/build/hintrc.js +47 -0
- data/lib/leaflet.label/dist/images/death.png +0 -0
- data/lib/leaflet.label/dist/leaflet.label-src.js +359 -0
- data/lib/leaflet.label/dist/leaflet.label.css +33 -0
- data/lib/leaflet.label/dist/leaflet.label.js +9 -0
- data/lib/leaflet.label/example/label.html +82 -0
- data/lib/leaflet.label/libs/leaflet/images/layers.png +0 -0
- data/lib/leaflet.label/libs/leaflet/images/marker-icon.png +0 -0
- data/lib/leaflet.label/libs/leaflet/images/marker-icon@2x.png +0 -0
- data/lib/leaflet.label/libs/leaflet/images/marker-shadow.png +0 -0
- data/lib/leaflet.label/libs/leaflet/leaflet-src.js +8587 -0
- data/lib/leaflet.label/libs/leaflet/leaflet.css +459 -0
- data/lib/leaflet.label/libs/leaflet/leaflet.ie.css +51 -0
- data/lib/leaflet.label/libs/leaflet/leaflet.js +8 -0
- data/lib/leaflet.label/src/FeatureGroup.Label.js +20 -0
- data/lib/leaflet.label/src/Label.js +123 -0
- data/lib/leaflet.label/src/Leaflet.label.js +5 -0
- data/lib/leaflet.label/src/Map.Label.js +7 -0
- data/lib/leaflet.label/src/Marker.Label.js +160 -0
- data/lib/leaflet.label/src/Path.Label.js +55 -0
- data/lib/leaflet.label/src/copyright.js +8 -0
- data/lib/leaflet/CHANGELOG.md +637 -0
- data/lib/leaflet/CONTRIBUTING.md +155 -0
- data/lib/leaflet/Jakefile.js +26 -0
- data/lib/leaflet/LICENSE +23 -0
- data/lib/leaflet/README.md +30 -0
- data/lib/leaflet/build/build.html +243 -0
- data/lib/leaflet/build/build.js +193 -0
- data/lib/leaflet/build/deps.js +256 -0
- data/lib/leaflet/build/hintrc.js +37 -0
- data/lib/leaflet/debug/css/mobile.css +6 -0
- data/lib/leaflet/debug/css/screen.css +5 -0
- data/lib/leaflet/debug/hacks/jitter.html +43 -0
- data/lib/leaflet/debug/leaflet-include.js +59 -0
- data/lib/leaflet/debug/map/canvas.html +47 -0
- data/lib/leaflet/debug/map/controls.html +50 -0
- data/lib/leaflet/debug/map/geolocation.html +35 -0
- data/lib/leaflet/debug/map/image-overlay.html +44 -0
- data/lib/leaflet/debug/map/map-mobile.html +35 -0
- data/lib/leaflet/debug/map/map.html +60 -0
- data/lib/leaflet/debug/map/max-bounds.html +37 -0
- data/lib/leaflet/debug/map/scroll.html +36 -0
- data/lib/leaflet/debug/map/simple-proj.html +45 -0
- data/lib/leaflet/debug/map/wms-marble.html +31 -0
- data/lib/leaflet/debug/map/wms.html +41 -0
- data/lib/leaflet/debug/map/zoomlevels.html +46 -0
- data/lib/leaflet/debug/tests/add_remove_layers.html +88 -0
- data/lib/leaflet/debug/tests/bringtoback.html +38 -0
- data/lib/leaflet/debug/tests/click_on_canvas.html +59 -0
- data/lib/leaflet/debug/tests/click_on_canvas_broken.html +49 -0
- data/lib/leaflet/debug/tests/opacity.html +57 -0
- data/lib/leaflet/debug/tests/remove_while_dragging.html +29 -0
- data/lib/leaflet/debug/tests/removetilewhilepan.html +42 -0
- data/lib/leaflet/debug/tests/reuse_popups.html +41 -0
- data/lib/leaflet/debug/tests/svg_clicks.html +55 -0
- data/lib/leaflet/debug/vector/bounds-extend.html +89 -0
- data/lib/leaflet/debug/vector/feature-group-bounds.html +91 -0
- data/lib/leaflet/debug/vector/geojson-sample.js +53 -0
- data/lib/leaflet/debug/vector/geojson.html +174 -0
- data/lib/leaflet/debug/vector/rectangle.html +54 -0
- data/lib/leaflet/debug/vector/route.js +1 -0
- data/lib/leaflet/debug/vector/touchzoomemu.html +195 -0
- data/lib/leaflet/debug/vector/us-states.js +54 -0
- data/lib/leaflet/debug/vector/vector-bounds.html +70 -0
- data/lib/leaflet/debug/vector/vector-canvas.html +93 -0
- data/lib/leaflet/debug/vector/vector-mobile.html +39 -0
- data/lib/leaflet/debug/vector/vector-simple.html +49 -0
- data/lib/leaflet/debug/vector/vector.html +38 -0
- data/lib/leaflet/dist/images/layers.png +0 -0
- data/lib/leaflet/dist/images/marker-icon-2x.png +0 -0
- data/lib/leaflet/dist/images/marker-icon.png +0 -0
- data/lib/leaflet/dist/images/marker-shadow.png +0 -0
- data/lib/leaflet/dist/leaflet-src.js +8579 -0
- data/lib/leaflet/dist/leaflet.css +459 -0
- data/lib/leaflet/dist/leaflet.ie.css +51 -0
- data/lib/leaflet/dist/leaflet.js +8 -0
- data/lib/leaflet/package.json +22 -0
- data/lib/leaflet/spec/after.js +2 -0
- data/lib/leaflet/spec/before.js +3 -0
- data/lib/leaflet/spec/expect.js +1253 -0
- data/lib/leaflet/spec/happen.js +93 -0
- data/lib/leaflet/spec/index.html +78 -0
- data/lib/leaflet/spec/karma.conf.js +64 -0
- data/lib/leaflet/spec/sinon.js +4223 -0
- data/lib/leaflet/spec/suites/LeafletSpec.js +13 -0
- data/lib/leaflet/spec/suites/SpecHelper.js +26 -0
- data/lib/leaflet/spec/suites/control/Control.AttributionSpec.js +68 -0
- data/lib/leaflet/spec/suites/control/Control.LayersSpec.js +67 -0
- data/lib/leaflet/spec/suites/control/Control.ScaleSpec.js +6 -0
- data/lib/leaflet/spec/suites/core/ClassSpec.js +156 -0
- data/lib/leaflet/spec/suites/core/EventsSpec.js +336 -0
- data/lib/leaflet/spec/suites/core/UtilSpec.js +212 -0
- data/lib/leaflet/spec/suites/dom/DomEventSpec.js +102 -0
- data/lib/leaflet/spec/suites/dom/DomUtilSpec.js +89 -0
- data/lib/leaflet/spec/suites/geo/LatLngBoundsSpec.js +136 -0
- data/lib/leaflet/spec/suites/geo/LatLngSpec.js +118 -0
- data/lib/leaflet/spec/suites/geo/ProjectionSpec.js +47 -0
- data/lib/leaflet/spec/suites/geometry/BoundsSpec.js +87 -0
- data/lib/leaflet/spec/suites/geometry/LineUtilSpec.js +75 -0
- data/lib/leaflet/spec/suites/geometry/PointSpec.js +104 -0
- data/lib/leaflet/spec/suites/geometry/PolyUtilSpec.js +27 -0
- data/lib/leaflet/spec/suites/geometry/TransformationSpec.js +31 -0
- data/lib/leaflet/spec/suites/layer/FeatureGroupSpec.js +36 -0
- data/lib/leaflet/spec/suites/layer/GeoJSONSpec.js +86 -0
- data/lib/leaflet/spec/suites/layer/LayerGroupSpec.js +58 -0
- data/lib/leaflet/spec/suites/layer/PopupSpec.js +59 -0
- data/lib/leaflet/spec/suites/layer/TileLayerSpec.js +87 -0
- data/lib/leaflet/spec/suites/layer/vector/CircleMarkerSpec.js +53 -0
- data/lib/leaflet/spec/suites/layer/vector/CircleSpec.js +17 -0
- data/lib/leaflet/spec/suites/layer/vector/PolygonSpec.js +55 -0
- data/lib/leaflet/spec/suites/layer/vector/PolylineGeometrySpec.js +35 -0
- data/lib/leaflet/spec/suites/layer/vector/PolylineSpec.js +55 -0
- data/lib/leaflet/spec/suites/map/MapSpec.js +244 -0
- data/lib/leaflet/src/Leaflet.js +23 -0
- data/lib/leaflet/src/control/Control.Attribution.js +115 -0
- data/lib/leaflet/src/control/Control.Layers.js +243 -0
- data/lib/leaflet/src/control/Control.Scale.js +112 -0
- data/lib/leaflet/src/control/Control.Zoom.js +86 -0
- data/lib/leaflet/src/control/Control.js +107 -0
- data/lib/leaflet/src/copyright.js +4 -0
- data/lib/leaflet/src/core/Browser.js +96 -0
- data/lib/leaflet/src/core/Class.js +106 -0
- data/lib/leaflet/src/core/Events.js +174 -0
- data/lib/leaflet/src/core/Handler.js +28 -0
- data/lib/leaflet/src/core/Util.js +182 -0
- data/lib/leaflet/src/dom/DomEvent.DoubleTap.js +103 -0
- data/lib/leaflet/src/dom/DomEvent.MsTouch.js +146 -0
- data/lib/leaflet/src/dom/DomEvent.js +211 -0
- data/lib/leaflet/src/dom/DomUtil.js +239 -0
- data/lib/leaflet/src/dom/Draggable.js +198 -0
- data/lib/leaflet/src/dom/PosAnimation.Timer.js +67 -0
- data/lib/leaflet/src/dom/PosAnimation.js +83 -0
- data/lib/leaflet/src/geo/LatLng.js +88 -0
- data/lib/leaflet/src/geo/LatLngBounds.js +153 -0
- data/lib/leaflet/src/geo/crs/CRS.EPSG3395.js +14 -0
- data/lib/leaflet/src/geo/crs/CRS.EPSG3857.js +21 -0
- data/lib/leaflet/src/geo/crs/CRS.EPSG4326.js +10 -0
- data/lib/leaflet/src/geo/crs/CRS.Simple.js +12 -0
- data/lib/leaflet/src/geo/crs/CRS.js +27 -0
- data/lib/leaflet/src/geo/projection/Projection.LonLat.js +13 -0
- data/lib/leaflet/src/geo/projection/Projection.Mercator.js +56 -0
- data/lib/leaflet/src/geo/projection/Projection.SphericalMercator.js +27 -0
- data/lib/leaflet/src/geo/projection/Projection.js +5 -0
- data/lib/leaflet/src/geometry/Bounds.js +95 -0
- data/lib/leaflet/src/geometry/LineUtil.js +202 -0
- data/lib/leaflet/src/geometry/Point.js +119 -0
- data/lib/leaflet/src/geometry/PolyUtil.js +55 -0
- data/lib/leaflet/src/geometry/Transformation.js +31 -0
- data/lib/leaflet/src/images/marker.svg +1 -0
- data/lib/leaflet/src/layer/FeatureGroup.js +81 -0
- data/lib/leaflet/src/layer/GeoJSON.js +245 -0
- data/lib/leaflet/src/layer/ImageOverlay.js +132 -0
- data/lib/leaflet/src/layer/LayerGroup.js +110 -0
- data/lib/leaflet/src/layer/Popup.js +316 -0
- data/lib/leaflet/src/layer/marker/DivIcon.js +43 -0
- data/lib/leaflet/src/layer/marker/Icon.Default.js +51 -0
- data/lib/leaflet/src/layer/marker/Icon.js +101 -0
- data/lib/leaflet/src/layer/marker/Marker.Drag.js +66 -0
- data/lib/leaflet/src/layer/marker/Marker.Popup.js +72 -0
- data/lib/leaflet/src/layer/marker/Marker.js +275 -0
- data/lib/leaflet/src/layer/tile/TileLayer.Anim.js +117 -0
- data/lib/leaflet/src/layer/tile/TileLayer.Canvas.js +60 -0
- data/lib/leaflet/src/layer/tile/TileLayer.WMS.js +83 -0
- data/lib/leaflet/src/layer/tile/TileLayer.js +578 -0
- data/lib/leaflet/src/layer/vector/Circle.js +98 -0
- data/lib/leaflet/src/layer/vector/CircleMarker.js +33 -0
- data/lib/leaflet/src/layer/vector/MultiPoly.js +47 -0
- data/lib/leaflet/src/layer/vector/Path.Popup.js +65 -0
- data/lib/leaflet/src/layer/vector/Path.SVG.js +219 -0
- data/lib/leaflet/src/layer/vector/Path.VML.js +125 -0
- data/lib/leaflet/src/layer/vector/Path.js +115 -0
- data/lib/leaflet/src/layer/vector/Polygon.js +81 -0
- data/lib/leaflet/src/layer/vector/Polyline.js +164 -0
- data/lib/leaflet/src/layer/vector/Rectangle.js +27 -0
- data/lib/leaflet/src/layer/vector/canvas/Circle.Canvas.js +18 -0
- data/lib/leaflet/src/layer/vector/canvas/Path.Canvas.js +196 -0
- data/lib/leaflet/src/layer/vector/canvas/Polygon.Canvas.js +37 -0
- data/lib/leaflet/src/layer/vector/canvas/Polyline.Canvas.js +30 -0
- data/lib/leaflet/src/map/Map.js +743 -0
- data/lib/leaflet/src/map/anim/Map.PanAnimation.js +88 -0
- data/lib/leaflet/src/map/anim/Map.ZoomAnimation.js +90 -0
- data/lib/leaflet/src/map/ext/Map.Geolocation.js +91 -0
- data/lib/leaflet/src/map/handler/Map.BoxZoom.js +104 -0
- data/lib/leaflet/src/map/handler/Map.DoubleClickZoom.js +23 -0
- data/lib/leaflet/src/map/handler/Map.Drag.js +146 -0
- data/lib/leaflet/src/map/handler/Map.Keyboard.js +147 -0
- data/lib/leaflet/src/map/handler/Map.ScrollWheelZoom.js +56 -0
- data/lib/leaflet/src/map/handler/Map.TouchZoom.js +121 -0
- data/vendor/assets/images/layers.png +0 -0
- data/vendor/assets/images/marker-icon-2x.png +0 -0
- data/vendor/assets/images/marker-icon.png +0 -0
- data/vendor/assets/images/marker-shadow.png +0 -0
- data/vendor/assets/images/spritesheet.png +0 -0
- data/vendor/assets/javascripts/leaflet.draw.js +39 -0
- data/vendor/assets/javascripts/leaflet.js +145 -0
- data/vendor/assets/javascripts/leaflet.label.js +9 -0
- data/vendor/assets/stylesheets/leaflet.css.erb +459 -0
- data/vendor/assets/stylesheets/leaflet.draw.css.erb +212 -0
- data/vendor/assets/stylesheets/leaflet.draw.ie.css +44 -0
- data/vendor/assets/stylesheets/leaflet.ie.css +51 -0
- data/vendor/assets/stylesheets/leaflet.label.css +33 -0
- metadata +317 -0
@@ -0,0 +1,155 @@
|
|
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 --auto` inside the `Leaflet` folder.
|
142
|
+
4. Open the website from the `_site` folder.
|
143
|
+
|
144
|
+
Now any file changes will be reflected on the generated 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, — 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!
|
@@ -0,0 +1,26 @@
|
|
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
|
+
desc('Check Leaflet source for errors with JSHint');
|
18
|
+
task('lint', build.lint);
|
19
|
+
|
20
|
+
desc('Combine and compress Leaflet source files');
|
21
|
+
task('build', ['lint'], build.build);
|
22
|
+
|
23
|
+
desc('Run PhantomJS tests');
|
24
|
+
task('test', ['lint'], build.test);
|
25
|
+
|
26
|
+
task('default', ['build']);
|
data/lib/leaflet/LICENSE
ADDED
@@ -0,0 +1,23 @@
|
|
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.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<img src="http://leafletjs.com/docs/images/logo.png" alt="Leaflet" />
|
2
|
+
|
3
|
+
Leaflet is a modern open-source JavaScript library for **mobile-friendly interactive maps**.
|
4
|
+
It is developed by [Vladimir Agafonkin][] with a team of dedicated [contributors][].
|
5
|
+
Weighing just about 27 KB of gzipped JS code, it has all the [features][] most developers ever need for online maps.
|
6
|
+
|
7
|
+
Leaflet is designed with *simplicity*, *performance* and *usability* in mind.
|
8
|
+
It works efficiently across all major desktop and mobile platforms out of the box,
|
9
|
+
taking advantage of HTML5 and CSS3 on modern browsers while being accessible on older ones too.
|
10
|
+
It can also be extended with many [plugins][],
|
11
|
+
has a beautiful, easy to use and [well-documented][] API
|
12
|
+
and a simple, readable [source code][] that is a joy to [contribute][] to.
|
13
|
+
|
14
|
+
For more information, check out the [official website][].
|
15
|
+
|
16
|
+
We're happy to meet new contributors.
|
17
|
+
If you want to **get involved** with Leaflet development, check out the [contribution guide][contribute].
|
18
|
+
Let's make the best open-source library for maps that can possibly exist!
|
19
|
+
|
20
|
+
[![Build Status](https://travis-ci.org/Leaflet/Leaflet.png?branch=master)](https://travis-ci.org/Leaflet/Leaflet)
|
21
|
+
|
22
|
+
[Vladimir Agafonkin]: http://agafonkin.com/en
|
23
|
+
[contributors]: https://github.com/Leaflet/Leaflet/graphs/contributors
|
24
|
+
[features]: http://leafletjs.com/features.html
|
25
|
+
[plugins]: http://leafletjs.com/plugins.html
|
26
|
+
[well-documented]: http://leafletjs.com/reference.html "Leaflet API reference"
|
27
|
+
[source code]: https://github.com/Leaflet/Leaflet "Leaflet GitHub repository"
|
28
|
+
[hosted on GitHub]: http://github.com/Leaflet/Leaflet
|
29
|
+
[contribute]: https://github.com/Leaflet/Leaflet/blob/master/CONTRIBUTING.md "A guide to contributing to Leaflet"
|
30
|
+
[official website]: http://leafletjs.com
|
@@ -0,0 +1,243 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Leaflet Build Helper</title>
|
5
|
+
|
6
|
+
<script type="text/javascript" src="deps.js"></script>
|
7
|
+
|
8
|
+
<style type="text/css">
|
9
|
+
body {
|
10
|
+
font: 12px/1.4 Verdana, sans-serif;
|
11
|
+
text-align: center;
|
12
|
+
padding: 2em 0;
|
13
|
+
}
|
14
|
+
#container {
|
15
|
+
text-align: left;
|
16
|
+
margin: 0 auto;
|
17
|
+
width: 780px;
|
18
|
+
}
|
19
|
+
#deplist {
|
20
|
+
list-style: none;
|
21
|
+
padding: 0;
|
22
|
+
}
|
23
|
+
#deplist li {
|
24
|
+
padding-top: 7px;
|
25
|
+
padding-bottom: 7px;
|
26
|
+
border-bottom: 1px solid #ddd;
|
27
|
+
}
|
28
|
+
#deplist li.heading {
|
29
|
+
border: none;
|
30
|
+
background: #ddd;
|
31
|
+
padding: 5px 10px;
|
32
|
+
margin-top: 25px;
|
33
|
+
border-radius: 5px;
|
34
|
+
}
|
35
|
+
#deplist input {
|
36
|
+
float: left;
|
37
|
+
margin-right: 5px;
|
38
|
+
display: inline;
|
39
|
+
}
|
40
|
+
#deplist label {
|
41
|
+
float: left;
|
42
|
+
width: 160px;
|
43
|
+
font-weight: bold;
|
44
|
+
}
|
45
|
+
#deplist div {
|
46
|
+
display: table-cell;
|
47
|
+
height: 1%;
|
48
|
+
}
|
49
|
+
#deplist .desc {
|
50
|
+
}
|
51
|
+
|
52
|
+
#deplist .deps {
|
53
|
+
color: #777;
|
54
|
+
}
|
55
|
+
|
56
|
+
#command {
|
57
|
+
width: 100%;
|
58
|
+
}
|
59
|
+
#command2 {
|
60
|
+
width: 200px;
|
61
|
+
}
|
62
|
+
|
63
|
+
#toolbar {
|
64
|
+
padding-bottom: 10px;
|
65
|
+
border-bottom: 1px solid #ddd;
|
66
|
+
}
|
67
|
+
|
68
|
+
h2 {
|
69
|
+
margin-top: 2em;
|
70
|
+
}
|
71
|
+
</style>
|
72
|
+
</head>
|
73
|
+
<body>
|
74
|
+
<div id="container">
|
75
|
+
<h1>Leaflet Build Helper</h1>
|
76
|
+
|
77
|
+
<p id="toolbar">
|
78
|
+
<a id="select-all" href="#all">Select All</a> |
|
79
|
+
<a id="deselect-all" href="#none">Deselect All</a>
|
80
|
+
</p>
|
81
|
+
|
82
|
+
<ul id="deplist"></ul>
|
83
|
+
|
84
|
+
<h2>Building using Node and UglifyJS</h2>
|
85
|
+
<ol>
|
86
|
+
<li><a href="http://nodejs.org/#download">Download and install Node</a></li>
|
87
|
+
<li>Run this in the command line:<br />
|
88
|
+
<pre><code>npm install -g jake
|
89
|
+
npm install jshint
|
90
|
+
npm install uglify-js</code></pre></li>
|
91
|
+
<li>Run this command inside the Leaflet directory: <br /><input type="text" id="command2" />
|
92
|
+
</ol>
|
93
|
+
<h2>Building using Closure Compiler</h2>
|
94
|
+
<ol>
|
95
|
+
<li><a href="http://closure-compiler.googlecode.com/files/compiler-latest.zip">Download Closure Compiler</a>, extract it into <code>closure-compiler</code> directory</li>
|
96
|
+
<li>Run this command in the root Leaflet directory: <br /><input type="text" id="command" /></li>
|
97
|
+
</ol>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
<script type="text/javascript">
|
101
|
+
var deplist = document.getElementById('deplist'),
|
102
|
+
commandInput = document.getElementById('command'),
|
103
|
+
commandInput2 = document.getElementById('command2');
|
104
|
+
|
105
|
+
document.getElementById('select-all').onclick = function() {
|
106
|
+
var checks = deplist.getElementsByTagName('input');
|
107
|
+
for (var i = 0; i < checks.length; i++) {
|
108
|
+
checks[i].checked = true;
|
109
|
+
}
|
110
|
+
updateCommand();
|
111
|
+
return false;
|
112
|
+
};
|
113
|
+
|
114
|
+
document.getElementById('deselect-all').onclick = function() {
|
115
|
+
var checks = deplist.getElementsByTagName('input');
|
116
|
+
for (var i = 0; i < checks.length; i++) {
|
117
|
+
if (!checks[i].disabled) {
|
118
|
+
checks[i].checked = false;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
updateCommand();
|
122
|
+
return false;
|
123
|
+
};
|
124
|
+
|
125
|
+
function updateCommand() {
|
126
|
+
var files = {};
|
127
|
+
var checks = deplist.getElementsByTagName('input');
|
128
|
+
var compsStr = '';
|
129
|
+
|
130
|
+
for (var i = 0, len = checks.length; i < len; i++) {
|
131
|
+
if (checks[i].checked) {
|
132
|
+
var srcs = deps[checks[i].id].src;
|
133
|
+
for (var j = 0, len2 = srcs.length; j < len2; j++) {
|
134
|
+
files[srcs[j]] = true;
|
135
|
+
}
|
136
|
+
compsStr = '1' + compsStr;
|
137
|
+
} else {
|
138
|
+
compsStr = '0' + compsStr;
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
var command = 'java -jar closure-compiler/compiler.jar ';
|
143
|
+
for (var src in files) {
|
144
|
+
command += '--js src/' + src + ' ';
|
145
|
+
}
|
146
|
+
command += '--js_output_file dist/leaflet-custom.js';
|
147
|
+
|
148
|
+
commandInput.value = command;
|
149
|
+
|
150
|
+
commandInput2.value = 'jake build[' + parseInt(compsStr, 2).toString(32) + ',custom]';
|
151
|
+
}
|
152
|
+
|
153
|
+
function inputSelect() {
|
154
|
+
this.focus();
|
155
|
+
this.select();
|
156
|
+
};
|
157
|
+
|
158
|
+
commandInput.onclick = inputSelect;
|
159
|
+
commandInput2.onclick = inputSelect;
|
160
|
+
|
161
|
+
function onCheckboxChange() {
|
162
|
+
if (this.checked) {
|
163
|
+
var depDeps = deps[this.id].deps;
|
164
|
+
if (depDeps) {
|
165
|
+
for (var i = 0; i < depDeps.length; i++) {
|
166
|
+
var check = document.getElementById(depDeps[i]);
|
167
|
+
if (!check.checked) {
|
168
|
+
check.checked = true;
|
169
|
+
check.onchange();
|
170
|
+
}
|
171
|
+
}
|
172
|
+
}
|
173
|
+
} else {
|
174
|
+
var checks = deplist.getElementsByTagName('input');
|
175
|
+
for (var i = 0; i < checks.length; i++) {
|
176
|
+
var dep = deps[checks[i].id];
|
177
|
+
if (!dep.deps) { continue; }
|
178
|
+
for (var j = 0; j < dep.deps.length; j++) {
|
179
|
+
if (dep.deps[j] === this.id) {
|
180
|
+
if (checks[i].checked) {
|
181
|
+
checks[i].checked = false;
|
182
|
+
checks[i].onchange();
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}
|
187
|
+
}
|
188
|
+
updateCommand();
|
189
|
+
}
|
190
|
+
|
191
|
+
for (var name in deps) {
|
192
|
+
var li = document.createElement('li');
|
193
|
+
|
194
|
+
if (deps[name].heading) {
|
195
|
+
var heading = document.createElement('li');
|
196
|
+
heading.className = 'heading';
|
197
|
+
heading.appendChild(document.createTextNode(deps[name].heading));
|
198
|
+
deplist.appendChild(heading);
|
199
|
+
}
|
200
|
+
|
201
|
+
var div = document.createElement('div');
|
202
|
+
|
203
|
+
var label = document.createElement('label');
|
204
|
+
|
205
|
+
var check = document.createElement('input');
|
206
|
+
check.type = 'checkbox';
|
207
|
+
check.id = name;
|
208
|
+
label.appendChild(check);
|
209
|
+
check.onchange = onCheckboxChange;
|
210
|
+
|
211
|
+
if (name == 'Core') {
|
212
|
+
check.checked = true;
|
213
|
+
check.disabled = true;
|
214
|
+
}
|
215
|
+
|
216
|
+
label.appendChild(document.createTextNode(name));
|
217
|
+
label.htmlFor = name;
|
218
|
+
|
219
|
+
li.appendChild(label);
|
220
|
+
|
221
|
+
var desc = document.createElement('span');
|
222
|
+
desc.className = 'desc';
|
223
|
+
desc.appendChild(document.createTextNode(deps[name].desc));
|
224
|
+
|
225
|
+
var depText = deps[name].deps && deps[name].deps.join(', ');
|
226
|
+
if (depText) {
|
227
|
+
var depspan = document.createElement('span');
|
228
|
+
depspan.className = 'deps';
|
229
|
+
depspan.appendChild(document.createTextNode('Deps: ' + depText));
|
230
|
+
}
|
231
|
+
|
232
|
+
div.appendChild(desc);
|
233
|
+
div.appendChild(document.createElement('br'));
|
234
|
+
if (depText) { div.appendChild(depspan); }
|
235
|
+
|
236
|
+
li.appendChild(div);
|
237
|
+
|
238
|
+
deplist.appendChild(li);
|
239
|
+
}
|
240
|
+
updateCommand();
|
241
|
+
</script>
|
242
|
+
</body>
|
243
|
+
</html>
|