From 504f1f23c22d7533a5e1d777d8fdc1af63ad74fa Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 3 Dec 2013 14:45:48 +0200 Subject: [PATCH 01/61] update changelog [skip ci] --- CHANGELOG.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99efcf86d30..3031419072c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,53 @@ Leaflet Changelog ## 0.8-dev (master) -An in-progress version being developed on the `master` branch. No changes since 0.7 release yet. +An in-progress version being developed on the `master` branch. Includes `stable` branch fixes. + +### TileLayer & Projections refactoring + +TileLayer code and everything projections-related has undergone a major refactoring, documented in [#2247](https://github.com/Leaflet/Leaflet/pull/2247). It includes the following changes (in addition to much cleaner and simpler code): + +#### TileLayer-related changes + +These changes make implementing custom grid-like layers for Leaflet much easier. + +* Moved most of the `TileLayer` logic into the new `GridLayer` class (which `TileLayer` now inherits, extending it with logic specific to tile servers). +* Removed `TileLayer.Canvas` in favor of the much more flexible and powerful `GridLayer`. +* Improved tile wrapping and bounding logic in `TileLayer` to work transparently and completely depent on the CRS used; removed the need for `TileLayer` hacks when using custom projections. +* Removed `url` property in `tileload` and `tileloadstart` events (get it through `tile.src`). + +#### Projections-related changes + +These changes were targeted at removing any hardcoded projection-specific logic accross Leaflet classes, making it transparent and driven by the chosen CRS. They make using Leaflet with custom projections (including flat maps) much easier, and remove the need for ugly hacks in the [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin. + +* Added `Projection` `bounds` property that defines bounds for different projections (`Mercator`, etc.) in projected coordinates (by [@perliedman](https://github.com/perliedman)). +* Added `CRS` `wrapLat` and `wrapLng` properties which define whether the world wraps on a given axis and in what range. Set as `[-180, 180]` for `EPSG:3857`, `EPSG:4326`, `EPSG:3395` by default. +* Removed `LatLng` `wrap` method; added `CRS` and `Map` `wrapLatLng` instead (so that wrapping depends on the chosen CRS). +* Added `CRS` `infinite` property that disables boundaries (the world can go on infinitely in any direction), default for `CRS.Simple`. +* Added `CRS` `getProjectedBounds` and `Map` `getPixelWorldBounds` methods that returns world bounds in projected coordinates depending on zoom (derived from `Projection` `bounds`) (by [@perliedman](https://github.com/perliedman)). +* Added `CRS` `unproject` method that converts coordinates in CRS-dependent units into `LatLng` coordinates (by [@sowelie](https://github.com/sowelie)). +* Fixed `EPSG:4326` to have correct tile pyramid (2x1 tiles at root). +* Fixed `Projection.SphericalMercator` to project to meter units (by [@calvinmetcalf](https://github.com/calvinmetcalf)). +* Fixed `Map` `worldCopyJump` option to work for other projections. + +#### Misc. changes + +* Added `Point` `ceil` method (by [@perliedman](https://github.com/perliedman)). +* Added `Util.wrapNum` method for wrapping a number to lie in a certain range. +* Improved `L.bind` to use native `Function` `bind` on modern browsers and prepend real arguments to bound ones. +* Improved the build system (`jake build`) to report gzipped library size. + + +## 0.7.1-dev (stable) + +An in-progress version being developed on the `stable` branch. + +* Fixed tile flickering issues on some old Android 2/3 devices by disabling buggy hardware accelerated CSS there (by [@danzel](https://github.com/danzel)). [#2216](https://github.com/Leaflet/Leaflet/pull/2216) [#2198](https://github.com/Leaflet/Leaflet/issues/2198) +* Fixed a regression that sometimes led to an error when you started pinch-zoom as the first action on the map (by [@danzel](https://github.com/danzel)). [#2259](https://github.com/Leaflet/Leaflet/pull/2259) [#2256](https://github.com/Leaflet/Leaflet/issues/2256) +* Reverted `L.Util.template` optimizations to allow Leaflet to be used in eval-banning environments like browser extensions (performance gain was insignificant anyway) (by [@calvinmetcalf](https://github.com/calvinmetcalf)). [#2217](https://github.com/Leaflet/Leaflet/issues/2217) [#2209](https://github.com/Leaflet/Leaflet/issues/2209) [#1968](https://github.com/Leaflet/Leaflet/issues/1968) +* Fixed a regression where `Map` `invalidateSize` could lead to unexpected results when called before map initialization (by [@Zverik](https://github.com/Zverik)). [#2250](https://github.com/Leaflet/Leaflet/issues/2250) [#2249](https://github.com/Leaflet/Leaflet/issues/2249) +* Fixed a regression where `FeatureGroup` containing other group overwrote original `e.layer` value in mouse events (by [@gumballhead](https://github.com/gumballhead)). [#2253](https://github.com/Leaflet/Leaflet/pull/2253) [#2252](https://github.com/Leaflet/Leaflet/issues/2252) +* Fixed a regression where `CircleMarker` `setLatLngs` didn't return `this` (by [@radicalbiscuit](https://github.com/radicalbiscuit)). [#2206](https://github.com/Leaflet/Leaflet/pull/2206) ## 0.7 (November 18, 2013) From 440f2f89c1dd7a8e5d07159d51aeae020047d837 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 3 Dec 2013 15:08:57 +0200 Subject: [PATCH 02/61] bump version to 0.7.1 --- package.json | 2 +- src/Leaflet.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index efb0cb2b033..59756ad780c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "leaflet", - "version": "0.7.0", + "version": "0.7.1", "description": "JavaScript library for mobile-friendly interactive maps", "devDependencies": { "jake": "~0.7.4", diff --git a/src/Leaflet.js b/src/Leaflet.js index 6303605b87f..cd7fc6962cc 100644 --- a/src/Leaflet.js +++ b/src/Leaflet.js @@ -2,7 +2,7 @@ var oldL = window.L, L = {}; -L.version = '0.7'; +L.version = '0.7.1'; // define Leaflet for Node module pattern loaders, including Browserify if (typeof module === 'object' && typeof module.exports === 'object') { From bda5ce1a94ae458f50411cf5af0e7c1474cae86b Mon Sep 17 00:00:00 2001 From: danzel Date: Fri, 6 Dec 2013 14:54:48 +1300 Subject: [PATCH 03/61] A transitionEnd event only finished a zoom animation if it is for a transform. Fixes #2255 --- src/map/anim/Map.ZoomAnimation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map/anim/Map.ZoomAnimation.js b/src/map/anim/Map.ZoomAnimation.js index e40a840f1e0..ead4fbd1a12 100644 --- a/src/map/anim/Map.ZoomAnimation.js +++ b/src/map/anim/Map.ZoomAnimation.js @@ -24,8 +24,8 @@ if (L.DomUtil.TRANSITION) { L.Map.include(!L.DomUtil.TRANSITION ? {} : { - _catchTransitionEnd: function () { - if (this._animatingZoom) { + _catchTransitionEnd: function (e) { + if (this._animatingZoom && e.propertyName.indexOf('transform') >= 0) { this._onZoomTransitionEnd(); } }, From bd5fbd278978f490814d6fbc412daa778dfb6483 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 6 Dec 2013 16:16:41 +0200 Subject: [PATCH 04/61] update changelog [skip ci] --- CHANGELOG.md | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3031419072c..eee00274205 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,28 @@ Leaflet Changelog ## 0.8-dev (master) -An in-progress version being developed on the `master` branch. Includes `stable` branch fixes. +An in-progress version being developed on the `master` branch. + +This version contains a lot of beneficial but potentially breaking changes (especially if you're a plugin author), so please read through the changes carefully before upgrading. + +### Layers refactoring + +All Leaflet layers (including markers, popups, tile and vector layers) have been refactored to have a common parent, `Layer` class, that shares the basic logic of adding and removing. The leads to the following changes (documented in PR [#2266](https://github.com/Leaflet/Leaflet/pull/2266)): + +* Added `Layer` class which all layers added to a map should inherit from. +* Added `add` and `remove` events to all layers. +* Added `pane` option to all layers that can be changed (e.g. you can set `pane: 'overlayPane'` to a tile layer). +* Added `shadowPane` option to markers as well. +* Added `getEvents` method to all layers that returns an `{event: listener, ...}` hash; layers now manage its listeners automatically without having to do this in `onAdd`/`onRemove`. +* Improved performance of adding/removing layers with layers control present (instead of listening to any layer add/remove, the control only listens to layers added in configuration). +* Fixed `FeatureGroup` `getBounds` to work correctly when containing circle markers. +* Removed `Map` `tilelayersload` event. +* Removed `Popup` `open` and `close` events in favor of `add` and `remove` for consistency. +* Moved all layer-related logic in `Map.js` to `Layer.js`. ### TileLayer & Projections refactoring -TileLayer code and everything projections-related has undergone a major refactoring, documented in [#2247](https://github.com/Leaflet/Leaflet/pull/2247). It includes the following changes (in addition to much cleaner and simpler code): +TileLayer code and everything projections-related has undergone a major refactoring, documented in PR [#2247](https://github.com/Leaflet/Leaflet/pull/2247). It includes the following changes (in addition to much cleaner and simpler code): #### TileLayer-related changes @@ -34,18 +51,24 @@ These changes were targeted at removing any hardcoded projection-specific logic * Fixed `Projection.SphericalMercator` to project to meter units (by [@calvinmetcalf](https://github.com/calvinmetcalf)). * Fixed `Map` `worldCopyJump` option to work for other projections. -#### Misc. changes +### Other improvements * Added `Point` `ceil` method (by [@perliedman](https://github.com/perliedman)). * Added `Util.wrapNum` method for wrapping a number to lie in a certain range. * Improved `L.bind` to use native `Function` `bind` on modern browsers and prepend real arguments to bound ones. +* Added `DomUtil` `setClass` and `getClass` methods. +* Removed `LatLng` `RAD_TO_DEG`, `DEG_TO_RAD` and `MAX_MARGIN` constants. +* Added `LatLng` `equals` second argument `maxMargin`. +* Improved performance of layer objects construction. +* Added popup fade out animation. * Improved the build system (`jake build`) to report gzipped library size. -## 0.7.1-dev (stable) +## 0.7.1 (December 6, 2013) -An in-progress version being developed on the `stable` branch. +A follow-up bugfix release for the recent stable version. +* Fixed a bug where pinch-zooming quickly could occasionally leave the map at a fractional zoom thus breaking tile loading (by [@danzel](https://github.com/danzel)). [#2269](https://github.com/Leaflet/Leaflet/pull/2269) [#2255](https://github.com/Leaflet/Leaflet/issues/2255) [#1934](https://github.com/Leaflet/Leaflet/issues/1934) * Fixed tile flickering issues on some old Android 2/3 devices by disabling buggy hardware accelerated CSS there (by [@danzel](https://github.com/danzel)). [#2216](https://github.com/Leaflet/Leaflet/pull/2216) [#2198](https://github.com/Leaflet/Leaflet/issues/2198) * Fixed a regression that sometimes led to an error when you started pinch-zoom as the first action on the map (by [@danzel](https://github.com/danzel)). [#2259](https://github.com/Leaflet/Leaflet/pull/2259) [#2256](https://github.com/Leaflet/Leaflet/issues/2256) * Reverted `L.Util.template` optimizations to allow Leaflet to be used in eval-banning environments like browser extensions (performance gain was insignificant anyway) (by [@calvinmetcalf](https://github.com/calvinmetcalf)). [#2217](https://github.com/Leaflet/Leaflet/issues/2217) [#2209](https://github.com/Leaflet/Leaflet/issues/2209) [#1968](https://github.com/Leaflet/Leaflet/issues/1968) From c480c5c80afc0ce2d0a3d64cb844f4fcf724b359 Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Fri, 20 Dec 2013 11:47:41 +0100 Subject: [PATCH 05/61] Use _getTileSize() instead of using options.tileSize directly --- src/layer/tile/TileLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js index fe44759e44c..3f2e3787ae6 100644 --- a/src/layer/tile/TileLayer.js +++ b/src/layer/tile/TileLayer.js @@ -473,7 +473,7 @@ L.TileLayer = L.Class.extend({ _getWrapTileNum: function () { var crs = this._map.options.crs, size = crs.getSize(this._map.getZoom()); - return size.divideBy(this.options.tileSize); + return size.divideBy(this._getTileSize()); }, _adjustTilePoint: function (tilePoint) { From 87757d5f196ad05b04d3bd2aabbbc4e58c6a565b Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 24 Dec 2013 00:16:38 +0200 Subject: [PATCH 06/61] fix rounding bug with unconventional tile sizes, close #2288 --- src/layer/tile/TileLayer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js index 3f2e3787ae6..6f8222e35bf 100644 --- a/src/layer/tile/TileLayer.js +++ b/src/layer/tile/TileLayer.js @@ -473,7 +473,7 @@ L.TileLayer = L.Class.extend({ _getWrapTileNum: function () { var crs = this._map.options.crs, size = crs.getSize(this._map.getZoom()); - return size.divideBy(this._getTileSize()); + return size.divideBy(this._getTileSize())._floor(); }, _adjustTilePoint: function (tilePoint) { From 950034e45784434218924a3a69c6728736e5a877 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 24 Dec 2013 18:46:05 +0200 Subject: [PATCH 07/61] fix scrolled page mouse events in Chrome 32, close #2352 --- src/dom/DomEvent.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/dom/DomEvent.js b/src/dom/DomEvent.js index 6a0a5884f9f..950077d4624 100644 --- a/src/dom/DomEvent.js +++ b/src/dom/DomEvent.js @@ -143,26 +143,15 @@ L.DomEvent = { }, getMousePosition: function (e, container) { - var body = document.body, - docEl = document.documentElement, - //gecko makes scrollLeft more negative as you scroll in rtl, other browsers don't - //ref: https://code.google.com/p/closure-library/source/browse/closure/goog/style/bidi.js - x = L.DomUtil.documentIsLtr() ? - (e.pageX ? e.pageX - body.scrollLeft - docEl.scrollLeft : e.clientX) : - (L.Browser.gecko ? e.pageX - body.scrollLeft - docEl.scrollLeft : - e.pageX ? e.pageX - body.scrollLeft + docEl.scrollLeft : e.clientX), - y = e.pageY ? e.pageY - body.scrollTop - docEl.scrollTop: e.clientY, - pos = new L.Point(x, y); - if (!container) { - return pos; + return new L.Point(e.clientX, e.clientY); } - var rect = container.getBoundingClientRect(), - left = rect.left - container.clientLeft, - top = rect.top - container.clientTop; + var rect = container.getBoundingClientRect(); - return pos._subtract(new L.Point(left, top)); + return new L.Point( + e.clientX - rect.left - container.clientLeft, + e.clientY - rect.top - container.clientTop); }, getWheelDelta: function (e) { From 327f07d0e5d15b80124e1909a703c0d3a899466a Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 24 Dec 2013 00:16:38 +0200 Subject: [PATCH 08/61] bump version to 0.7.2 --- package.json | 2 +- src/Leaflet.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 59756ad780c..98c8b6fa2db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "leaflet", - "version": "0.7.1", + "version": "0.7.2", "description": "JavaScript library for mobile-friendly interactive maps", "devDependencies": { "jake": "~0.7.4", diff --git a/src/Leaflet.js b/src/Leaflet.js index cd7fc6962cc..e15e8bd6d00 100644 --- a/src/Leaflet.js +++ b/src/Leaflet.js @@ -2,7 +2,7 @@ var oldL = window.L, L = {}; -L.version = '0.7.1'; +L.version = '0.7.2'; // define Leaflet for Node module pattern loaders, including Browserify if (typeof module === 'object' && typeof module.exports === 'object') { From bcf370b5be176bd6d23febb003dc8abcd2da5f35 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 17 Jan 2014 14:45:25 +0200 Subject: [PATCH 09/61] update stable branch changelog for 0.7.2 [skip ci] --- CHANGELOG.md | 65 ++++------------------------------------------------ 1 file changed, 4 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eee00274205..100483aca5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,71 +3,14 @@ Leaflet Changelog (all changes without author notice are by [@mourner](https://github.com/mourner)) -## 0.8-dev (master) - -An in-progress version being developed on the `master` branch. - -This version contains a lot of beneficial but potentially breaking changes (especially if you're a plugin author), so please read through the changes carefully before upgrading. - -### Layers refactoring - -All Leaflet layers (including markers, popups, tile and vector layers) have been refactored to have a common parent, `Layer` class, that shares the basic logic of adding and removing. The leads to the following changes (documented in PR [#2266](https://github.com/Leaflet/Leaflet/pull/2266)): - -* Added `Layer` class which all layers added to a map should inherit from. -* Added `add` and `remove` events to all layers. -* Added `pane` option to all layers that can be changed (e.g. you can set `pane: 'overlayPane'` to a tile layer). -* Added `shadowPane` option to markers as well. -* Added `getEvents` method to all layers that returns an `{event: listener, ...}` hash; layers now manage its listeners automatically without having to do this in `onAdd`/`onRemove`. -* Improved performance of adding/removing layers with layers control present (instead of listening to any layer add/remove, the control only listens to layers added in configuration). -* Fixed `FeatureGroup` `getBounds` to work correctly when containing circle markers. -* Removed `Map` `tilelayersload` event. -* Removed `Popup` `open` and `close` events in favor of `add` and `remove` for consistency. -* Moved all layer-related logic in `Map.js` to `Layer.js`. - -### TileLayer & Projections refactoring - -TileLayer code and everything projections-related has undergone a major refactoring, documented in PR [#2247](https://github.com/Leaflet/Leaflet/pull/2247). It includes the following changes (in addition to much cleaner and simpler code): - -#### TileLayer-related changes - -These changes make implementing custom grid-like layers for Leaflet much easier. - -* Moved most of the `TileLayer` logic into the new `GridLayer` class (which `TileLayer` now inherits, extending it with logic specific to tile servers). -* Removed `TileLayer.Canvas` in favor of the much more flexible and powerful `GridLayer`. -* Improved tile wrapping and bounding logic in `TileLayer` to work transparently and completely depent on the CRS used; removed the need for `TileLayer` hacks when using custom projections. -* Removed `url` property in `tileload` and `tileloadstart` events (get it through `tile.src`). - -#### Projections-related changes - -These changes were targeted at removing any hardcoded projection-specific logic accross Leaflet classes, making it transparent and driven by the chosen CRS. They make using Leaflet with custom projections (including flat maps) much easier, and remove the need for ugly hacks in the [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin. - -* Added `Projection` `bounds` property that defines bounds for different projections (`Mercator`, etc.) in projected coordinates (by [@perliedman](https://github.com/perliedman)). -* Added `CRS` `wrapLat` and `wrapLng` properties which define whether the world wraps on a given axis and in what range. Set as `[-180, 180]` for `EPSG:3857`, `EPSG:4326`, `EPSG:3395` by default. -* Removed `LatLng` `wrap` method; added `CRS` and `Map` `wrapLatLng` instead (so that wrapping depends on the chosen CRS). -* Added `CRS` `infinite` property that disables boundaries (the world can go on infinitely in any direction), default for `CRS.Simple`. -* Added `CRS` `getProjectedBounds` and `Map` `getPixelWorldBounds` methods that returns world bounds in projected coordinates depending on zoom (derived from `Projection` `bounds`) (by [@perliedman](https://github.com/perliedman)). -* Added `CRS` `unproject` method that converts coordinates in CRS-dependent units into `LatLng` coordinates (by [@sowelie](https://github.com/sowelie)). -* Fixed `EPSG:4326` to have correct tile pyramid (2x1 tiles at root). -* Fixed `Projection.SphericalMercator` to project to meter units (by [@calvinmetcalf](https://github.com/calvinmetcalf)). -* Fixed `Map` `worldCopyJump` option to work for other projections. - -### Other improvements - -* Added `Point` `ceil` method (by [@perliedman](https://github.com/perliedman)). -* Added `Util.wrapNum` method for wrapping a number to lie in a certain range. -* Improved `L.bind` to use native `Function` `bind` on modern browsers and prepend real arguments to bound ones. -* Added `DomUtil` `setClass` and `getClass` methods. -* Removed `LatLng` `RAD_TO_DEG`, `DEG_TO_RAD` and `MAX_MARGIN` constants. -* Added `LatLng` `equals` second argument `maxMargin`. -* Improved performance of layer objects construction. -* Added popup fade out animation. -* Improved the build system (`jake build`) to report gzipped library size. +## 0.7.2 (January 17, 2013) +* Fixed a bug that appeared with **Chrome 32 update** that made all **mouse events shifted on scrolled pages**. [#2352](https://github.com/Leaflet/Leaflet/issues/2352) +* Fixed a bug that could break tile loading when using non-standard tile sizes. [#2288](https://github.com/Leaflet/Leaflet/issues/2288) +* Fixed a bug where `maxNativeZoom` option didn't work with TMS tile layers (by [@perliedman](https://github.com/perliedman)). [#2321](https://github.com/Leaflet/Leaflet/issues/2321) [#2314](https://github.com/Leaflet/Leaflet/issues/2314) ## 0.7.1 (December 6, 2013) -A follow-up bugfix release for the recent stable version. - * Fixed a bug where pinch-zooming quickly could occasionally leave the map at a fractional zoom thus breaking tile loading (by [@danzel](https://github.com/danzel)). [#2269](https://github.com/Leaflet/Leaflet/pull/2269) [#2255](https://github.com/Leaflet/Leaflet/issues/2255) [#1934](https://github.com/Leaflet/Leaflet/issues/1934) * Fixed tile flickering issues on some old Android 2/3 devices by disabling buggy hardware accelerated CSS there (by [@danzel](https://github.com/danzel)). [#2216](https://github.com/Leaflet/Leaflet/pull/2216) [#2198](https://github.com/Leaflet/Leaflet/issues/2198) * Fixed a regression that sometimes led to an error when you started pinch-zoom as the first action on the map (by [@danzel](https://github.com/danzel)). [#2259](https://github.com/Leaflet/Leaflet/pull/2259) [#2256](https://github.com/Leaflet/Leaflet/issues/2256) From 9cd4f1b5bc4a78d26cb9f4c042176f80b624fd69 Mon Sep 17 00:00:00 2001 From: danzel Date: Wed, 22 Jan 2014 10:56:57 +1300 Subject: [PATCH 10/61] Don't set _animatingZoom for touchZoom zooming. refs #1934 --- src/map/anim/Map.ZoomAnimation.js | 6 ++++-- src/map/handler/Map.TouchZoom.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/map/anim/Map.ZoomAnimation.js b/src/map/anim/Map.ZoomAnimation.js index ead4fbd1a12..709dd43b1d1 100644 --- a/src/map/anim/Map.ZoomAnimation.js +++ b/src/map/anim/Map.ZoomAnimation.js @@ -61,9 +61,11 @@ L.Map.include(!L.DomUtil.TRANSITION ? {} : { return true; }, - _animateZoom: function (center, zoom, origin, scale, delta, backwards) { + _animateZoom: function (center, zoom, origin, scale, delta, backwards, forTouchZoom) { - this._animatingZoom = true; + if (!forTouchZoom) { + this._animatingZoom = true; + } // put transform transition on all layers with leaflet-zoom-animated class L.DomUtil.addClass(this._mapPane, 'leaflet-zoom-anim'); diff --git a/src/map/handler/Map.TouchZoom.js b/src/map/handler/Map.TouchZoom.js index 7f9ea6628ad..abbf6103c01 100644 --- a/src/map/handler/Map.TouchZoom.js +++ b/src/map/handler/Map.TouchZoom.js @@ -85,7 +85,7 @@ L.Map.TouchZoom = L.Handler.extend({ center = map.layerPointToLatLng(origin), zoom = map.getScaleZoom(this._scale); - map._animateZoom(center, zoom, this._startCenter, this._scale, this._delta); + map._animateZoom(center, zoom, this._startCenter, this._scale, this._delta, false, true); }, _onTouchEnd: function () { From c6d360751400afea4f0adfd190da0253f8a2797e Mon Sep 17 00:00:00 2001 From: Alexander Dimitrov Date: Mon, 24 Feb 2014 23:54:15 +0200 Subject: [PATCH 11/61] Trigger remove when removing canvas layers --- src/layer/vector/canvas/Path.Canvas.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/layer/vector/canvas/Path.Canvas.js b/src/layer/vector/canvas/Path.Canvas.js index 8d0380103ce..5906a38191a 100644 --- a/src/layer/vector/canvas/Path.Canvas.js +++ b/src/layer/vector/canvas/Path.Canvas.js @@ -42,7 +42,8 @@ L.Path = (L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? L.Path : } this._requestUpdate(); - + + this.fire('remove'); this._map = null; }, From 0e558adcea3f47460b89c85eab48827035b1e300 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 5 Mar 2014 23:08:28 +0200 Subject: [PATCH 12/61] fire viewreset before onAdd, fix #2510 --- spec/suites/layer/TileLayerSpec.js | 24 +++++++++++++++++++----- src/map/Map.js | 4 ++-- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/spec/suites/layer/TileLayerSpec.js b/spec/suites/layer/TileLayerSpec.js index ab00e92067f..d4949f95397 100644 --- a/spec/suites/layer/TileLayerSpec.js +++ b/spec/suites/layer/TileLayerSpec.js @@ -1,12 +1,26 @@ describe('TileLayer', function () { - var tileUrl = ''; + var tileUrl = '', + map; - describe("#getMaxZoom, #getMinZoom", function () { - var map; - beforeEach(function () { - map = L.map(document.createElement('div')); + beforeEach(function () { + map = L.map(document.createElement('div')); + }); + + describe("#onAdd", function () { + it('is called after viewreset on first map load', function () { + var layer = L.tileLayer(tileUrl).addTo(map); + layer.onAdd = sinon.spy(); + + var onReset = sinon.spy(); + map.on('viewreset', onReset); + map.setView([0, 0], 0); + + expect(onReset.calledBefore(layer.onAdd)).to.be.ok(); }); + }); + + describe("#getMaxZoom, #getMinZoom", function () { describe("when a tilelayer is added to a map with no other layers", function () { it("has the same zoomlevels as the tilelayer", function () { var maxZoom = 10, diff --git a/src/map/Map.js b/src/map/Map.js index b207019c5e8..059a928dcb3 100644 --- a/src/map/Map.js +++ b/src/map/Map.js @@ -568,13 +568,13 @@ L.Map = L.Class.extend({ var loading = !this._loaded; this._loaded = true; + this.fire('viewreset', {hard: !preserveMapOffset}); + if (loading) { this.fire('load'); this.eachLayer(this._layerAdd, this); } - this.fire('viewreset', {hard: !preserveMapOffset}); - this.fire('move'); if (zoomChanged || afterZoomAnim) { From 6864384d630e46fc5908575befebb19239b1c0d0 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 19 Mar 2014 17:50:35 -0700 Subject: [PATCH 13/61] fix travis uploads in stable branch too --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index db828c83553..dc4ce445b74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,8 @@ before_script: > test ${TRAVIS_BRANCH} = master || test ${TRAVIS_BRANCH} = stable && test ${TRAVIS_PULL_REQUEST} = false && - gem install travis-artifacts || true + gem install --no-rdoc --no-ri --version 0.8.9 faraday && + gem install --no-rdoc --no-ri travis-artifacts || true after_success: > test ${TRAVIS_BRANCH} = master || test ${TRAVIS_BRANCH} = stable && From 59a8c00a1850103f4fba8561961282eb21b29e7d Mon Sep 17 00:00:00 2001 From: Florian Rampp Date: Fri, 21 Mar 2014 13:48:45 +0100 Subject: [PATCH 14/61] correctly remove event listener for layer control The context (```this```) is passed when registering event listeners for events ```layeradd/layerremove``` and thus also needs to be passed when removing them. --- src/control/Control.Layers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/control/Control.Layers.js b/src/control/Control.Layers.js index 6fc2cbcbeb7..662a6ff4093 100644 --- a/src/control/Control.Layers.js +++ b/src/control/Control.Layers.js @@ -38,8 +38,8 @@ L.Control.Layers = L.Control.extend({ onRemove: function (map) { map - .off('layeradd', this._onLayerChange) - .off('layerremove', this._onLayerChange); + .off('layeradd', this._onLayerChange, this) + .off('layerremove', this._onLayerChange, this); }, addBaseLayer: function (layer, name) { From 0317a73dd3bf0593911e92384ae3bcc17350d668 Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Tue, 15 Apr 2014 21:05:48 +0200 Subject: [PATCH 15/61] Backported 9a2399ee500cfa24efd320e44c68ebf1c4109d78 --- src/core/Util.js | 38 +++++++++++++++++++++++++++++++ src/map/anim/Map.ZoomAnimation.js | 18 ++++++++------- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/src/core/Util.js b/src/core/Util.js index b903098930c..22c8d40c110 100644 --- a/src/core/Util.js +++ b/src/core/Util.js @@ -175,6 +175,44 @@ L.Util = { }()); +(function () { + // inspired by http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + + function getPrefixed(name) { + return window['webkit' + name] || window['moz' + name] || window['ms' + name]; + } + + var lastTime = 0; + + // fallback for IE 7-8 + function timeoutDefer(fn) { + var time = +new Date(), + timeToCall = Math.max(0, 16 - (time - lastTime)); + + lastTime = time + timeToCall; + return window.setTimeout(fn, timeToCall); + } + + var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer, + cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') || + getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); }; + + + L.Util.requestAnimFrame = function (fn, context, immediate, element) { + if (immediate && requestFn === timeoutDefer) { + fn.call(context); + } else { + return requestFn.call(window, L.bind(fn, context), element); + } + }; + + L.Util.cancelAnimFrame = function (id) { + if (id) { + cancelFn.call(window, id); + } + }; +})(); + // shortcuts for most used utility functions L.extend = L.Util.extend; L.bind = L.Util.bind; diff --git a/src/map/anim/Map.ZoomAnimation.js b/src/map/anim/Map.ZoomAnimation.js index 709dd43b1d1..8b7d3f5dd96 100644 --- a/src/map/anim/Map.ZoomAnimation.js +++ b/src/map/anim/Map.ZoomAnimation.js @@ -79,14 +79,16 @@ L.Map.include(!L.DomUtil.TRANSITION ? {} : { L.Draggable._disabled = true; } - this.fire('zoomanim', { - center: center, - zoom: zoom, - origin: origin, - scale: scale, - delta: delta, - backwards: backwards - }); + L.Util.requestAnimFrame(function () { + this.fire('zoomanim', { + center: center, + zoom: zoom, + origin: origin, + scale: scale, + delta: delta, + backwards: backwards + }); + }, this); }, _onZoomTransitionEnd: function () { From 974dcb8e33127de40465b43274328426c5808e3d Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Tue, 15 Apr 2014 21:06:28 +0200 Subject: [PATCH 16/61] Added test case for setView immediately after map is initialized --- debug/tests/setview_marker_setview.html | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 debug/tests/setview_marker_setview.html diff --git a/debug/tests/setview_marker_setview.html b/debug/tests/setview_marker_setview.html new file mode 100644 index 00000000000..e8bcba590bc --- /dev/null +++ b/debug/tests/setview_marker_setview.html @@ -0,0 +1,25 @@ + + + + Leaflet debug page + + + + + + + + +
+ + + + + From ce7a753efa3a8a950491ca03e2591ad60a825c9b Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Tue, 15 Apr 2014 21:54:56 +0200 Subject: [PATCH 17/61] Remove duplicate requestAnimFrame. --- src/core/Util.js | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/src/core/Util.js b/src/core/Util.js index 22c8d40c110..b903098930c 100644 --- a/src/core/Util.js +++ b/src/core/Util.js @@ -175,44 +175,6 @@ L.Util = { }()); -(function () { - // inspired by http://paulirish.com/2011/requestanimationframe-for-smart-animating/ - - function getPrefixed(name) { - return window['webkit' + name] || window['moz' + name] || window['ms' + name]; - } - - var lastTime = 0; - - // fallback for IE 7-8 - function timeoutDefer(fn) { - var time = +new Date(), - timeToCall = Math.max(0, 16 - (time - lastTime)); - - lastTime = time + timeToCall; - return window.setTimeout(fn, timeToCall); - } - - var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer, - cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') || - getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); }; - - - L.Util.requestAnimFrame = function (fn, context, immediate, element) { - if (immediate && requestFn === timeoutDefer) { - fn.call(context); - } else { - return requestFn.call(window, L.bind(fn, context), element); - } - }; - - L.Util.cancelAnimFrame = function (id) { - if (id) { - cancelFn.call(window, id); - } - }; -})(); - // shortcuts for most used utility functions L.extend = L.Util.extend; L.bind = L.Util.bind; From 4b9f5f420b18ce721959e6476c803d87e4e9a594 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 25 Dec 2013 20:37:25 +0200 Subject: [PATCH 18/61] make Android double-click issue threshold smaller, close #2303 --- src/dom/DomEvent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dom/DomEvent.js b/src/dom/DomEvent.js index 950077d4624..6a70d9539f3 100644 --- a/src/dom/DomEvent.js +++ b/src/dom/DomEvent.js @@ -219,12 +219,12 @@ L.DomEvent = { var timeStamp = (e.timeStamp || e.originalEvent.timeStamp), elapsed = L.DomEvent._lastClick && (timeStamp - L.DomEvent._lastClick); - // are they closer together than 1000ms yet more than 100ms? + // are they closer together than 500ms yet more than 100ms? // Android typically triggers them ~300ms apart while multiple listeners // on the same event should be triggered far faster; // or check if click is simulated on the element, and if it is, reject any non-simulated events - if ((elapsed && elapsed > 100 && elapsed < 1000) || (e.target._simulatedClick && !e._simulated)) { + if ((elapsed && elapsed > 100 && elapsed < 500) || (e.target._simulatedClick && !e._simulated)) { L.DomEvent.stop(e); return; } From 2d911c20ef6c7fba0891255bf07496241d3b7baf Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 28 Apr 2014 14:23:18 +0300 Subject: [PATCH 19/61] backport #2503 fix false-positive drag on tap --- src/dom/Draggable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dom/Draggable.js b/src/dom/Draggable.js index d81790e80b5..eea0cd225ca 100644 --- a/src/dom/Draggable.js +++ b/src/dom/Draggable.js @@ -82,6 +82,7 @@ L.Draggable = L.Class.extend({ offset = newPoint.subtract(this._startPoint); if (!offset.x && !offset.y) { return; } + if (L.Browser.touch && Math.abs(offset.x) + Math.abs(offset.y) < 3) { return; } L.DomEvent.preventDefault(e); From 1335c77066e96e9ce437933d1e0da90755f9c4e0 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 28 Apr 2014 15:59:30 +0300 Subject: [PATCH 20/61] fix error dragging outside of window in FF, close #2610 --- src/dom/Draggable.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/dom/Draggable.js b/src/dom/Draggable.js index eea0cd225ca..b804a03216f 100644 --- a/src/dom/Draggable.js +++ b/src/dom/Draggable.js @@ -93,7 +93,8 @@ L.Draggable = L.Class.extend({ this._startPos = L.DomUtil.getPosition(this._element).subtract(offset); L.DomUtil.addClass(document.body, 'leaflet-dragging'); - L.DomUtil.addClass((e.target || e.srcElement), 'leaflet-drag-target'); + this._lastTarget = e.target || e.srcElement; + L.DomUtil.addClass(this._lastTarget, 'leaflet-drag-target'); } this._newPos = this._startPos.add(offset); @@ -111,7 +112,11 @@ L.Draggable = L.Class.extend({ _onUp: function (e) { L.DomUtil.removeClass(document.body, 'leaflet-dragging'); - L.DomUtil.removeClass((e.target || e.srcElement), 'leaflet-drag-target'); + + if (this._lastTarget) { + L.DomUtil.removeClass(this._lastTarget, 'leaflet-drag-target'); + this._lastTarget = null; + } for (var i in L.Draggable.MOVE) { L.DomEvent From a442bb3d3e87d71db998aac9290215b1a33e3438 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Mon, 28 Apr 2014 16:02:27 +0300 Subject: [PATCH 21/61] fix build --- src/dom/Draggable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dom/Draggable.js b/src/dom/Draggable.js index b804a03216f..060aed4b14a 100644 --- a/src/dom/Draggable.js +++ b/src/dom/Draggable.js @@ -110,7 +110,7 @@ L.Draggable = L.Class.extend({ this.fire('drag'); }, - _onUp: function (e) { + _onUp: function () { L.DomUtil.removeClass(document.body, 'leaflet-dragging'); if (this._lastTarget) { From 964716cc32d8fcbe410e2aea9476c1c546559ef8 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 23 May 2014 11:25:36 +0300 Subject: [PATCH 22/61] update changelog with 0.7.3 fixes --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 100483aca5a..0d576414027 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ Leaflet Changelog (all changes without author notice are by [@mourner](https://github.com/mourner)) +## 0.7.3-dev (stable branch) + +* Fixed a bug where dragging the map outside the window caused an error on FF. [#2610](https://github.com/Leaflet/Leaflet/issues/2610) +* Fixed a bug where some taps on Android where not working, often falsely perceived as drags (by [@axefrog](https://github.com/axefrog)). [#2503](https://github.com/Leaflet/Leaflet/pull/2503) +* Fixed a bug where tapping too quickly on Android ignored most taps. [#2303](https://github.com/Leaflet/Leaflet/issues/2303) +* Fixed a bug where calling `setView` (or similar methods) several times in succession could freeze the map. [#2521](https://github.com/Leaflet/Leaflet/issues/2521) [#2236](https://github.com/Leaflet/Leaflet/issues/2236) [#2485](https://github.com/Leaflet/Leaflet/issues/2485) +* Fixed a bug where `Control.Layers` wasn't properly removed (by [@jack-kerouac](https://github.com/jack-kerouac)). [#2569](https://github.com/Leaflet/Leaflet/pull/2569) +* Fixed a bug that caused `TileLayer` `load` event not to fire properly. [#2510](https://github.com/Leaflet/Leaflet/issues/2510) +* Fixed Canvas-based paths not triggering `remove` event when removed (by @adimitrov). [#2486](https://github.com/Leaflet/Leaflet/pull/2486) +* Fixed a bug where you could end up with fractional zoom after pinch-zooming in some cases (by [@danzel](https://github.com/danzel). [#2400](https://github.com/Leaflet/Leaflet/pull/2400) [#1943](https://github.com/Leaflet/Leaflet/issues/1934) + ## 0.7.2 (January 17, 2013) * Fixed a bug that appeared with **Chrome 32 update** that made all **mouse events shifted on scrolled pages**. [#2352](https://github.com/Leaflet/Leaflet/issues/2352) From 8acccd8fd886c50abe30fefe15bf299e593f4075 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 23 May 2014 11:25:54 +0300 Subject: [PATCH 23/61] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 98c8b6fa2db..b726bb5c19a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "leaflet", - "version": "0.7.2", + "version": "0.7.3", "description": "JavaScript library for mobile-friendly interactive maps", "devDependencies": { "jake": "~0.7.4", From 600b90b87fb95fa52066f0bac89c09d21c1698dc Mon Sep 17 00:00:00 2001 From: Calvin Metcalf Date: Wed, 19 Mar 2014 15:43:38 -0400 Subject: [PATCH 24/61] add bower support --- .gitignore | 2 ++ build/bower.json | 23 +++++++++++++++++++++++ build/component.json | 19 +++++++++++++++++++ build/publish.sh | 31 +++++++++++++++++++++++++++++++ package.json | 12 +++++++++--- 5 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 build/bower.json create mode 100644 build/component.json create mode 100755 build/publish.sh diff --git a/.gitignore b/.gitignore index 68a9b2dbfaa..d3c27b0e1b4 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ coverage/ *.js.html index.html .mailmap +bower.json +component.json \ No newline at end of file diff --git a/build/bower.json b/build/bower.json new file mode 100644 index 00000000000..7dde378822c --- /dev/null +++ b/build/bower.json @@ -0,0 +1,23 @@ +{ + "name": "leaflet", + "description": "JavaScript library for mobile-friendly interactive maps", + "main": [ + "dist/leaflet.js", + "dist/leaflet.css", + "dist/leaflet-src.js", + "dist/images/layers-2x.png", + "dist/images/layers.png", + "dist/images/marker-icon-2x.png", + "dist/images/marker-icon.png", + "dist/images/marker-shadow.png" + ], + "ignore": [ + ".*", + "CHANGELOG.json", + "FAQ.md", + "debug", + "spec", + "src", + "build" + ] +} \ No newline at end of file diff --git a/build/component.json b/build/component.json new file mode 100644 index 00000000000..7b9d53b3d21 --- /dev/null +++ b/build/component.json @@ -0,0 +1,19 @@ +{ + "name": "leaflet", + "description": "JavaScript library for mobile-friendly interactive maps", + "scripts": [ + "dist/leaflet.js", + "dist/leaflet-src.js" + ], + "images":[ + "dist/images/layers-2x.png", + "dist/images/layers.png", + "dist/images/marker-icon-2x.png", + "dist/images/marker-icon.png", + "dist/images/marker-shadow.png" + ], + "styles":[ + "dist/leaflet.css" + ], + "main": "dist/leaflet-src.js" +} \ No newline at end of file diff --git a/build/publish.sh b/build/publish.sh new file mode 100755 index 00000000000..bbac38ab93c --- /dev/null +++ b/build/publish.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#make sure deps are up to date +rm -r node_modules +npm install + +# get current version + VERSION=$(node --eval "console.log(require('./package.json').version);") +# Build +git checkout -b build +npm test || exit 1 +npm run prepublish +git add dist/leaflet-src.js dist/leaflet.js -f + +# create the bower and component files +copyfiles -u 1 build/*.json ./ +tin -v $VERSION +git add component.json bower.json -f + +git commit -m "build $VERSION" + +# Tag and push +echo git tag $VERSION +# git push --tags git@github.com:leaflet/leaflet.git $VERSION + +# # # Publish JS modules +# npm publish + +# # # Cleanup +# git checkout master +# git branch -D build \ No newline at end of file diff --git a/package.json b/package.json index b726bb5c19a..4f77938ca7f 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,19 @@ "uglify-js": "~2.4.3", "mocha": "~1.14.0", "happen": "~0.1.3", - "karma": "~0.10.4", - "karma-mocha": "~0.1.0" + "karma": "~0.12.0", + "karma-mocha": "~0.1.1", + "karma-coverage": "~0.2.0", + "karma-phantomjs-launcher": "^0.1.2", + "karma-chrome-launcher": "^0.1.2", + "tin": "^0.4.0", + "copyfiles": "0.0.1" }, "main": "dist/leaflet-src.js", "scripts": { "test": "jake test", - "prepublish": "jake build" + "prepublish": "jake build", + "publish": "./build/publish.sh" }, "repository": { "type": "git", From c64f31a3d8c55d2f3d4421b08bc459e66edc35f5 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 23 May 2014 11:33:12 +0300 Subject: [PATCH 25/61] build script fixes --- build/bower.json | 2 +- build/component.json | 2 +- build/publish.sh | 18 ++++++------------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/build/bower.json b/build/bower.json index 7dde378822c..615371cbb35 100644 --- a/build/bower.json +++ b/build/bower.json @@ -20,4 +20,4 @@ "src", "build" ] -} \ No newline at end of file +} diff --git a/build/component.json b/build/component.json index 7b9d53b3d21..a90e3397b4e 100644 --- a/build/component.json +++ b/build/component.json @@ -16,4 +16,4 @@ "dist/leaflet.css" ], "main": "dist/leaflet-src.js" -} \ No newline at end of file +} diff --git a/build/publish.sh b/build/publish.sh index bbac38ab93c..8325f520644 100755 --- a/build/publish.sh +++ b/build/publish.sh @@ -1,11 +1,8 @@ #!/bin/bash -#make sure deps are up to date -rm -r node_modules -npm install - # get current version - VERSION=$(node --eval "console.log(require('./package.json').version);") +VERSION=$(node --eval "console.log(require('./package.json').version);") + # Build git checkout -b build npm test || exit 1 @@ -17,15 +14,12 @@ copyfiles -u 1 build/*.json ./ tin -v $VERSION git add component.json bower.json -f -git commit -m "build $VERSION" +git commit -m "build v$VERSION" # Tag and push -echo git tag $VERSION -# git push --tags git@github.com:leaflet/leaflet.git $VERSION - -# # # Publish JS modules -# npm publish +echo git tag v$VERSION +git push --tags # # # Cleanup # git checkout master -# git branch -D build \ No newline at end of file +# git branch -D build From 0cff05a8d27523ffdf3cf65a2a0a3947f22e90f4 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 23 May 2014 11:34:41 +0300 Subject: [PATCH 26/61] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d576414027..44e85a69108 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Leaflet Changelog ## 0.7.3-dev (stable branch) +* Added proper **bower** and **component** support (by [@calvinmetcalf](https://github.com/calvinmetcalf)). [#2561](https://github.com/Leaflet/Leaflet/pull/2561) [#1903](https://github.com/Leaflet/Leaflet/issues/1903) * Fixed a bug where dragging the map outside the window caused an error on FF. [#2610](https://github.com/Leaflet/Leaflet/issues/2610) * Fixed a bug where some taps on Android where not working, often falsely perceived as drags (by [@axefrog](https://github.com/axefrog)). [#2503](https://github.com/Leaflet/Leaflet/pull/2503) * Fixed a bug where tapping too quickly on Android ignored most taps. [#2303](https://github.com/Leaflet/Leaflet/issues/2303) From bac088443f98fcff5300d8c8d21732441152e626 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 23 May 2014 11:42:11 +0300 Subject: [PATCH 27/61] update publish script --- build/publish.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/publish.sh b/build/publish.sh index 8325f520644..67136acb0eb 100755 --- a/build/publish.sh +++ b/build/publish.sh @@ -10,16 +10,16 @@ npm run prepublish git add dist/leaflet-src.js dist/leaflet.js -f # create the bower and component files -copyfiles -u 1 build/*.json ./ -tin -v $VERSION +node_modules/copyfiles/copyfiles -u 1 build/*.json ./ +node_modules/tin/bin/tin -v $VERSION git add component.json bower.json -f git commit -m "build v$VERSION" # Tag and push -echo git tag v$VERSION -git push --tags +git tag v$VERSION +git push --tags --force # # # Cleanup -# git checkout master -# git branch -D build +git checkout stable +git branch -D build From 25db37bc4c266f2bfaedd39a759fbe338820d511 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 23 May 2014 12:10:21 +0300 Subject: [PATCH 28/61] bump version --- src/Leaflet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Leaflet.js b/src/Leaflet.js index e15e8bd6d00..4c5d776a008 100644 --- a/src/Leaflet.js +++ b/src/Leaflet.js @@ -2,7 +2,7 @@ var oldL = window.L, L = {}; -L.version = '0.7.2'; +L.version = '0.7.3'; // define Leaflet for Node module pattern loaders, including Browserify if (typeof module === 'object' && typeof module.exports === 'object') { From 2812151bac3e7b80b294d23d88589c12128d792a Mon Sep 17 00:00:00 2001 From: Brian Stoner Date: Wed, 26 Feb 2014 17:21:49 -0500 Subject: [PATCH 29/61] enforce maxZoom before applying paddingOffset, fixes #2489 --- src/map/Map.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/map/Map.js b/src/map/Map.js index 059a928dcb3..2aa2418fa9e 100644 --- a/src/map/Map.js +++ b/src/map/Map.js @@ -96,15 +96,16 @@ L.Map = L.Class.extend({ var paddingTL = L.point(options.paddingTopLeft || options.padding || [0, 0]), paddingBR = L.point(options.paddingBottomRight || options.padding || [0, 0]), - zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR)), - paddingOffset = paddingBR.subtract(paddingTL).divideBy(2), + zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR)); + + zoom = (options.maxZoom) ? Math.min(options.maxZoom, zoom) : zoom; + + var paddingOffset = paddingBR.subtract(paddingTL).divideBy(2), swPoint = this.project(bounds.getSouthWest(), zoom), nePoint = this.project(bounds.getNorthEast(), zoom), center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom); - zoom = options && options.maxZoom ? Math.min(options.maxZoom, zoom) : zoom; - return this.setView(center, zoom, options); }, From c759481592830f80fad59fe7b63d9e14cb406e2f Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Sun, 18 Jan 2015 12:15:50 +0100 Subject: [PATCH 30/61] Prevent race condition with marker position and zoom animation --- src/layer/marker/Marker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/layer/marker/Marker.js b/src/layer/marker/Marker.js index d0a0f7d047b..4a22440d098 100644 --- a/src/layer/marker/Marker.js +++ b/src/layer/marker/Marker.js @@ -99,7 +99,9 @@ L.Marker = L.Class.extend({ update: function () { if (this._icon) { var pos = this._map.latLngToLayerPoint(this._latlng).round(); - this._setPos(pos); + L.Util.requestAnimFrame(function () { + this._setPos(pos); + }, this); } return this; From 61c39eb98c961c0809181ea88524d06d702baebc Mon Sep 17 00:00:00 2001 From: george Date: Tue, 20 Jan 2015 17:14:00 +0500 Subject: [PATCH 31/61] + missing lineCap and lineJoin options for Path.Canvas. Fix whitespace Fix --- src/layer/vector/canvas/Path.Canvas.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/layer/vector/canvas/Path.Canvas.js b/src/layer/vector/canvas/Path.Canvas.js index 5906a38191a..0eaaf9713f0 100644 --- a/src/layer/vector/canvas/Path.Canvas.js +++ b/src/layer/vector/canvas/Path.Canvas.js @@ -73,6 +73,13 @@ L.Path = (L.Path.SVG && !window.L_PREFER_CANVAS) || !L.Browser.canvas ? L.Path : if (options.fill) { this._ctx.fillStyle = options.fillColor || options.color; } + + if (options.lineCap) { + this._ctx.lineCap = options.lineCap; + } + if (options.lineJoin) { + this._ctx.lineJoin = options.lineJoin; + } }, _drawPath: function () { From 8849980cd70fb70be6acac8f08ea9c7a1a5f11ee Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 28 Jan 2015 02:38:12 +0200 Subject: [PATCH 32/61] switch to OSM on the debug page --- debug/map/map.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/debug/map/map.html b/debug/map/map.html index 6941ffd2a11..d6f5c1030a4 100644 --- a/debug/map/map.html +++ b/debug/map/map.html @@ -19,15 +19,13 @@