Git Product home page Git Product logo

vue-cesium-demo's Issues

可否更新 Cesium 到 1.113 以上版本

可否更新 Cesium 到 1.113 以上版本,控制台一直提示:
Globe.terrainExaggeration was deprecated in CesiumJS 1.113. It will be removed in CesiumJS 1.116. Use Scene.verticalExaggeration instead.
非常感谢!

Creating Promise Error / Can not convert to Object

I want to load cesium with vuejs, in this project i use VUE3 and quasar framework, when i try to load cesium-viewer without vc-config-provider component i got this error:

useViewer.ts:455 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '__scriptPromise')
    at beforeLoad (useViewer.ts:455:61)
    at load (useViewer.ts:464:11)
    at useViewer.ts:1083:7

when i try to load cesium-viewer with vc-config-provider component i got this error:

vue-router.mjs:3428 TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at keysOf (objects.ts:2:39)
    at mergeConfig (index.ts:39:48)
    at ReactiveEffect.fn (index.ts:29:12)
    at ReactiveEffect.run (reactivity.esm-bundler.js:185:25)
    at get value [as value] (reactivity.esm-bundler.js:1144:39)
    at provideGlobalConfig (index.ts:33:34)
    at setup (index.ts:21:20)
    at callWithErrorHandling (runtime-core.esm-bundler.js:155:22)
    at setupStatefulComponent (runtime-core.esm-bundler.js:7165:29)
triggerError @ vue-router.mjs:3428
(anonymous) @ vue-router.mjs:3464
Promise.catch (async)
handleScroll @ vue-router.mjs:3464
finalizeNavigation @ vue-router.mjs:3312
(anonymous) @ vue-router.mjs:3184
Promise.then (async)
pushWithRedirect @ vue-router.mjs:3153
push @ vue-router.mjs:3080
navigateToRouterLink @ use-router-link.js?v=22f2048f:250
onClick @ QItem.js?v=22f2048f:104
callWithErrorHandling @ runtime-core.esm-bundler.js:155
callWithAsyncErrorHandling @ runtime-core.esm-bundler.js:164
invoker @ runtime-dom.esm-bundler.js:369
objects.ts:2 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at keysOf (objects.ts:2:39)
    at mergeConfig (index.ts:39:48)
    at ReactiveEffect.fn (index.ts:29:12)
    at ReactiveEffect.run (reactivity.esm-bundler.js:185:25)
    at get value [as value] (reactivity.esm-bundler.js:1144:39)
    at provideGlobalConfig (index.ts:33:34)
    at setup (index.ts:21:20)
    at callWithErrorHandling (runtime-core.esm-bundler.js:155:22)
    at setupStatefulComponent (runtime-core.esm-bundler.js:7165:29)

code:

<template>
  <q-page class="flex" style="overflow: hidden; max-height:  calc(100vh - 55px); height: calc(100vh - 55px);">
    <q-no-ssr>
	  <vc-config-provider :cesium-path="vcConfig.cesiumPath">
        <vc-viewer ref="viewerRef" @ready="onViewerReady"> </vc-viewer>
      </vc-config-provider>
    </q-no-ssr>
  </q-page>
</template>

<script setup>
import { VcConfigProvider, VcViewer } from 'vue-cesium'
import { VcReadyObject } from 'vue-cesium/es/utils/types'
import { ref, reactive} from 'vue'
import { onMounted, } from 'vue'
import 'vue-cesium/dist/index.css'

const viewerRef = ref(null)
const onViewerReady = (readyObj) => {
  console.log(readyObj.Cesium) // Cesium namespace object
  console.log(readyObj.viewer) // instanceof Cesium.Viewer
}

const vcConfig = reactive({
    cesiumPath: 'https://unpkg.com/cesium@latest/Build/Cesium/Cesium.js',
    accessToken: 'xxxxxxxx'
})

onMounted(() => {
  console.log('onMounted')
  viewerRef.value.creatingPromise.then((readyObj) => {
    console.log(readyObj.Cesium) // Cesium namespace object
    console.log(readyObj.viewer) // instanceof Cesium.Viewer
  })
})
</script>

请问有没有这个demo的文档说明?

大神您好,最近我要做cesium相关的开发,觉得您的模板非常好,但苦于代码水平有限,看不懂您的代码,请问您这边有没有这个模板的说明文档?谢谢!

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.