zoukankan      html  css  js  c++  java
  • cesium-navigation 使用(非require,es6引用)

    cesium-navigation-es6(非require,es6引用)

    为什么你建立cesium-navigation插件?

    插件形式不影响之前项目使用,es6 使用

    首先,所有的Cesiumjs sdk 不包括罗盘,导航仪(放大/缩小)和距离刻度。您可以使用鼠标在地图上导航,但这个导航插件可为用户提供更多的导航控制和功能。其中一些功能是:将罗盘重置为指向北部,重置轨道,并将视图重置为默认边界。

    How to use it?

    QuickStart

    $ npm install cesium-navigation-es6 --save
    <template>
      <div id="cesiumContainer"></div>
    </template>
    <script type="text/javascript">
    import Cesium from "cesium/Cesium";
    import "cesium/Widgets/widgets.css";
    import CesiumNavigation from "cesium-navigation-es6";
    
    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;
    
    let viewer = new Cesium.Viewer("cesiumContainer");
    CesiumNavigation(viewer, options);
    

      

    Is there a demo using the plugin ?

    This is the demo:

    (https://github.com/richard1015/cesium-vue-example)

    参考文章

    https://www.jianshu.com/p/dd364b59b774

    https://www.jianshu.com/p/fb237c7eb48c

    https://blog.csdn.net/Prepared/article/details/68940997?locationNum=10&fps=1

  • 相关阅读:
    Day4 0708
    Day2 0706
    两道递推公式题的解题报告
    博客还需优化
    飞行路线Luogu4568
    堆优化Dijkstra(Luogu 4779)
    2019四等奖的清明节征文
    2019四等奖的叶圣陶初稿
    Luogu P1072 Hankson的趣味题
    Loj10022 埃及分数(迭代加深搜索IDDFS)
  • 原文地址:https://www.cnblogs.com/richard1015/p/10164573.html
Copyright © 2011-2022 走看看