update changelog and build

This commit is contained in:
Vladimir Agafonkin 2013-02-21 10:28:55 +02:00
parent 3cc75db221
commit e87e010e7d
3 changed files with 50 additions and 17 deletions

View File

@ -74,6 +74,7 @@ An in-progress version being developed on the master branch.
* Fixed a bug where layers that belong to multiple feature groups didn't propagate events correctly (by [@danzel](https://github.com/danzel)). [#1359](https://github.com/Leaflet/Leaflet/pull/1359)
* Fixed a bug where `Control.Attribution` `removeAttribution` of inexistant attribution corrupted the attribution text. [#1410](https://github.com/Leaflet/Leaflet/issues/1410)
* Fixed a bug where `TileLayer.WMS` `tileSize` option was ignored (by [@brianhatchl](https://github.com/brianhatchl)). [#1080](https://github.com/brianhatchl)
* Fixed a bug where `Polyline` constructor could overwrite the source array (by [@snkashis](https://github.com/snkashis) and [@danzel](https://github.com/danzel)). [#1439](https://github.com/Leaflet/Leaflet/pull/1439) [#1092](https://github.com/Leaflet/Leaflet/issues/1092) [#1246](https://github.com/Leaflet/Leaflet/issues/1246) [#1426](https://github.com/Leaflet/Leaflet/issues/1426)
## 0.5.1 (February 6, 2013)

58
dist/leaflet-src.js vendored
View File

@ -1657,6 +1657,11 @@ L.Map = L.Class.extend({
// public methods for getting map state
getCenter: function () { // (Boolean) -> LatLng
this._checkIfLoaded();
if (!this._moved()) {
return this._initialCenter;
}
return this.layerPointToLatLng(this._getCenterLayerPoint());
},
@ -1744,9 +1749,7 @@ L.Map = L.Class.extend({
},
getPixelOrigin: function () {
if (!this._loaded) {
throw new Error('Set map center and zoom first.');
}
this._checkIfLoaded();
return this._initialTopLeftPoint;
},
@ -1916,6 +1919,7 @@ L.Map = L.Class.extend({
}
this._zoom = zoom;
this._initialCenter = center;
this._initialTopLeftPoint = this._getNewTopLeftPoint(center);
@ -1983,6 +1987,12 @@ L.Map = L.Class.extend({
}
},
_checkIfLoaded: function () {
if (!this._loaded) {
throw new Error('Set map center and zoom first.');
}
},
// map events
_initEvents: function (onOff) {
@ -2066,6 +2076,11 @@ L.Map = L.Class.extend({
return L.DomUtil.getPosition(this._mapPane);
},
_moved: function () {
var pos = this._getMapPanePos();
return pos && !pos.equals(new L.Point(0, 0));
},
_getTopLeftPoint: function () {
return this.getPixelOrigin().subtract(this._getMapPanePos());
},
@ -2702,9 +2717,11 @@ L.TileLayer = L.Class.extend({
if (!this._tilesToLoad) {
this.fire('load');
// clear scaled tiles after all new tiles are loaded (for performance)
clearTimeout(this._clearBgBufferTimer);
this._clearBgBufferTimer = setTimeout(L.bind(this._clearBgBuffer, this), 500);
if (this._animated) {
// clear scaled tiles after all new tiles are loaded (for performance)
clearTimeout(this._clearBgBufferTimer);
this._clearBgBufferTimer = setTimeout(L.bind(this._clearBgBuffer, this), 500);
}
}
},
@ -5032,7 +5049,7 @@ L.Polyline = L.Path.extend({
spliceLatLngs: function () { // (Number index, Number howMany)
var removed = [].splice.apply(this._latlngs, arguments);
this._convertLatLngs(this._latlngs);
this._convertLatLngs(this._latlngs, true);
this.redraw();
return removed;
},
@ -5070,15 +5087,16 @@ L.Polyline = L.Path.extend({
return bounds;
},
_convertLatLngs: function (latlngs) {
var i, len;
_convertLatLngs: function (latlngs, overwrite) {
var i, len, target = overwrite ? latlngs : [];
for (i = 0, len = latlngs.length; i < len; i++) {
if (L.Util.isArray(latlngs[i]) && typeof latlngs[i][0] !== 'number') {
return;
}
latlngs[i] = L.latLng(latlngs[i]);
target[i] = L.latLng(latlngs[i]);
}
return latlngs;
return target;
},
_initEvents: function () {
@ -6836,6 +6854,7 @@ L.Map.BoxZoom = L.Handler.extend({
L.DomEvent
.on(document, 'mousemove', this._onMouseMove, this)
.on(document, 'mouseup', this._onMouseUp, this)
.on(document, 'keydown', this._onKeyDown, this)
.preventDefault(e);
this._map.fire("boxzoomstart");
@ -6859,7 +6878,7 @@ L.Map.BoxZoom = L.Handler.extend({
box.style.height = (Math.max(0, Math.abs(offset.y) - 4)) + 'px';
},
_onMouseUp: function (e) {
_finish: function () {
this._pane.removeChild(this._box);
this._container.style.cursor = '';
@ -6867,7 +6886,13 @@ L.Map.BoxZoom = L.Handler.extend({
L.DomEvent
.off(document, 'mousemove', this._onMouseMove)
.off(document, 'mouseup', this._onMouseUp);
.off(document, 'mouseup', this._onMouseUp)
.off(document, 'keydown', this._onKeyDown);
},
_onMouseUp: function (e) {
this._finish();
var map = this._map,
layerPoint = map.mouseEventToLayerPoint(e);
@ -6883,6 +6908,12 @@ L.Map.BoxZoom = L.Handler.extend({
map.fire("boxzoomend", {
boxZoomBounds: bounds
});
},
_onKeyDown: function (e) {
if (e.keyCode === 27) {
this._finish();
}
}
});
@ -7857,6 +7888,7 @@ L.Map.include({
setView: function (center, zoom, forceReset) {
zoom = this._limitZoom(zoom);
center = L.latLng(center);
var zoomChanged = (this._zoom !== zoom);

8
dist/leaflet.js vendored

File diff suppressed because one or more lines are too long