Open seetop100 opened 3 years ago
首先,安装mapvgl
npm install mapvgl
然后,引入mapvgl包
import * as mapvgl from 'mapvgl'
import * as mapvgl from 'mapvgl' 这句后来我也摸索到了,只不过npm包里面有threelayers不知道怎么引入,以及CarLineLayer在html使用正常,在vue里面就莫名报错
[.WebGL-8E2BF500] GL_INVALID_OPERATION: Insufficient buffer size. mapvglscreen:1 WebGL: too many errors, no more errors will be reported to the console for this context.
let data2 = [ { geometry: { type: "LineString", coordinates: [ [106.572756, 29.575954], [106.569585, 29.576244], [106.568013, 29.576284], [106.565013, 29.576354], [106.560898, 29.576378], ], }, }, ]; carlineLayer = new mapvgl.CarLineLayer({ url: "/static/model/car.gltf", autoPlay: true, scale: 10, //大小 }); view.addLayer(carlineLayer); carlineLayer.setData(data2);
mapvgl只能用require引入 const mapvgl = require('mapvgl'); https://gitee.com/guyangyang/vue-mapvgl 这个是我封的版本,当时封装时发现import有问题,只能采用require方式
BMapGL 怎么弄???
简书看到的,这样比较优雅,成功了。mapv以及mapVgl还不考虑完全兼容vuecli吗?看着还是直接引入js就感觉特别扭。https://www.jianshu.com/p/e238aaa4fa38
简书看到的,这样比较优雅,成功了。mapv以及mapVgl还不考虑完全兼容vuecli吗?看着还是直接引入js就感觉特别扭。https://www.jianshu.com/p/e238aaa4fa38
可以看下 vue-bmap-gl 与 vue-mapvgl 两个项目
CarLineLayer在vue里面报错不显示