Merge branch 'master' into HEAD
This commit is contained in:
commit
b4c19096b3
@ -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({
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user