kikitte / MVTImageryProvider

A Mapbox style renderer for CesiumJS
MIT License
192 stars 50 forks source link

MVTImageryProvider.fromUrl或者new MVTImageryProvider加载远程的json后报错 #25

Closed wh1246935943 closed 1 year ago

wh1246935943 commented 1 year ago

代码如下:

const provider = new MVTImageryProvider({
      style: 'http://172.16.20.50:7010/sj_vector/v6/api/dataservice/10038.json?ak=mf72ff9295c740ec0f37e61433e8a3ad8d',
    });
    provider.readyPromise.then((res) => {
      state.mapInstance.viewer.imageryLayers.addImageryProvider(provider as unknown as ImageryProvider);
      state.mapInstance.cameraFlyTo({
        lon: 107.31373900349, lat: 22.111544365839, height: 30000
      })
    });

请求成功后,控制台报错: image

kikitte commented 1 year ago

该样式文件缺少必要的property:"version", "sources", "layers",不符合mapbox 样式规范。