Open superfeng-99 opened 4 years ago
问题可能出现在MapAppArcgis2D.ts initialize方法: baseLayers.addMany( mapConfig.baseLayers.map((layerConfig: ILayerConfig) => { if (layerConfig.type === 'tiled') { delete layerConfig.type; let tileLayer = new TileLayer(layerConfig) // return new TileLayer(layerConfig); 把layerConfig.type = "tiled"再加回去 layerConfig.type = "tiled"; return tileLayer; } else if (layerConfig.type === 'webtiled') { return new WebTileLayer({ urlTemplate: layerConfig.url, subDomains: layerConfig.subDomains || undefined }); } })
封装了单独的组件。在两个页面调用,切换路由后,地图就消失了。需要刷新页面一次地图才会出现。
`