前言:之前都是基于EPSG:4236投影加载地图,有些场景需要改成EPSG:4490投影来加载地图,如果只改一个数字,则会报如下错误:
index.js??clonedRule…e=script&lang=js:25 Uncaught TypeError: Cannot read properties of null (reading 'getExtent') at ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/views/HomeView.vue?vue&type=script&lang=js (app.js:120:1) at __webpack_require__ (app.js:255:32) at fn (app.js:523:21) at eval (HomeView.vue?vue&typ…cript&lang=js:5:221) at ./src/views/HomeView.vue?vue&type=script&lang=js (app.js:41:1) at __webpack_require__ (app.js:255:32) at fn (app.js:523:21) at eval (HomeView.vue:6:95) at ./src/views/HomeView.vue (app.js:30:1)
我们需要通过投影转换的方式来正确加载EPSG:4490投影的地图。
目录