Giter Club home page Giter Club logo

mvtimageryprovider's Issues

作者您好,我们项目中使用了您的库,但是我有几个疑问,向您请教,期待回复。

1、MVTImageryProvider能在cesium中渲染矢量图的原理是将矢量数据通过MVTImageryProvider转换为栅格图,通过cesium的方法添加到地图展示,cesium最终加载的是栅格图.
2、我们项目中未来会做符号化相关的内容,所以我有一个关心点: 符号化相关的东西,比如绘制图形,添加符号等,这都是cesium 的api来实现,和MVTImageryProvider是无关的。
3、MVTImageryProvider不涉及符号化,且不会影响符号化相关的实现,从您的源码来看,也并不有提供其他数据操作的Api,其只是瓦片的展示。

以上我的描述是否正确,谢谢。

标注时不能渲染中文字符

屏幕截图 2022-08-23 153912
在使用时发现不能正常显示中文标注,不知是否配置正确。可以显示数字、英文,但是不显示中文字符,矢量瓦片服务互联网可以访问,配置如下
var style = {
version: 8,
name: "Light",
center: [106.387482, 29.787025, 17],
zoom: 0,
bearing: 0,
pitch: 0,
sources: {
layer_source: {
// scheme: "tms",
tiles: [
"http://zhsq.digitalcq.com/d2cpro/tileservice/dt_65poi_2sources_xianmian/{z}/{x}/{y}.mvt",
],
type: "vector",
},
},
glyphs: "http://zhsq.digitalcq.com/d2cpro/oms/static/fonts/font_1514359479/{fontstack}/{range}.pbf",
layers: [
{
id: "填充",
type: "fill",
source: "layer_source",
"source-layer": "dbsj_fwjz_csjz_jzjz_py",
minzoom: 0,
maxzoom: 18,
paint: {
"fill-color": "#66CCFF",
"fill-opacity": 0.7
},
},
{
"id": "注记",
"type": "symbol",
"minzoom": 0,
"source": "layer_source",
"source-layer": "dbsj_fwjz_csjz_jzjz_py",
"layout": {
"text-font": ["Open Sans Regular"],
"text-field": "{jzwmc}",
"text-max-width": 8,
"text-size": 12,
"text-allow-overlap": true
},
"paint": {
"text-color": "#ff0000",
"text-halo-width": 1,
"text-halo-color": "rgba(255,255,255,0.5)"
}
}
],
};

场景位置:
cesiumViewer.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(106.54, 29.59, 2000.0),
orientation: {
heading: Cesium.Math.toRadians(0.0),
pitch: Cesium.Math.toRadians(-90.0),
roll: 0.0
}
});
结果如截图,麻烦指教

如何获取未压缩的mapbox-gl.js?

您好,您的代码中mapbox-gl.js脚本库经过压缩了,调试和阅读源码比较困难。但是由于不熟悉mapbox,我没有找到未压缩的mapbox-gl.js,向您请教方法,期待您的回复。

加载mapbox style报错

demo可以跑通没有问题。但是mapbox官方的style。或者自定义的style都会报错。
如下
image
注释掉style中对应的配置就不再报错,但是地图就不再完整了

BasicRenderer刷新问题

你好!在如下的应用场景中,我需要对基于该插件的矢量图层渲染进行更新:
1、选中后,对选中的矢量图片进行高亮显示;
2、基于对style的表达式,在完成加载后,根据上下文环境更改style,并同步刷新矢量图层的样式。
但是,基于该插件所依赖的 Mapbox-vector-tiles-basic-js-renderer ,我无法使用 renderer.drawLayers(canvas, layers);renderer.render(); renderer.updateStyle(currentStyle); 等方法刷新图层渲染。
我需要怎样才能根据显示样式的变化重新渲染图层样式?

新版样式支持问题

用了大神的这个Provider处理矢量瓦片,能满足我的要求,但是在使用中发现,部分样式不支持,应该是版本不够新,比如:layout.text-radial-offset 这个样式就不支持,另外还有“line-center”样式也不支持。能不能麻烦大神升级下?谢谢!

如何编译Mapbox-vector-tiles-basic-js-renderer

你好,最近在学习这个项目的代码,想在此基础上,进行源码修改。
但在编译Mapbox-vector-tiles-basic-js-renderer遇到了些问题,引入自己打包后的文件会报错

6d860a01daa0b50f1d006ac5f1a95c1

希望能获得帮助。

我们的编译过程为:

yarn install

yarn run start-debug

矢量瓦片中的图层显示顺序有点问题

您好,使用后发现以下问题:
图层显示顺序应根据style里的layers数组的顺序进行显示,组数index为0的图层显示在最下面,经测试symbol类型的图层无法显示在fill类型的图层下面,但是可以显示在line类型的图层下面,请问该问题如何解决,望回复!

矢量瓦片上球展示后频繁更改要素属性会导致cesium地球崩溃

mbtiles矢量瓦片上球展示后,如果频繁更改某图层的要素属性会导致cesium地球崩溃。以线矢量图层的线宽属性为例,频繁更改线宽度值多次并更新视图,数次以后便会提示错误如下:【很奇怪,每次都是编辑属性15次就崩溃了】
错误3
错误2
错误1

这是控制图层更新的代码:
代码2

我尝试通过pickFeatures方法获取矢量元素信息,但是该方法返回的Promise状态总是rejected,我找不到问题的所在,求助。

我调用pickFeatures()想获取鼠标点击的元素的矢量信息,用于后期的操作,比如更换颜色。从我阅读源码猜测是用这个方法。
用cesium的api获取需取该方法需要的参数,如下:

function getApproximateZoomLevel() {
    var cameraHeight = state.mapInstance.viewer.camera.positionCartographic.height;
    var approximateZoomLevel = Math.log2(591657550.500000 / cameraHeight);
    console.log('Approximate Zoom Level: ', approximateZoomLevel);
    return approximateZoomLevel
  }
state.mapInstance.viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
      var cartesian = state.mapInstance.viewer.camera.pickEllipsoid(movement.position, state.mapInstance.viewer.scene.globe.ellipsoid);
      if (cartesian) {
          var cartographic = Cartographic.fromCartesian(cartesian);
          var longitude = Math.toDegrees(cartographic.longitude);
          var latitude = Math.toDegrees(cartographic.latitude);
          var height = cartographic.height;
          console.log('Clicked XYZ: ', cartesian);
          console.log('Clicked Longitude: ', longitude);
          console.log('Clicked Latitude: ', latitude);
          console.log('Clicked Height: ', height);
          
          const info = state.pbfProvider.pickFeatures(cartesian?.x, cartesian?.y, getApproximateZoomLevel(), longitude, latitude);
          console.log(info)
      }
    }, ScreenSpaceEventType.LEFT_CLICK);

但是这个方法总是返回Promise rejected,我想请问的是,我调用该方法传入的参数是否正确?对于这个报错我现在找不到问题的所在,请您帮我看下应该怎么处理。

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

代码如下:

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

放大图层层级,部分矢量数据加载不出来

当我尝试放大图层层级的时候,大部分数据的展示效果挺不错,但是会有一小部分区域并没有加载当前层级的图层,导致会有一种糊的效果,您有碰到这种情况吗?
image

how do you compile mapbox-gl.js

How do you compile mapbox-gl.js, I cloned https://github.com/landtechnologies/Mapbox-vector-tiles-basic-js-renderer and compiled it with webpack, but an error was reported, mapbox-gl.js under the dist directory of the source code Is also an error
provider.js:27 Uncaught (in promise) TypeError: f.coveringTiles is not a function
at Object.t.exports [as background] (provider.js:27)
at e.value (provider.js:23)
at e.value (provider.js:27)
at e.value (provider.js:23)
at e (provider.js:27)
at h (provider.js:27)
at provider.js:27

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.