richard1015 / cesium-navigation-es6 Goto Github PK
View Code? Open in Web Editor NEW仓库已迁移https://github.com/cesium-plugin/cesium-navigation-es6
Home Page: https://richard1015.github.io/cesium/
License: MIT License
仓库已迁移https://github.com/cesium-plugin/cesium-navigation-es6
Home Page: https://richard1015.github.io/cesium/
License: MIT License
比如我想把比例尺放到屏幕的右边,但是在<style>下修改不管用。感谢
zoomIn 和zoomOut都正常,但是重制视图没有效果
该段提示即安装依赖后出现的问题,原因是无法在当前依赖包文件中找到对应的文件【cesium/Source/Cesium.js】
按理来说即使无法在本依赖文件中找不到也会往上一级一级的查找,此问题让本人百思不得其解,往看到此问题后能及时回复
Cesium1.67.0中已经删除了defineProperties方法,改用原生Object.defineProperties替代,但cesium-navigation-es6插件最新版本代码中还没有更改过来,使用时会报错。
When I try to use this in my typescript project, I get the error:
Cannot find module 'cesium-navigation-es6' or its corresponding type declarations.
34 | } from "cesium";
35 |
> 36 | import { CesiumNavigation } from "cesium-navigation-es6"
How can I use this module with typescript?
This dependency was not found:
* cesium in ./node_modules/cesium-navigation-es6/viewerCesiumNavigationMixin.js, ./node_modules/cesium-navigation-es6/CesiumNavigation.js and 9 others
To install it, you can run: npm install --save cesium
<template>
<el-container style="height: 100%">
<el-main style="padding: 0px;height:94%;">
<div id="cesiumContainer"></div>
</el-main>
</el-container>
</template>
<script>
import * as Cesium from 'cesium/Cesium'
import CesiumNavigation from 'cesium-navigation-es6'
export default{
name: 'cesiumContainer',
data () {
return {
dialogVisible: false,
viewer: null,
cartesian: null,
}
},
mounted () {
var me = this
me.viewer = new Cesium.Viewer('cesiumContainer')
var options = {}
options.defaultResetView = Cesium.Rectangle.fromDegrees(80, 22, 130, 50)
options.enableCompass = true
options.enableZoomControls = true
options.enableDistanceLegend = true
options.enableCompassOuterRing = true
CesiumNavigation(me.viewer, options)
}
}
</script>
请问该怎么办呢?
你好,现在cesium版本是1.71.0,npm中cesium-navigation-es6包最新1.1.6,它package中使用的cesium是1.6.4,如果项目使用cesium版本是1.71.0,就无法使用cesium-navigation-es6包(除非手动改这个包的代码),npm中可以更新一下吗?使得cesium版本一致,非常感谢!
微信交流群
由于邮件过多,来不及看,大家可以加群方便及时响应
请添加微信号: zpc1305780485 备注 申请加群 cesium-navigation-es6
🎉🎉欢迎大家使用 cesium-navigation-es6 库~ 🎉🎉
如果您在使用过程中遇到什么问题可通过 Issues 或邮件 [email protected] 联系我们。
您的支持是我开发的动力。
欢迎Star,欢迎PR~
你好,使用cesium 调用 cesium-navigation-es6 使用 TypeScript 语言 出错。
测试地址:https://github.com/z3214965/test-dem
麻烦你帮忙看下,谢谢。
老大,webpack4+babel7 下打包出错 ,有办法解决么?
ERROR Failed to compile with 11 errors 11:04:15
This dependency was not found:
* cesium/Source/Cesium.js in ./node_modules/cesium-navigation-es6/viewerCesiumNavigationMixin.js, ./node_modules/cesium-navigation-es6/CesiumNavigation.js and 9 others
To install it, you can run: npm install --save cesium/Source/Cesium.js
package.json内容如下:
{
"name": "cesium_vue",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "Dicky",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"unit": "jest --config test/unit/jest.conf.js --coverage",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.19.2",
"cesium": "^1.69.0",
"cesium-navigation-es6": "^1.1.5",
"cesium-print": "^1.0.6",
"element-ui": "^2.13.1",
"font-awesome": "^4.7.0",
"sass-loader": "^8.0.2",
"vue": "^2.5.2",
"vue-router": "^3.0.1"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-proposal-function-sent": "^7.0.0",
"@babel/plugin-proposal-json-strings": "^7.0.0",
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/plugin-syntax-jsx": "^7.0.0",
"@babel/plugin-transform-modules-commonjs": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/runtime-corejs2": "^7.9.6",
"autoprefixer": "^7.1.2",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^9.0.0",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^23.4.2",
"babel-loader": "^8.1.0",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"chalk": "^2.0.1",
"chromedriver": "^2.27.2",
"copy-webpack-plugin": "^4.0.1",
"cross-spawn": "^5.0.1",
"css-loader": "^3.5.3",
"eslint": "^4.15.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^6.2.2",
"file-loader": "^6.0.0",
"friendly-errors-webpack-plugin": "^1.7.0",
"html-webpack-plugin": "^4.3.0",
"jest": "^22.0.4",
"jest-serializer-vue": "^0.3.0",
"js-cookie": "^2.2.1",
"mini-css-extract-plugin": "^0.9.0",
"nightwatch": "^0.9.12",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"selenium-server": "^3.0.1",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^4.1.0",
"vue-jest": "^1.0.2",
"vue-loader": "^15.9.1",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^4.43.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
我是vue+cesium1.72.0进行开发,当我引入大佬你写的这个插件的时候,出现如下错误:
./node_modules/cesium-navigation-es6/CesiumNavigation.js
Module not found: Error: Can't resolve 'cesium/Source/Cesium.js' in '/Users/adsionli/code/vue-cesium-test/node_modules/cesium-navigation-es6'
在main.js下,我是这样写的
import CesiumNavigation from 'cesium-navigation-es6'
Vue.prototype.CesiumNavigation = CesiumNavigation
VM1532 \node_modules\cesium-navigation-es6\viewerCesiumNavigationMixin.js:1 Uncaught SyntaxError: Unexpected token import
低版本的cesium没办法用吗
请教一下,指北针的 N的样式,可以修改吗?options没有找到文档
./node_modules/cesium-navigation-es6/node_modules/entities/maps/entities.json
Module parse failed: Unexpected token e in JSON at position 0 while parsing near 'export default "data...'
File was processed with these loaders:
react、cesium1.60
After add import CesiumNavigation from "cesium-navigation-es6";
then add
var options = {};
// 用于在使用重置导航重置地图视图时设置默认视图控制。接受的值是Cesium.Cartographic 和 Cesium.Rectangle.
options.defaultResetView = Cesium.Rectangle.fromDegrees(80, 22, 130, 50);
// 用于启用或禁用罗盘。true是启用罗盘,false是禁用罗盘。默认值为true。如果将选项设置为false,则罗盘将不会添加到地图中。
options.enableCompass= true;
// 用于启用或禁用缩放控件。true是启用,false是禁用。默认值为true。如果将选项设置为false,则缩放控件将不会添加到地图中。
options.enableZoomControls= false;
// 用于启用或禁用距离图例。true是启用,false是禁用。默认值为true。如果将选项设置为false,距离图例将不会添加到地图中。
options.enableDistanceLegend= false;
// 用于启用或禁用指南针外环。true是启用,false是禁用。默认值为true。如果将选项设置为false,则该环将可见但无效。
options.enableCompassOuterRing= true;
CesiumNavigation(viewer, options);
Howerver I can't move and zoom .
my react can‘t eject so does't support less. Is that the reason?
cesium1.50版本没有问题,换成cesium1.73,在html页面这样引入<script src="viewerCesiumNavigationMixin.min.js"></script>,是不是不能采用这种方式引入?
这样修改后也不会影响之前的版本
一直以来都在使用cesium-navigation-es6,想提一下建议,能否让enableCompass、enableZoomControls、enableDistanceLegend、enableCompassOuterRing这几个控制参数可以在初始化指北针对象之后,能以成员参数的形式进行控制?
代码两个都是定位到0,0,不能定位到下面坐标点的范围
options.defaultResetView = new Cesium.Cartographic.fromDegrees(117.704, 38.34, 9000)
// options.defaultResetView = Cesium.Rectangle.fromDegrees(80, 22, 130, 50)
但是我直接使用
this.camera.flyTo({
destination: this.scene.globe.ellipsoid.cartographicToCartesian(new Cesium.Cartographic.fromDegrees(117.704, 38.34, 9000)),
})
视图时可以跳到指定位置
The error statement:
var http = URL.protocol === "https:" ? require("https") : require("http");
var zlib = require("zlib");
ERROR in ./node_modules/zlib/lib/zlib.js
Module not found: Error: Can't resolve './zlib_bindings' in 'D:\Project\Cesium\scAPPFronted-Navigation\node_modules\zlib\lib'
ERROR in ./node_modules/cesium/Source/Core/Resource.js
Module not found: Error: Can't resolve 'http' in 'D:\Project\Cesium\scAPPFronted-Navigation\node_modules\cesium\Source\Core'
ERROR in ./node_modules/cesium/Source/Core/Resource.js
Module not found: Error: Can't resolve 'https' in 'D:\Project\Cesium\scAPPFronted-Navigation\node_modules\cesium\Source\Core'
Otherwise, my cesium project is build in angular
1.67版本不能用了,请求升级
Cesium版本为:1.50
"cesium": "^1.50.0", "cesium-navigation-es6": "^1.1.6",
ERROR Failed to compile with 11 errors 11:04:53 AM
This dependency was not found:
To install it, you can run: npm install --save cesium/Source/Cesium.js
ERROR CODE ERR_WEBPACK_MODULE_NOT_FOUND
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.