leaflet-ruby 0.3.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +5 -0
- data/LICENSE +21 -0
- data/README.rdoc +55 -0
- data/Rakefile +15 -0
- data/leaflet-ruby.gemspec +24 -0
- data/lib/leaflet-ruby.rb +18 -0
- data/lib/leaflet/CHANGELOG.md +181 -0
- data/lib/leaflet/Jakefile.js +65 -0
- data/lib/leaflet/LICENSE +22 -0
- data/lib/leaflet/README.md +32 -0
- data/lib/leaflet/build/build.html +243 -0
- data/lib/leaflet/build/build.js +79 -0
- data/lib/leaflet/build/deps.js +231 -0
- data/lib/leaflet/build/hint.js +30 -0
- data/lib/leaflet/build/hintrc.js +44 -0
- data/lib/leaflet/debug/control/control-layers.html +47 -0
- data/lib/leaflet/debug/control/map-control.html +29 -0
- data/lib/leaflet/debug/css/mobile.css +6 -0
- data/lib/leaflet/debug/css/screen.css +5 -0
- data/lib/leaflet/debug/geojson/geojson-sample.js +53 -0
- data/lib/leaflet/debug/geojson/geojson.html +56 -0
- data/lib/leaflet/debug/leaflet-include.js +120 -0
- data/lib/leaflet/debug/map/canvas.html +46 -0
- data/lib/leaflet/debug/map/map-mobile.html +42 -0
- data/lib/leaflet/debug/map/map.html +54 -0
- data/lib/leaflet/debug/map/max-bounds.html +36 -0
- data/lib/leaflet/debug/map/scroll.html +35 -0
- data/lib/leaflet/debug/map/wms-marble.html +30 -0
- data/lib/leaflet/debug/map/wms.html +37 -0
- data/lib/leaflet/debug/vector/editable.html +43 -0
- data/lib/leaflet/debug/vector/route.js +1 -0
- data/lib/leaflet/debug/vector/vector-bounds.html +69 -0
- data/lib/leaflet/debug/vector/vector-canvas.html +92 -0
- data/lib/leaflet/debug/vector/vector-mobile.html +38 -0
- data/lib/leaflet/debug/vector/vector-simple.html +63 -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-shadow.png +0 -0
- data/lib/leaflet/dist/images/marker.png +0 -0
- data/lib/leaflet/dist/images/popup-close.png +0 -0
- data/lib/leaflet/dist/images/zoom-in.png +0 -0
- data/lib/leaflet/dist/images/zoom-out.png +0 -0
- data/lib/leaflet/dist/leaflet-src.js +5537 -0
- data/lib/leaflet/dist/leaflet.css +323 -0
- data/lib/leaflet/dist/leaflet.ie.css +48 -0
- data/lib/leaflet/dist/leaflet.js +6 -0
- data/lib/leaflet/lib/jasmine/jasmine-html.js +182 -0
- data/lib/leaflet/lib/jasmine/jasmine.css +166 -0
- data/lib/leaflet/lib/jasmine/jasmine.js +2421 -0
- data/lib/leaflet/spec/runner.html +57 -0
- data/lib/leaflet/spec/suites/LeafletSpec.js +15 -0
- data/lib/leaflet/spec/suites/SpecHelper.js +28 -0
- data/lib/leaflet/spec/suites/core/ClassSpec.js +153 -0
- data/lib/leaflet/spec/suites/core/EventsSpec.js +110 -0
- data/lib/leaflet/spec/suites/core/UtilSpec.js +63 -0
- data/lib/leaflet/spec/suites/dom/DomEventSpec.js +102 -0
- data/lib/leaflet/spec/suites/dom/DomUtilSpec.js +59 -0
- data/lib/leaflet/spec/suites/geo/LatLngBoundsSpec.js +1 -0
- data/lib/leaflet/spec/suites/geo/LatLngSpec.js +76 -0
- data/lib/leaflet/spec/suites/geo/ProjectionSpec.js +42 -0
- data/lib/leaflet/spec/suites/geometry/BoundsSpec.js +53 -0
- data/lib/leaflet/spec/suites/geometry/PointSpec.js +45 -0
- data/lib/leaflet/spec/suites/geometry/TransformationSpec.js +19 -0
- data/lib/leaflet/spec/suites/layer/TileLayerSpec.js +1 -0
- data/lib/leaflet/spec/suites/layer/vector/PolylineGeometrySpec.js +35 -0
- data/lib/leaflet/spec/suites/map/MapSpec.js +1 -0
- data/lib/leaflet/src/Leaflet.js +33 -0
- data/lib/leaflet/src/control/Control.Attribution.js +66 -0
- data/lib/leaflet/src/control/Control.Layers.js +167 -0
- data/lib/leaflet/src/control/Control.Zoom.js +36 -0
- data/lib/leaflet/src/control/Control.js +9 -0
- data/lib/leaflet/src/core/Browser.js +53 -0
- data/lib/leaflet/src/core/Class.js +66 -0
- data/lib/leaflet/src/core/Events.js +62 -0
- data/lib/leaflet/src/core/Handler.js +29 -0
- data/lib/leaflet/src/core/Util.js +108 -0
- data/lib/leaflet/src/dom/DomEvent.DoubleTap.js +43 -0
- data/lib/leaflet/src/dom/DomEvent.js +154 -0
- data/lib/leaflet/src/dom/DomUtil.js +155 -0
- data/lib/leaflet/src/dom/Draggable.js +147 -0
- data/lib/leaflet/src/dom/transition/Transition.Native.js +102 -0
- data/lib/leaflet/src/dom/transition/Transition.Timer.js +126 -0
- data/lib/leaflet/src/dom/transition/Transition.js +28 -0
- data/lib/leaflet/src/geo/LatLng.js +44 -0
- data/lib/leaflet/src/geo/LatLngBounds.js +86 -0
- data/lib/leaflet/src/geo/crs/CRS.EPSG3395.js +13 -0
- data/lib/leaflet/src/geo/crs/CRS.EPSG3857.js +17 -0
- data/lib/leaflet/src/geo/crs/CRS.EPSG4326.js +7 -0
- data/lib/leaflet/src/geo/crs/CRS.js +17 -0
- data/lib/leaflet/src/geo/projection/Projection.LonLat.js +10 -0
- data/lib/leaflet/src/geo/projection/Projection.Mercator.js +51 -0
- data/lib/leaflet/src/geo/projection/Projection.SphericalMercator.js +23 -0
- data/lib/leaflet/src/geo/projection/Projection.js +5 -0
- data/lib/leaflet/src/geometry/Bounds.js +50 -0
- data/lib/leaflet/src/geometry/LineUtil.js +194 -0
- data/lib/leaflet/src/geometry/Point.js +66 -0
- data/lib/leaflet/src/geometry/PolyUtil.js +59 -0
- data/lib/leaflet/src/geometry/Transformation.js +31 -0
- data/lib/leaflet/src/layer/FeatureGroup.js +40 -0
- data/lib/leaflet/src/layer/GeoJSON.js +104 -0
- data/lib/leaflet/src/layer/ImageOverlay.js +58 -0
- data/lib/leaflet/src/layer/LayerGroup.js +74 -0
- data/lib/leaflet/src/layer/Popup.js +179 -0
- data/lib/leaflet/src/layer/marker/Icon.js +58 -0
- data/lib/leaflet/src/layer/marker/Marker.Drag.js +57 -0
- data/lib/leaflet/src/layer/marker/Marker.Popup.js +42 -0
- data/lib/leaflet/src/layer/marker/Marker.js +142 -0
- data/lib/leaflet/src/layer/tile/TileLayer.Canvas.js +41 -0
- data/lib/leaflet/src/layer/tile/TileLayer.WMS.js +47 -0
- data/lib/leaflet/src/layer/tile/TileLayer.js +310 -0
- data/lib/leaflet/src/layer/vector/Circle.js +68 -0
- data/lib/leaflet/src/layer/vector/CircleMarker.js +25 -0
- data/lib/leaflet/src/layer/vector/MultiPoly.js +34 -0
- data/lib/leaflet/src/layer/vector/Path.Popup.js +24 -0
- data/lib/leaflet/src/layer/vector/Path.SVG.js +138 -0
- data/lib/leaflet/src/layer/vector/Path.VML.js +93 -0
- data/lib/leaflet/src/layer/vector/Path.js +88 -0
- data/lib/leaflet/src/layer/vector/Polygon.js +64 -0
- data/lib/leaflet/src/layer/vector/Polyline.js +146 -0
- data/lib/leaflet/src/layer/vector/canvas/Circle.Canvas.js +18 -0
- data/lib/leaflet/src/layer/vector/canvas/Path.Canvas.js +146 -0
- data/lib/leaflet/src/layer/vector/canvas/Polygon.Canvas.js +34 -0
- data/lib/leaflet/src/layer/vector/canvas/Polyline.Canvas.js +27 -0
- data/lib/leaflet/src/map/Map.js +613 -0
- data/lib/leaflet/src/map/anim/Map.PanAnimation.js +70 -0
- data/lib/leaflet/src/map/anim/Map.ZoomAnimation.js +133 -0
- data/lib/leaflet/src/map/ext/Map.Control.js +50 -0
- data/lib/leaflet/src/map/ext/Map.Geolocation.js +86 -0
- data/lib/leaflet/src/map/ext/Map.Popup.js +20 -0
- data/lib/leaflet/src/map/handler/Map.BoxZoom.js +73 -0
- data/lib/leaflet/src/map/handler/Map.DoubleClickZoom.js +18 -0
- data/lib/leaflet/src/map/handler/Map.Drag.js +81 -0
- data/lib/leaflet/src/map/handler/Map.ScrollWheelZoom.js +55 -0
- data/lib/leaflet/src/map/handler/Map.TouchZoom.js +93 -0
- data/lib/zerista/CRS.Cartesian.js +20 -0
- data/lib/zerista/Projection.Identity.js +11 -0
- data/lib/zerista/zerista_layer.js +97 -0
- data/vendor/assets/javascripts/leaflet.js +139 -0
- data/vendor/assets/stylesheets/leaflet.css +1 -0
- data/vendor/assets/stylesheets/leaflet.ie.css +1 -0
- metadata +185 -0
data/CHANGELOG.rdoc
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2008-2011 Charlie Savage and contributors
|
2
|
+
Copyright (c) 2002-2007 Sean Chittenden and contributors
|
3
|
+
Copyright (c) 2001 Wai-Sun "Squidster" Chia
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
9
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
10
|
+
so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
= Leaflet Ruby
|
2
|
+
|
3
|
+
== Overview
|
4
|
+
leaflet-ruby wraps the Leaflet Javascript library in an asset gem so it can
|
5
|
+
easily be used with Rails. For more information about the Leaflet library,
|
6
|
+
please visit http://leaflet.cloudmade.com/.
|
7
|
+
|
8
|
+
== Installation
|
9
|
+
|
10
|
+
In your Gemfile, add this line:
|
11
|
+
|
12
|
+
gem "leaflet-ruby"
|
13
|
+
|
14
|
+
Then, run bundle install. You're done!
|
15
|
+
|
16
|
+
== Usage
|
17
|
+
|
18
|
+
Leaflet provides javascript, css and image assets. To use these assets in your project, either
|
19
|
+
require the files below from your erb files or add them to your top level application.js and css files.
|
20
|
+
|
21
|
+
Leaflet provides the following assets:
|
22
|
+
|
23
|
+
=== Javascripts
|
24
|
+
|
25
|
+
leaflet.js
|
26
|
+
|
27
|
+
=== Stylesheets
|
28
|
+
|
29
|
+
leaflet.css
|
30
|
+
leaflet.ie.css
|
31
|
+
|
32
|
+
=== Images
|
33
|
+
|
34
|
+
layers.png
|
35
|
+
marker.png
|
36
|
+
market-shadow.png
|
37
|
+
popup-close.png
|
38
|
+
zoom-in.png
|
39
|
+
zoom-out.png
|
40
|
+
|
41
|
+
== Versions
|
42
|
+
|
43
|
+
The version number of the leaflet-ruby gem matches the version number of the leaflet library
|
44
|
+
that it wraps. Thus if you want to use Leaflet version 0.3 you should use leaflet-ruby-0.3.gem.
|
45
|
+
|
46
|
+
== Support
|
47
|
+
|
48
|
+
If you have any questions about leaflet, please refer them to the Leaflet maintainers at
|
49
|
+
http://leaflet.cloudmade.com. If you have any questions about how leaflet-ruby wraps
|
50
|
+
leaflet, then please refer to https://github.com/cfis/leaflet-ruby.
|
51
|
+
|
52
|
+
== License
|
53
|
+
|
54
|
+
See LICENSE for license information about leaflet-ruby. Please note that the Leaflet project
|
55
|
+
has its own LICENSE file also.
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "rubygems/package_task"
|
5
|
+
|
6
|
+
GEM_NAME = "leaflet-ruby"
|
7
|
+
|
8
|
+
# Read the spec file
|
9
|
+
spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
|
10
|
+
|
11
|
+
# Setup generic gem
|
12
|
+
Gem::PackageTask.new(spec) do |pkg|
|
13
|
+
pkg.package_dir = 'pkg'
|
14
|
+
pkg.need_tar = false
|
15
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
Gem::Specification.new do |spec|
|
3
|
+
spec.name = 'leaflet-ruby'
|
4
|
+
spec.version = '0.3.beta1'
|
5
|
+
spec.homepage = 'https://github.com/cfis/leaflet-ruby'
|
6
|
+
spec.summary = <<-EOS
|
7
|
+
Wraps the Leaflet Javascript Mapping Library in a Rails asset gem. For more information
|
8
|
+
about Leaflet please see http://leaflet.cloudmade.com.
|
9
|
+
EOS
|
10
|
+
spec.authors = ['Charlie Savage']
|
11
|
+
spec.platform = Gem::Platform::RUBY
|
12
|
+
spec.files = Dir.glob(['leaflet-ruby.gemspec',
|
13
|
+
'CHANGELOG.rdoc',
|
14
|
+
'LICENSE',
|
15
|
+
'Rakefile',
|
16
|
+
'README.rdoc',
|
17
|
+
'lib/leaflet-ruby.rb',
|
18
|
+
'lib/zerista/*',
|
19
|
+
'lib/leaflet/**/*',
|
20
|
+
'vendor/assets/stylesheets/*.css',
|
21
|
+
'vendor/assets/javascripts/*.js'])
|
22
|
+
spec.required_ruby_version = '>= 1.8.7'
|
23
|
+
spec.date = Time.now
|
24
|
+
end
|
data/lib/leaflet-ruby.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Leaflet
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
initializer :append_assets_path do |app|
|
4
|
+
puts 1111111111111
|
5
|
+
puts config.root
|
6
|
+
puts File.join(config.root, 'lib')
|
7
|
+
|
8
|
+
# For javascripts
|
9
|
+
app.config.assets.paths << File.join(config.root, 'lib', 'leaflet', 'src')
|
10
|
+
|
11
|
+
# For images and stylesheets
|
12
|
+
app.config.assets.paths << File.join(config.root, 'lib', 'leaflet', 'dist')
|
13
|
+
|
14
|
+
# For additional files
|
15
|
+
app.config.assets.paths << File.join(config.root, 'lib', 'zerista')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,181 @@
|
|
1
|
+
Leaflet Changelog
|
2
|
+
=================
|
3
|
+
|
4
|
+
(all changes without author notice are by [@mourner](https://github.com/mourner))
|
5
|
+
|
6
|
+
## 0.3 (master)
|
7
|
+
|
8
|
+
### Major features
|
9
|
+
|
10
|
+
* Added **Canvas backend** for vector layers (polylines, polygons, circles). This enables vector support on Android < 3, and it can also be optionally preferred over SVG for a performance gain in some cases. Thanks to [@florianf](https://github.com/florianf) for a big part of this work.
|
11
|
+
* Added **layers control** (`Control.Layers`) for convenient layer switching.
|
12
|
+
* Added ability to set **max bounds** within which users can pan/zoom. [#93](https://github.com/CloudMade/Leaflet/issues/93)
|
13
|
+
|
14
|
+
### Improvements
|
15
|
+
|
16
|
+
#### Usability improvements
|
17
|
+
|
18
|
+
* Map now preserves its center after resize.
|
19
|
+
* When panning to another copy of the world (that's infinite horizontally), map overlays now jump to corresponding positions. [#273](https://github.com/CloudMade/Leaflet/issues/273)
|
20
|
+
* Limited maximum zoom change on a single mouse wheel movement (so you won't zoom across the whole zoom range in one scroll). [#149](https://github.com/CloudMade/Leaflet/issues/149)
|
21
|
+
* Improved circles performance by not drawing them if they're off the clip region.
|
22
|
+
|
23
|
+
#### API improvements
|
24
|
+
|
25
|
+
* Added ability to add a tile layer below all others (`map.addLayer(layer, true)`) (useful for switching base tile layers).
|
26
|
+
* Added `Map` `zoomstart` event (thanks to [@Fabiz](https://github.com/Fabiz)). [#377](https://github.com/CloudMade/Leaflet/pull/377)
|
27
|
+
* Improved `Map` `locate` method, added ability to watch location continuously and more options. [#212](https://github.com/CloudMade/Leaflet/issues/212)
|
28
|
+
* Added second argument `inside` to `Map` `getBoundsZoom` method that allows you to get appropriate zoom for the view to fit *inside* the given bounds.
|
29
|
+
* Added `hasLayer` method to `Map`.
|
30
|
+
* Added `Marker` `zIndexOffset` option to be able to set certain markers below/above others. [#65](https://github.com/CloudMade/Leaflet/issues/65)
|
31
|
+
* Added `urlParams` third optional argument to `TileLayer` constructor for convenience: an object with properties that will be evaluated in the URL template.
|
32
|
+
* Added `TileLayer` `continuousWorld` option to disable tile coordinates checking/wrapping.
|
33
|
+
* Added `TileLayer` `tileunload` event fired when tile gets removed after panning (by [@CodeJosch](https://github.com/CodeJosch)). [#256](https://github.com/CloudMade/Leaflet/pull/256)
|
34
|
+
* Added `TileLayer` `zoomOffset` option useful for non-256px tiles (by [@msaspence](https://github.com/msaspence)).
|
35
|
+
* Added `Polyline` `closestLayerPoint` method that's can be useful for interaction features (by [@anru](https://github.com/anru)). [#186](https://github.com/CloudMade/Leaflet/pull/186)
|
36
|
+
* Added `setLatLngs` method to `MultiPolyline` and `MultiPolygon` (by [@anru](https://github.com/anru)). [#194](https://github.com/CloudMade/Leaflet/pull/194)
|
37
|
+
* Added `getBounds` method to `Polyline` and `Polygon` (by [@JasonSanford](https://github.com/JasonSanford)). [#253](https://github.com/CloudMade/Leaflet/pull/253)
|
38
|
+
* Added `FeatureGroup` `setStyle` method (also inherited by `MultiPolyline` and `MultiPolygon`). [#353](https://github.com/CloudMade/Leaflet/issues/353)
|
39
|
+
* Added `FeatureGroup` `invoke` method to call a particular method on all layers of the group with the given arguments.
|
40
|
+
* Added `ImageOverlay` `load` event. [#213](https://github.com/CloudMade/Leaflet/issues/213)
|
41
|
+
* Added `minWidth` option to `Popup` (by [@marphi](https://github.com/marphi)). [#214](https://github.com/CloudMade/Leaflet/pull/214)
|
42
|
+
* Improved `LatLng` constructor to be more tolerant (and throw descriptive error if latitude or longitude can't be interpreted as a number). [#136](https://github.com/CloudMade/Leaflet/issues/136)
|
43
|
+
* Added `LatLngBounds` `toBBoxString` method for convenience (by [@JasonSanford](https://github.com/JasonSanford)). [#263](https://github.com/CloudMade/Leaflet/pull/263)
|
44
|
+
* Added `LatLngBounds` `intersects(otherBounds)` method (thanks to [@pagameba](https://github.com/pagameba)). [#350](https://github.com/CloudMade/Leaflet/pull/350)
|
45
|
+
* Added `L.Util.template` method for simple string template evaluation.
|
46
|
+
* Added `DomUtil.removeClass` method (by [@anru](https://github.com/anru)).
|
47
|
+
* Improved browser-specific code to rely more on feature detection rather than user agent string.
|
48
|
+
* Improved superclass access mechanism to work with inheritance chains of 3 or more classes; now you should use `Klass.superclass` instead of `this.superclass` (by [@anru](https://github.com/anru)). [#179](https://github.com/CloudMade/Leaflet/pull/179)
|
49
|
+
|
50
|
+
### Bugfixes
|
51
|
+
|
52
|
+
#### General bugfixes
|
53
|
+
|
54
|
+
* Fixed a bug where `Circle` was rendered with incorrect radius (didn't take projection exagerration into account). [#331](https://github.com/CloudMade/Leaflet/issues/331)
|
55
|
+
* Fixed a bug where `Map` `getBounds` would work incorrectly on a date line cross. [#295](https://github.com/CloudMade/Leaflet/issues/295)
|
56
|
+
* Fixed a bug where polygons and polylines sometimes rendered incorrectly on some zoom levels. [#381](https://github.com/CloudMade/Leaflet/issues/381)
|
57
|
+
* Fixed a bug where fast mouse wheel zoom worked incorrectly when approaching min/max zoom values.
|
58
|
+
* Fixed a bug where `GeoJSON` `pointToLayer` option wouldn't work in a `GeometryCollection`. [#391](https://github.com/CloudMade/Leaflet/issues/391)
|
59
|
+
* Fixed a bug with incorrect rendering of GeoJSON on a date line cross. [#354](https://github.com/CloudMade/Leaflet/issues/354)
|
60
|
+
* Fixed a bug where map panning would stuck forever after releasing the mouse over an iframe or a flash object (thanks to [@sten82](https://github.com/sten82)). [#297](https://github.com/CloudMade/Leaflet/pull/297) [#64](https://github.com/CloudMade/Leaflet/issues/64)
|
61
|
+
* Fixed a bug where mouse wheel zoom worked incorrectly if map is inside scrolled container (partially by [@chrillo](https://github.com/chrillo)). [#206](https://github.com/CloudMade/Leaflet/issues/206)
|
62
|
+
* Fixed a bug where it was possible to add the same listener twice. [#281](https://github.com/CloudMade/Leaflet/issues/281)
|
63
|
+
* Fixed a bug where `Circle` was rendered with incorrect radius (didn't take projection exaggeration into account). [#331](https://github.com/CloudMade/Leaflet/issues/331)
|
64
|
+
* Fixed a bug where `Marker` `setIcon` was not working properly (by [@marphi](https://github.com/marphi)). [#218](https://github.com/CloudMade/Leaflet/pull/218) [#311](https://github.com/CloudMade/Leaflet/issues/311)
|
65
|
+
* Fixed a bug where `Marker` `setLatLng` was not working if it's set before adding the marker to a map. [#222](https://github.com/CloudMade/Leaflet/issues/222)
|
66
|
+
* Fixed a bug where marker popup would not move on `Marker` `setLatLng` (by [@tjarratt](https://github.com/tjarratt)). [#272](https://github.com/CloudMade/Leaflet/pull/272)
|
67
|
+
* Fixed a bug where static properties of a child class would not override the parent ones.
|
68
|
+
* Fixed broken popup `closePopup` option (by [@jgerigmeyer](https://github.com/jgerigmeyer)).
|
69
|
+
* Fixed a bug that caused en error when dragging marker with icon without shadow (by [@anru](https://github.com/anru)). [#178](https://github.com/CloudMade/Leaflet/issues/178)
|
70
|
+
* Fixed a typo in `Bounds` `contains` method (by [@anru](https://github.com/anru)). [#180](https://github.com/CloudMade/Leaflet/pull/180)
|
71
|
+
* Fixed a bug where creating an empty `Polygon` with `new L.Polygon()` would raise an error.
|
72
|
+
* Fixed a bug where drag event fired before the actual movement of layer (by [@anru](https://github.com/anru)). [#197](https://github.com/CloudMade/Leaflet/pull/197)
|
73
|
+
* Fixed a bug where map click caused an error if dragging is initially disabled. [#196](https://github.com/CloudMade/Leaflet/issues/196)
|
74
|
+
* Fixed a bug where map `movestart` event would fire after zoom animation.
|
75
|
+
* Fixed a bug where attribution prefix would not update on `setPrefix`. [#195](https://github.com/CloudMade/Leaflet/issues/195)
|
76
|
+
* Fixed a bug where `TileLayer` `load` event wouldn't fire in some edge cases (by [@dravnic](https://github.com/dravnic)).
|
77
|
+
* Fixed a bug related to clearing background tiles after zooming (by [@neno-giscloud](https://github.com/neno-giscloud) & [@dravnic](https://github.com/dravnic)).
|
78
|
+
* Fixed a bug related to cleaning up after removing tile layers (by [@dravnic](https://github.com/dravnic)). [#276](https://github.com/CloudMade/Leaflet/pull/276)
|
79
|
+
* Fixed a bug that made selecting text in the attribution control impossible. [#279](https://github.com/CloudMade/Leaflet/issues/279)
|
80
|
+
* Fixed a bug when initializing a map in a non-empty div. [#278](https://github.com/CloudMade/Leaflet/issues/278)
|
81
|
+
* Fixed a bug where `movestart` didn't fire on panning animation.
|
82
|
+
* Fixed a bug in Elliptical Mercator formula that affeted `EPSG:3395` CRS (by [@Savvkin](https://github.com/Savvkin)). [#358](https://github.com/CloudMade/Leaflet/pull/358)
|
83
|
+
|
84
|
+
#### Browser bugfixes
|
85
|
+
|
86
|
+
* Fixed occasional crashes on Mac Safari (thanks to [@lapinos03](https://github.com/lapinos03)). [#191](https://github.com/CloudMade/Leaflet/issues/191)
|
87
|
+
* Fixed a bug that raised error in IE6-8 when clicking on popup close button. [#235](https://github.com/CloudMade/Leaflet/issues/235)
|
88
|
+
* Fixed a bug with Safari not redrawing UI immediately after closing a popup. [#296](https://github.com/CloudMade/Leaflet/issues/296)
|
89
|
+
* Fixed a bug that caused performance drop and high CPU usage when calling `setView` or `panTo` to the current center. [#231](https://github.com/CloudMade/Leaflet/issues/231)
|
90
|
+
* Fixed a bug that caused map overlays to appear blurry in some cases under WebKit browsers.
|
91
|
+
* Fixed a bug that was causing errors in some Webkit/Linux builds (requestAnimationFrame-related), thanks to Chris Martens.
|
92
|
+
|
93
|
+
#### Mobile browser bugfixes
|
94
|
+
|
95
|
+
* Fixed a bug that caused an error when clicking vector layers under iOS. [#204](https://github.com/CloudMade/Leaflet/issues/204)
|
96
|
+
* Fixed crash on Android 3+ when panning or zooming (by [@florian](https://github.com/florianf)). [#137](https://github.com/CloudMade/Leaflet/issues/137)
|
97
|
+
|
98
|
+
|
99
|
+
## 0.2.1 (2011-06-18)
|
100
|
+
|
101
|
+
* Fixed regression that caused error in `TileLayer.Canvas`.
|
102
|
+
|
103
|
+
## 0.2 (2011-06-17)
|
104
|
+
|
105
|
+
### Major features
|
106
|
+
|
107
|
+
* Added **WMS** support (`TileLayer.WMS` layer).
|
108
|
+
* Added different **projections** support, having `EPSG:3857`, `EPSG:4326` and `EPSG:3395` out of the box (through `crs` option in `Map`). Thanks to [@Miroff](https://github.com/Miroff) & [@Komzpa](https://github.com/Komzpa) for great advice and explanation regarding this.
|
109
|
+
* Added **GeoJSON** layer support.
|
110
|
+
|
111
|
+
### Improvements
|
112
|
+
|
113
|
+
#### Usability improvements
|
114
|
+
|
115
|
+
* Improved panning performance in Chrome and FF considerably with the help of `requestAnimationFrame`. [#130](https://github.com/CloudMade/Leaflet/issues/130)
|
116
|
+
* Improved click responsiveness in mobile WebKit (now it happens without delay). [#26](https://github.com/CloudMade/Leaflet/issues/26)
|
117
|
+
* Added tap tolerance (so click happens even if you moved your finger slighly when tapping).
|
118
|
+
* Improved geolocation error handling: better error messages, explicit timeout, set world view on locateAndSetView failure. [#61](https://github.com/CloudMade/Leaflet/issues/61)
|
119
|
+
|
120
|
+
#### API improvements
|
121
|
+
|
122
|
+
* Added **MultiPolyline** and **MultiPolygon** layers. [#77](https://github.com/CloudMade/Leaflet/issues/77)
|
123
|
+
* Added **LayerGroup** and **FeatureGroup** layers for grouping other layers.
|
124
|
+
* Added **TileLayer.Canvas** for easy creation of canvas-based tile layers.
|
125
|
+
* Changed `Circle` to be zoom-dependent (with radius in meters); circle of a permanent size is now called `CircleMarker`.
|
126
|
+
* Added `mouseover` and `mouseout` events to map, markers and paths; added map `mousemove` event.
|
127
|
+
* Added `setLatLngs`, `spliceLatLngs`, `addLatLng`, `getLatLngs` methods to polylines and polygons.
|
128
|
+
* Added `setLatLng` and `setRadius` methods to `Circle` and `CircleMarker`.
|
129
|
+
* Improved `LatLngBounds contains` method to accept `LatLng` in addition to `LatLngBounds`, the same for `Bounds contains` and `Point`
|
130
|
+
* Improved `LatLngBounds` & `Bounds` to allow their instantiation without arguments (by [@snc](https://github.com/snc)).
|
131
|
+
* Added TMS tile numbering support through `TileLayer` `scheme: 'tms'` option (by [@tmcw](https://github.com/tmcw)).
|
132
|
+
* Added `TileLayer` `noWrap` option to disable wrapping `x` tile coordinate (by [@jasondavies](https://github.com/jasondavies)).
|
133
|
+
* Added `opacity` option and `setOpacity` method to `TileLayer`.
|
134
|
+
* Added `setLatLng` and `setIcon` methods to `Marker`.
|
135
|
+
* Added `title` option to `Marker`.
|
136
|
+
* Added `maxZoom` argument to `map.locateAndSetView` method.
|
137
|
+
* Added ability to pass Geolocation options to map `locate` and `locateAndSetView` methods (by [@JasonSanford](https://github.com/JasonSanford)).
|
138
|
+
* Improved `Popup` to accept HTML elements in addition to strings as its content.
|
139
|
+
|
140
|
+
#### Development workflow improvements
|
141
|
+
|
142
|
+
* Added `Makefile` for building `leaflet.js` on non-Windows machines (by [@tmcw](https://github.com/tmcw)).
|
143
|
+
* Improved `debug/leaflet-include.js` script to allow using it outside of `debug` folder (by [@antonj](https://github.com/antonj)).
|
144
|
+
* Improved `L` definition to be compatible with CommonJS. [#122](https://github.com/CloudMade/Leaflet/issues/122)
|
145
|
+
|
146
|
+
### Bug fixes
|
147
|
+
|
148
|
+
#### General bugfixes
|
149
|
+
|
150
|
+
* Fixed a bug where zooming is broken if the map contains a polygon and you zoom to an area where it's not visible. [#47](https://github.com/CloudMade/Leaflet/issues/47)
|
151
|
+
* Fixed a bug where closed polylines would not appear on the map.
|
152
|
+
* Fixed a bug where marker that was added, removed and then added again would not appear on the map. [#66](https://github.com/CloudMade/Leaflet/issues/66)
|
153
|
+
* Fixed a bug where tile layer that was added, removed and then added again would not appear on the map.
|
154
|
+
* Fixed a bug where some tiles would not load when panning across the date line. [#97](https://github.com/CloudMade/Leaflet/issues/97)
|
155
|
+
* Fixed a bug where map div with `position: absolute` is reset to `relative`. [#100](https://github.com/CloudMade/Leaflet/issues/100)
|
156
|
+
* Fixed a bug that caused an error when trying to add a marker without shadow in its icon.
|
157
|
+
* Fixed a bug where popup content would not update on `setContent` call. [#94](https://github.com/CloudMade/Leaflet/issues/94)
|
158
|
+
* Fixed a bug where double click zoom wouldn't work if popup is opened on map click
|
159
|
+
* Fixed a bug with click propagation on popup close button. [#99](https://github.com/CloudMade/Leaflet/issues/99)
|
160
|
+
* Fixed inability to remove ImageOverlay layer.
|
161
|
+
|
162
|
+
#### Browser bugfixes
|
163
|
+
|
164
|
+
* Fixed a bug where paths would not appear in IE8.
|
165
|
+
* Fixed a bug where there were occasional slowdowns before zoom animation in WebKit. [#123](https://github.com/CloudMade/Leaflet/issues/123)
|
166
|
+
* Fixed incorrect zoom animation & popup styling in Opera 11.11.
|
167
|
+
* Fixed popup fade animation in Firefox and Opera.
|
168
|
+
* Fixed a bug where map isn't displayed in Firefox when there's an `img { max-width: 100% }` rule.
|
169
|
+
|
170
|
+
#### Mobile browsers bugfixes
|
171
|
+
|
172
|
+
* Fixed a bug that prevented panning on some Android 2.1 (and possibly older) devices. [#84](https://github.com/CloudMade/Leaflet/issues/84)
|
173
|
+
* Disabled zoom animation on Android by default because it's buggy on some devices (will be enabled back when it's stable enough). [#32](https://github.com/CloudMade/Leaflet/issues/32)
|
174
|
+
* Fixed a bug where map would occasionally break while multi-touch-zooming on iOS. [#32](https://github.com/CloudMade/Leaflet/issues/32)
|
175
|
+
* Fixed a bug that prevented panning/clicking on Android 3 tablets. [#121](https://github.com/CloudMade/Leaflet/issues/121)
|
176
|
+
* Fixed a bug that prevented panning/clicking on Opera Mobile. [#138](https://github.com/CloudMade/Leaflet/issues/138)
|
177
|
+
* Fixed potentional memory leak on WebKit when removing tiles, thanks to [@Scalar4eg](https://github.com/Scalar4eg). [#107](https://github.com/CloudMade/Leaflet/issues/107)
|
178
|
+
|
179
|
+
## 0.1 (2011-05-13)
|
180
|
+
|
181
|
+
Initial Leaflet release.
|
@@ -0,0 +1,65 @@
|
|
1
|
+
var build = require('./build/build.js'),
|
2
|
+
lint = require('./build/hint.js');
|
3
|
+
|
4
|
+
var crlf = '\r\n',
|
5
|
+
COPYRIGHT = '/*' + crlf + ' Copyright (c) 2010-2011, CloudMade, Vladimir Agafonkin' + crlf +
|
6
|
+
' Leaflet is a modern open-source JavaScript library for interactive maps.' + crlf +
|
7
|
+
' http://leaflet.cloudmade.com' + crlf + '*/' + crlf;
|
8
|
+
|
9
|
+
desc('Check Leaflet source for errors with JSHint');
|
10
|
+
task('lint', function () {
|
11
|
+
var files = build.getFiles();
|
12
|
+
|
13
|
+
console.log('Checking for JS errors...');
|
14
|
+
|
15
|
+
var errorsFound = lint.jshint(files);
|
16
|
+
|
17
|
+
if (errorsFound > 0) {
|
18
|
+
console.log(errorsFound + ' error(s) found.\n');
|
19
|
+
fail();
|
20
|
+
} else {
|
21
|
+
console.log('\tCheck passed');
|
22
|
+
}
|
23
|
+
});
|
24
|
+
|
25
|
+
desc('Combine and compress Leaflet source files');
|
26
|
+
task('build', ['lint'], function (compsBase32, buildName) {
|
27
|
+
var pathPart = 'dist/leaflet' + (buildName ? '-' + buildName : ''),
|
28
|
+
srcPath = pathPart + '-src.js',
|
29
|
+
path = pathPart + '.js';
|
30
|
+
|
31
|
+
var files = build.getFiles(compsBase32);
|
32
|
+
|
33
|
+
console.log('Concatenating ' + files.length + ' files...');
|
34
|
+
var content = build.combineFiles(files);
|
35
|
+
|
36
|
+
var oldSrc = build.load(srcPath),
|
37
|
+
newSrc = COPYRIGHT + content,
|
38
|
+
srcDelta = build.getSizeDelta(newSrc, oldSrc);
|
39
|
+
|
40
|
+
console.log('\tUncompressed size: ' + newSrc.length + ' bytes (' + srcDelta + ')');
|
41
|
+
|
42
|
+
if (newSrc === oldSrc) {
|
43
|
+
console.log('\tNo changes');
|
44
|
+
} else {
|
45
|
+
build.save(srcPath, newSrc);
|
46
|
+
console.log('\tSaved to ' + srcPath);
|
47
|
+
}
|
48
|
+
|
49
|
+
console.log('Compressing...');
|
50
|
+
|
51
|
+
var oldCompressed = build.load(path),
|
52
|
+
newCompressed = COPYRIGHT + build.uglify(content),
|
53
|
+
delta = build.getSizeDelta(newCompressed, oldCompressed);
|
54
|
+
|
55
|
+
console.log('\tCompressed size: ' + newCompressed.length + ' bytes (' + delta + ')');
|
56
|
+
|
57
|
+
if (newCompressed === oldCompressed) {
|
58
|
+
console.log('\tNo changes');
|
59
|
+
} else {
|
60
|
+
build.save(path, newCompressed);
|
61
|
+
console.log('\tSaved to ' + path);
|
62
|
+
}
|
63
|
+
});
|
64
|
+
|
65
|
+
task('default', ['build']);
|
data/lib/leaflet/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2010-2011, CloudMade, Vladimir Agafonkin
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are
|
5
|
+
permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
1. Redistributions of source code must retain the above copyright notice, this list of
|
8
|
+
conditions and the following disclaimer.
|
9
|
+
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list
|
11
|
+
of conditions and the following disclaimer in the documentation and/or other materials
|
12
|
+
provided with the distribution.
|
13
|
+
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
15
|
+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
16
|
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
17
|
+
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
18
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
19
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
20
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
21
|
+
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
22
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<img src="http://leaflet.cloudmade.com/docs/images/logo.png" alt="Leaflet" />
|
2
|
+
|
3
|
+
Leaflet is a modern, lightweight BSD-licensed JavaScript library for making tile-based interactive maps for both desktop and mobile web browsers, developed by [CloudMade](http://cloudmade.com) to form the core of its next generation JavaScript API.
|
4
|
+
|
5
|
+
It is built from the ground up to work efficiently and smoothly on both platforms, utilizing cutting-edge technologies included in HTML5. Its top priorities are usability, performance and small size, [A-grade](http://developer.yahoo.com/yui/articles/gbs/) browser support, flexibility and easy to use API. The OOP-based code of the library is designed to be modular, extensible and very easy to understand.
|
6
|
+
|
7
|
+
Check out the website for more information: [leaflet.cloudmade.com](http://leaflet.cloudmade.com)
|
8
|
+
|
9
|
+
## Contributing to Leaflet
|
10
|
+
Let's make the best open-source library for maps that can possibly exist!
|
11
|
+
|
12
|
+
Contributing is simple: make the changes in your fork, make sure that Leaflet builds successfully (see below) and then create a pull request to [Vladimir Agafonkin](http://github.com/mourner) (Leaflet maintainer). Updates to Leaflet [documentation](http://leaflet.cloudmade.com/reference.html) and [examples](http://leaflet.cloudmade.com/examples.html) (located in the `gh-pages` branch) are really appreciated too.
|
13
|
+
|
14
|
+
Here's [a list of the awesome people](http://github.com/CloudMade/Leaflet/contributors) that joined us already. Looking forward to _your_ contributions!
|
15
|
+
|
16
|
+
## Building Leaflet
|
17
|
+
Leaflet build system is powered by the Node.js platform and Jake, JSHint and UglifyJS libraries, which install easily and work well across all major platforms. Here are the steps to install it:
|
18
|
+
|
19
|
+
1. [Download and install Node](http://nodejs.org)
|
20
|
+
2. Run the following commands in the command line:
|
21
|
+
|
22
|
+
```
|
23
|
+
npm install -g jake
|
24
|
+
npm install -g jshint
|
25
|
+
npm install -g uglify-js
|
26
|
+
```
|
27
|
+
|
28
|
+
Now that you have everything installed, run `jake` inside the Leaflet directory. This will check Leaflet source files for JavaScript errors and inconsistencies, and then combine and compress it to the `dist` folder.
|
29
|
+
|
30
|
+
To make a custom build of the library with only the things you need, use the build helper (`build/build.html`) to choose the components (it figures out dependencies for you) and then run the command generated with it.
|
31
|
+
|
32
|
+
If you add any new files to the Leaflet source, make sure to also add them to `build/deps.js` so that the build system knows about them. Happy coding!
|