We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9dfc627 commit fead83cCopy full SHA for fead83c
packages/maptalks/src/map/Map.ts
@@ -2360,6 +2360,15 @@ export class Map extends Handlerable(Eventable(Renderable(Class))) {
2360
2361
//@internal
2362
_setPrjCenter(pcenter: Coordinate) {
2363
+ if (pcenter && this._prjCenter) {
2364
+ //Respect the current altitude
2365
+ // https://github.com/maptalks/maptalks.js/issues/2724
2366
+ // https://github.com/maptalks/issues/issues/913
2367
+ if (!isNumber(pcenter.z) && isNumber(this._prjCenter.z)) {
2368
+ const altitude = this._prjCenter.z;
2369
+ pcenter.z = altitude;
2370
+ }
2371
2372
this._prjCenter = pcenter;
2373
if (this.isInteracting() && !this.isMoving()) {
2374
// when map is not moving, map's center is updated but map platform won't
0 commit comments