Merge branch 'master' into HEAD

This commit is contained in:
Mourner 2011-04-13 16:38:26 +03:00
commit b4c19096b3
2 changed files with 7 additions and 4 deletions

View File

@ -185,7 +185,7 @@ L.TileLayer = L.Class.extend({
var layer = this._leaflet_layer;
layer.fire('tileload', {tile: this});
layer.fire('tileload', {tile: this, url: this.src});
layer._tilesToLoad--;
if (!layer._tilesToLoad) {
@ -202,4 +202,4 @@ L.TileLayer = L.Class.extend({
}
}
});
});

View File

@ -3,8 +3,9 @@
*/
L.Map.include({
locate: function() {
locate: function(/*Boolean*/ noFitBounds) {
if (navigator.geolocation) {
this._fitBoundsOnLocate = !noFitBounds;
navigator.geolocation.getCurrentPosition(
L.Util.bind(this._handleGeolocationResponse, this),
L.Util.bind(this._handleGeolocationError, this));
@ -26,7 +27,9 @@ L.Map.include({
ne = new L.LatLng(lat + latAccuracy, lng + lngAccuracy),
bounds = new L.LatLngBounds(sw, ne);
this.fitBounds(bounds);
if (this._fitBoundsOnLocate) {
this.fitBounds(bounds);
}
this.fire('locationfound', {
latlng: new L.LatLng(lat, lng),