-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix-google-map-offsets-in-china' into fix-google-map-of…
…fsets-in-china
- Loading branch information
Showing
2 changed files
with
18 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -355,11 +355,13 @@ L.GridLayer.GoogleMutant = L.GridLayer.extend({ | |
this._initContainer(); | ||
}, | ||
|
||
_update: function () { | ||
_update: function (center) { | ||
// zoom level check needs to happen before super's implementation (tile addition/creation) | ||
// otherwise tiles may be missed if maxNativeZoom is not yet correctly determined | ||
if (this._mutant) { | ||
var center = this._map.getCenter(); | ||
if (center === undefined) { | ||
var center = this._map.getCenter(); | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
johnd0e
Contributor
|
||
var _center = new google.maps.LatLng(center.lat, center.lng); | ||
|
||
this._mutant.setCenter(_center); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 comment
on commit 555f025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment here
This commit changed external source file which can lead to troubles when we decide to update this external dependency.
So we should avoid this if we can.
Better approach is to extend.
Or monkey-patch in runtime (as a last resort).
If we still need to patch dependency then we have to document it thoroughly.