Coder Social home page Coder Social logo

mikeswei / cesiumvectortile Goto Github PK

View Code? Open in Web Editor NEW
400.0 31.0 158.0 34.68 MB

Cesium VectorTileImageryProvider支持小数据量的geojson、shape文件 矢量 动态切片,实现贴地

Home Page: https://mikeswei.github.io/CesiumVectorTile/

License: Apache License 2.0

HTML 28.96% JavaScript 70.64% CSS 0.39%
cesium cesiumvectortile vectortile

cesiumvectortile's People

Contributors

engineerhe avatar luoxjun avatar mikeswei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cesiumvectortile's Issues

异步调试工具和源码阅读

您好,感谢您的分享,我对您的项目很感兴趣,但是在阅读源码的过程中遇到了一些问题,想向您请教。
1、 index,js文件中有很多异步操作,调试起来很困难,您是否有推荐的异步调试工具?
2、 您的项目包含了切片和绘图两大核心功能,请问这两部分**的关键函数是哪些?我想阅读这两部分代码分别应该从哪个入口开始调试比较合适?
望您指教!期待您的回复!

请问怎样显示geojson中的区域名称?

比如加载以下json只有线,怎样显示“北京市”文字?properties.name 字段

{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"adcode": 110000,
"name": "北京市",
"center": [
116.405285,
39.904989
],
"centroid": [
116.41995,
40.18994
],
"childrenNum": 16,
"level": "province",
"parent": {
"adcode": 100000
},
"subFeatureIndex": 0,
"acroutes": [
100000
]
},
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[

关于中文乱码

mikeswei 你好! 对比了新旧两版本的CesiumVectorTile代码,我发现新版本关于文字解码是读取的cpg文件如果没有cpg,默认按照utf-8解码, 旧版本相对来说在这块的逻辑貌似比较细腻,看到了正则对类似魔鬼数字的判断来寻找最合适的解码类似于 isChineseChar、isFullwidthChar这样的判断函数。
请问新版本没有延续这些逻辑是出于什么考量呢

"start": "mesh3d start -p=8023",

"scripts": {
"start": "mesh3d start -p=8023",
"build": "node src/bundle.js",
"prepublishOnly": "npm run build"
},
mesh3d是啥命令?

获取携带参数的文件url时,提示The data options.source provider is not supported.。

你好,我在使用这个工具的时候,发现无法使用携带参数的文件url。

  1. 使用文件url格式如下:
    http://localhost:4000/assets/abc/a.json?token=abc.def.acd
  2. 报错内容
    Uncaught (in promise) Error: The data options.source provider is not supported.
  3. 查看源码时,发现是Path.GetExtension这个方法的问题。因为token中有点.,所以实际获取到的扩展名是.acd,而不是.json

如何加载本地的shp文件

有一个需求是:本地选中shp文件,然后点击进行直接加载,我把获取到的文件直接放入source加载时会直接报错,请问本地加载时该怎么去使用呢

Cannot set property featureCollection of #<Object> which has only a getter

出现了如下的报错,cesium版本是1.59
turf-light.js:3
Uncaught TypeError: Cannot set property featureCollection of # which has only a getter
at Function.assign ()
at ./node_modules/cesiumvectortile/src/turf-light.js (turf-light.js:3:1)
at webpack_require (bootstrap:853:1)
at fn (bootstrap:150:1)
at ./node_modules/cesiumvectortile/src/VectorTileImageryProvider-light.js (VectorTileImageryProvider-light.js:14:1)
at webpack_require (bootstrap:853:1)
at fn (bootstrap:150:1)
at ./node_modules/cesiumvectortile/src/VectorTileImageryProvider.js (VectorTileImageryProvider.js:8:1)
at webpack_require (bootstrap:853:1)
at fn (bootstrap:150:1)

是否可以LOD金字塔矢量切片

跟mapbox类似, 将一个超大的矢量文件按不同级别切成若干的矢量文件,
之后使用你的CesiumVectorTile按照鼠标的当前可视区域来加载所在级别的矢量文件

如果做成这样,还要一个切矢量文件的工具

turf.simplify is not a function

你好,我这边尝试加载Assest里的china shp文件后加载成功了,但是提示turf.simplify is not a function
TypeError: turf.simplify is not a function\n at …e/src/VectorTileImageryProvider-light.js?:615:14)", message: "turf.simplify is not a function"

请问这个是什么情况造成的呢,望解答谢谢

URI is not define / 可否升级一下cesium版本 构建失败了

有没有人遇到这个问题
我的环境
vue3.0
vite-plugin-cesium 配置cesium
cesium 版本1.88.0
我看了一下 1.88.0版本的cesium source/core 目录下没有 Uri.js文件
是不是工具的cesium版本跟我的代码环境不一样
我把cesiumvectortile工具的cesium文件换成1.88.0 build失败
作者可以升级一下cesium版本吗?

用1.43之后版本的cesium,报错

在用1.43版本之后的cesium会报Cesium.loadText is not a function这个错误,提示用Resource.fetchText来代替,但是在cesium中没有找到这个类似的代码,请问楼主该如何解决这个问题或是能否告知Resource.fetchText怎么用?感谢楼主的帮忙!

和VueCesium一起使用报错

在ready函数中加载本地shp文件

onViewerReady ({ Cesium, viewer }) {
            
            // eslint-disable-next-line no-unused-vars
            var worldLayer = null
            // eslint-disable-next-line no-unused-vars
            var worldProvider = new VectorTileImageryProvider({
                source: 'http://localhost:1379/map/shp/区域_全球国界.shp',
                defaultStyle: {
                    outlineColor: 'rgb(255,0,0)',
                    lineWidth: 1,
                    fill: false,
                    tileCacheSize: 200,
                    showMaker: false,
                    showCenterLabel: true,
                    fontColor: 'rgba(255,0,0,1)',
                    labelOffsetX: -10,
                    labelOffsetY: -5,
                    fontSize: 13,
                    fontFamily: '黑体',
                    centerLabelPropertyName: 'NAME'
                },
                maximumLevel: 20,
                minimumLevel: 1,
                simplify: false
            })
            worldProvider.readyPromise.then(function () {
                worldLayer = viewer.imageryLayers.addImageryProvider(worldProvider)
            })
        }

报错信息:
Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'defaultAccessToken')
at load (webpack-internal:///./node_modules/vue-cesium/es/components/viewer/src/useViewer.mjs:487:28)

cesium版本

vue版本2.6 cesium版本1.87 ,加载shp文件报错。Uncaught TypeError: Cesium.requestAnimationFrame is not a function

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.