首页 / 浏览问题 / 云GIS / 问题详情
MAP初始化问题
1EXP 2021年11月09日

再  VUE页面的 mounted中初始化地图
 

const url = "https://iserver.supermap.io/iserver/services/map-world/rest/maps/World";
map = new window.SuperMap.Map("map");
//control = new SuperMap.Control.MousePosition();     //该控件显示鼠标移动时,所在点的地理坐标。
//map.addControl(control);  //添加控件
// 创建图层对象
layer = new window.SuperMap.Layer.TiledDynamicRESTLayer("World", url, { transparent: true, cacheEnabled: true }, { maxResolution: "auto" });
layer.events.on({ "layerInitialized": this.addLayer });
页面运行报 Error in mounted hook: "TypeError: window.SuperMap.Map is not a constructor"

1个回答

您好,您是采用的哪个地图库呢,比如:leaflet,openlayers,classic,添加地图您可以参看官网示例https://iclient.supermap.io/,选择相应的地图库进行查看,看一下改引入的js文件都引入了吗

1,000EXP 2021年11月09日
...