Merge branch 'stable' into gh-pages

* stable:
  update stable branch changelog for 0.7.2 [skip ci]
  bump version to 0.7.2
  fix scrolled page mouse events in Chrome 32, close #2352
  fix rounding bug with unconventional tile sizes, close #2288
  Use _getTileSize() instead of using options.tileSize directly
This commit is contained in:
Vladimir Agafonkin 2014-01-17 14:46:15 +02:00
commit f42d60900a
5 changed files with 12 additions and 80 deletions

View File

@ -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)

View File

@ -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",

View File

@ -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') {

View File

@ -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) {

View File

@ -472,7 +472,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())._floor();
},
_adjustTilePoint: function (tilePoint) {