mikeswei / cesiumvectortile Goto Github PK
View Code? Open in Web Editor NEWCesium VectorTileImageryProvider支持小数据量的geojson、shape文件 矢量 动态切片,实现贴地
Home Page: https://mikeswei.github.io/CesiumVectorTile/
License: Apache License 2.0
Cesium VectorTileImageryProvider支持小数据量的geojson、shape文件 矢量 动态切片,实现贴地
Home Page: https://mikeswei.github.io/CesiumVectorTile/
License: Apache License 2.0
试了几种引入方法,都会报错
build-all.bat,您这个批处理程序好像不能正确执行
你好,我在使用这个工具的时候,发现无法使用携带参数的文件url。
http://localhost:4000/assets/abc/a.json?token=abc.def.acd
;Uncaught (in promise) Error: The data options.source provider is not supported.
Path.GetExtension
这个方法的问题。因为token中有点.
,所以实际获取到的扩展名是.acd
,而不是.json
。vue版本2.6 cesium版本1.87 ,加载shp文件报错。Uncaught TypeError: Cesium.requestAnimationFrame is not a function
vite 使用vite-plugin-cesium,通过‘import VectorTileImageryProvider from 'cesiumvectortile'’这种方式导入,运行时候报错‘URI is not defined’ 是怎么回事,是cesium版本的问题吗
有一个需求是:本地选中shp文件,然后点击进行直接加载,我把获取到的文件直接放入source加载时会直接报错,请问本地加载时该怎么去使用呢
点状无法贴地,显示不完全?
你好,你这个提供了npm下载的方式,但是未提供vue引入的方式,如果您已经解决了vue引入的方式,可否告知我一下谢谢!
使用http://gaohr.win/site/blogs/2017/2017-04-18-GIS-basic-data-of-China.html#County_pl
上面的主要铁路shp文件,铁路名称属性NAME的时候汉字显示为问号, PINYIN显示正常
你好,我这边尝试加载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"
请问这个是什么情况造成的呢,望解答谢谢
请问我想加载geoserver的矢量切片,可以么,要么是pbf格式的,要么是geojson格式的,都可以。
修改 src/VectorTileImageryProvider-light.js 和 doc/CesiumVectorTile.pure.js.html 中
function groupByCenterLabelPropertyName(geoJSON, centerLabelPropertyName) {
...
if (geometry) return; 改为 if (!geometry) return;
...
}
您好,感谢您的分享,我对您的项目很感兴趣,但是在阅读源码的过程中遇到了一些问题,想向您请教。
1、 index,js文件中有很多异步操作,调试起来很困难,您是否有推荐的异步调试工具?
2、 您的项目包含了切片和绘图两大核心功能,请问这两部分**的关键函数是哪些?我想阅读这两部分代码分别应该从哪个入口开始调试比较合适?
望您指教!期待您的回复!
在用1.43版本之后的cesium会报Cesium.loadText is not a function这个错误,提示用Resource.fetchText来代替,但是在cesium中没有找到这个类似的代码,请问楼主该如何解决这个问题或是能否告知Resource.fetchText怎么用?感谢楼主的帮忙!
跟mapbox类似, 将一个超大的矢量文件按不同级别切成若干的矢量文件,
之后使用你的CesiumVectorTile按照鼠标的当前可视区域来加载所在级别的矢量文件
如果做成这样,还要一个切矢量文件的工具
如何支持pdf矢量瓦片吗
出现了如下的报错,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)
mikeswei 你好! 对比了新旧两版本的CesiumVectorTile代码,我发现新版本关于文字解码是读取的cpg文件如果没有cpg,默认按照utf-8解码, 旧版本相对来说在这块的逻辑貌似比较细腻,看到了正则对类似魔鬼数字的判断来寻找最合适的解码类似于 isChineseChar、isFullwidthChar这样的判断函数。
请问新版本没有延续这些逻辑是出于什么考量呢
比如加载以下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": [
[
[
在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)
目录中只有shp,shx,dbf,cpg四种文件怎么办
有没有人遇到这个问题
我的环境
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版本吗?
"scripts": {
"start": "mesh3d start -p=8023",
"build": "node src/bundle.js",
"prepublishOnly": "npm run build"
},
mesh3d是啥命令?
请问在加载Geojson数据之后只能用defaultStyle和styleFilter来设置两种不同的style吗,可以根据各要素的某一属性的差异来设置多种style吗
在构建VectorTileImageryProvider出现异常
修改 src/VectorTileImageryProvider-light.js 和 doc/CesiumVectorTile.pure.js.html 中
function groupByCenterLabelPropertyName(geoJSON, centerLabelPropertyName) {
...
if (geometry) return; 改为 if (!geometry) return;
...
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.