你好,我们的项目需要右击功能,所以初始化的时候加了动态图层,代码如下
map.movingTarget = L.supermap.plotting.movingTargetLayer("动态图层", EsMapURL.SuperMapService.plotUrl);
map.movingTarget.addTo(map);
但是在进行地图销毁的时候,简易代码如下
destroyContainerMap(‘map’)
会报错:
“map.hasLayer is not a function
at NewClass.onRemove (iclient-plot-leaflet-es6.min.js?3cac:2689)
at EsMap2D.removeLayer (leaflet-src.js?e11e:6642)
at NewClass.removeFrom (leaflet-src.js?e11e:6523)
at NewClass.remove (leaflet-src.js?e11e:6512)
at eval (Map2DManager.js?5ac7:28)
at EsMap2D.eachLayer (leaflet-src.js?e11e:6677)
at Function.loadMap (Map2DManager.js?5ac7:26)
at a.load2D (map2d.vue?776b:359)
at EsMap2D.eval (map2d.vue?776b:363)
at EsMap2D.fire (leaflet-src.js?e11e:588)“
但是把动态图层去掉就不会报错,正常销毁,我想知道这是什么问题,感谢回复