Merged #488 fix from stable, closed #488, allowed smart tabs

This commit is contained in:
mourner 2012-02-15 11:03:39 +02:00
commit 30f1c6af9e
7 changed files with 36 additions and 29 deletions

View File

@ -15,7 +15,11 @@ Leaflet Changelog
* Fixed a bug where `TileLayer.WMS` wouldn't take `insertAtTheBottom` option into account (by [@bmcbride](https://github.com/bmcbride)). [#478](https://github.com/CloudMade/Leaflet/pull/478) * Fixed a bug where `TileLayer.WMS` wouldn't take `insertAtTheBottom` option into account (by [@bmcbride](https://github.com/bmcbride)). [#478](https://github.com/CloudMade/Leaflet/pull/478)
## 0.3.1 (February 14, 2012) (Happy Valentine's ;) ## 0.3.2 RC
* Fixed a regression where removeLayer would not remove corresponding attribution. [#488](https://github.com/CloudMade/Leaflet/issues/488)
## 0.3.1 (February 14, 2012)
* Fixed a regression where default marker icons wouldn't work if Leaflet include url contained a query string. * Fixed a regression where default marker icons wouldn't work if Leaflet include url contained a query string.
* Fixed a regression where tiles sometimes flickered with black on panning in iOS. * Fixed a regression where tiles sometimes flickered with black on panning in iOS.
@ -135,11 +139,11 @@ Leaflet Changelog
* Fixed a bug that caused click delays on zoom control. * Fixed a bug that caused click delays on zoom control.
## 0.2.1 (June 18, 2011) ## 0.2.1 (2011-06-18)
* Fixed regression that caused error in `TileLayer.Canvas`. * Fixed regression that caused error in `TileLayer.Canvas`.
## 0.2 (June 17, 2011) ## 0.2 (2011-06-17)
### Major features ### Major features
@ -215,6 +219,6 @@ Leaflet Changelog
* Fixed a bug that prevented panning/clicking on Opera Mobile. [#138](https://github.com/CloudMade/Leaflet/issues/138) * Fixed a bug that prevented panning/clicking on Opera Mobile. [#138](https://github.com/CloudMade/Leaflet/issues/138)
* Fixed potentional memory leak on WebKit when removing tiles, thanks to [@Scalar4eg](https://github.com/Scalar4eg). [#107](https://github.com/CloudMade/Leaflet/issues/107) * Fixed potentional memory leak on WebKit when removing tiles, thanks to [@Scalar4eg](https://github.com/Scalar4eg). [#107](https://github.com/CloudMade/Leaflet/issues/107)
## 0.1 (May 13, 2011) ## 0.1 (2011-05-13)
Initial Leaflet release. Initial Leaflet release.

View File

@ -40,5 +40,6 @@ exports.config = {
"eqeqeq": true, "eqeqeq": true,
"trailing": true, "trailing": true,
"white": true "white": true,
}; "smarttabs": true
};

View File

@ -5,9 +5,9 @@
<link rel="stylesheet" href="../../dist/leaflet.css" /> <link rel="stylesheet" href="../../dist/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]--> <!--[if lte IE 8]><link rel="stylesheet" href="../../dist/leaflet.ie.css" /><![endif]-->
<link rel="stylesheet" href="../css/screen.css" /> <link rel="stylesheet" href="../css/screen.css" />
<script src="../leaflet-include.js"></script> <script src="../leaflet-include.js"></script>
</head> </head>
<body> <body>
@ -15,23 +15,23 @@
<div id="map"></div> <div id="map"></div>
<script type="text/javascript"> <script type="text/javascript">
function getCloudMadeUrl(styleId) { function getCloudMadeUrl(styleId) {
return 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/' + styleId + '/256/{z}/{x}/{y}.png'; return 'http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/' + styleId + '/256/{z}/{x}/{y}.png';
} }
var cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade', var cloudmadeAttribution = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
cloudmade = new L.TileLayer(getCloudMadeUrl(997), {attribution: cloudmadeAttribution}), cloudmade = new L.TileLayer(getCloudMadeUrl(997), {attribution: cloudmadeAttribution}),
cloudmade2 = new L.TileLayer(getCloudMadeUrl(998), {attribution: cloudmadeAttribution}); cloudmade2 = new L.TileLayer(getCloudMadeUrl(998), {attribution: 'Hello world'});
var map = new L.Map('map').addLayer(cloudmade).setView(new L.LatLng(50.5, 30.51), 15); var map = new L.Map('map').addLayer(cloudmade).setView(new L.LatLng(50.5, 30.51), 15);
var marker = new L.Marker(new L.LatLng(50.5, 30.505)); var marker = new L.Marker(new L.LatLng(50.5, 30.505));
map.addLayer(marker); map.addLayer(marker);
var marker2 = new L.Marker(new L.LatLng(50.502, 30.515)); var marker2 = new L.Marker(new L.LatLng(50.502, 30.515));
map.addLayer(marker2); map.addLayer(marker2);
var layersControl = new L.Control.Layers({ var layersControl = new L.Control.Layers({
'CloudMade Fresh': cloudmade, 'CloudMade Fresh': cloudmade,
'CloudMade Pale Dawn': cloudmade2 'CloudMade Pale Dawn': cloudmade2
@ -39,9 +39,9 @@
'Some marker': marker, 'Some marker': marker,
'Another marker': marker2 'Another marker': marker2
}); });
map.addControl(layersControl); map.addControl(layersControl);
</script> </script>
</body> </body>
</html> </html>

9
dist/leaflet-src.js vendored
View File

@ -807,6 +807,11 @@ L.LatLngBounds = L.Class.extend({
var sw = this._southWest, var sw = this._southWest,
ne = this._northEast; ne = this._northEast;
return [sw.lng, sw.lat, ne.lng, ne.lat].join(','); return [sw.lng, sw.lat, ne.lng, ne.lat].join(',');
},
equals: function (/*LatLngBounds*/ bounds) {
return bounds ? this._southWest.equals(bounds.getSouthWest()) &&
this._northEast.equals(bounds.getNorthEast()) : false;
} }
}); });
@ -1802,7 +1807,7 @@ L.TileLayer = L.Class.extend({
if (this.options.reuseTiles) { if (this.options.reuseTiles) {
this._unusedTiles.push(this._tiles[key]); this._unusedTiles.push(this._tiles[key]);
} }
//tile.src = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='; tile.src = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';
delete this._tiles[key]; delete this._tiles[key];
} }
@ -4927,7 +4932,7 @@ L.Control.Attribution = L.Control.extend({
var attribs = []; var attribs = [];
for (var i in this._attributions) { for (var i in this._attributions) {
if (this._attributions.hasOwnProperty(i)) { if (this._attributions.hasOwnProperty(i) && this._attributions[i]) {
attribs.push(i); attribs.push(i);
} }
} }

2
dist/leaflet.js vendored

File diff suppressed because one or more lines are too long

View File

@ -51,7 +51,7 @@ L.Control.Attribution = L.Control.extend({
var attribs = []; var attribs = [];
for (var i in this._attributions) { for (var i in this._attributions) {
if (this._attributions.hasOwnProperty(i)) { if (this._attributions.hasOwnProperty(i) && this._attributions[i]) {
attribs.push(i); attribs.push(i);
} }
} }

View File

@ -80,14 +80,11 @@ L.LatLngBounds = L.Class.extend({
var sw = this._southWest, var sw = this._southWest,
ne = this._northEast; ne = this._northEast;
return [sw.lng, sw.lat, ne.lng, ne.lat].join(','); return [sw.lng, sw.lat, ne.lng, ne.lat].join(',');
}, },
equals: function (/*LatLngBounds*/ bounds) { equals: function (/*LatLngBounds*/ bounds) {
var equals = false; return bounds ? this._southWest.equals(bounds.getSouthWest()) &&
if (bounds !== null) { this._northEast.equals(bounds.getNorthEast()) : false;
equals = (this._southWest.equals(bounds.getSouthWest()) && this._northEast.equals(bounds.getNorthEast()));
}
return equals;
} }
}); });