Skip to content

Commit

Permalink
fix:图层在addTo后添加
Browse files Browse the repository at this point in the history
migrationLayer在创建完还没addTo到map上就在地图上添加dom了
应该在addTo(map)后添加dom
  • Loading branch information
syswing committed Sep 25, 2020
1 parent 1a2822e commit a545e71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/src.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@
this.canvas = document.createElement('canvas');
this.context = this.canvas.getContext('2d');
container.appendChild(this.canvas);
this._map.getPanes().overlayPane.appendChild(container);
//this._map.getPanes().overlayPane.appendChild(container);
//this._resize();
if (!this.migration) {
var data = this._convertData();
Expand Down Expand Up @@ -615,6 +615,7 @@
},
addTo: function () {
this._bindMapEvents();
this._map.getPanes().overlayPane.appendChild(this.container);
var bounds = this._map.getBounds();
if (bounds && this.migration.playAnimation) {
this._resize();
Expand Down

0 comments on commit a545e71

Please sign in to comment.