首页 / 浏览问题 / WebGIS / 问题详情
undefined (reading 'TiledMapLayer')
9EXP 2023年02月23日
使用产品 问题详细描述 使用 supermap/iclient-leaflet 问题重现步骤 import Vue from 'vue' import App from './App.vue' import L from 'leaflet'; import '@supermap/iclient-leaflet'; Vue.prototype.$L = L; this.$L.supermap.tiledMapLayer(url).addTo(map); 提示[Vue warn]: Error in mounted hook: "TypeError: Cannot read properties of undefined (reading 'TiledMapLayer')" 已经重新安装很多次依赖了,按需引入就可以, 全局引入就不行

1个回答

您好,

使用vue+leaflet,遇到 Cannot read properties of undefined (reading 'TiledMapLayer')

如果您使用的11i, 由于11i版本更新,如需使用ES6语法,添加配置项后,只支持按需引入,

参考:

https://blog.csdn.net/supermapsupport/article/details/109294147

如果您这个环境下实在想用全局引入,建议您使用10i及以前版本的。

希望可以帮助到您。

9,608EXP 2023年02月23日
...