zoukankan      html  css  js  c++  java
  • arcgis中goto的用法

    1.默认方式(在进行定位导航操作时不设置任何动画)

    shiftCamera(60)代表旋转60度如果需要跳转至指定位置,即可将注释部分放入到goto语句中。下面都是类似的

    document.getElementById("default").addEventListener("click", () => {
                view.goTo(shiftCamera(60)).catch(catchAbortError);
    
            //   {
            //         position: {
            //           x: 13.4,
            //           y: 52.52,
            //           z: 700000,
            //           spatialReference: {
            //             wkid: 4326
            //           }
            //         },
            //         heading: 0,
            //         tilt: 0
            //       },
            });

    2.缓慢移动

    document.getElementById("linearSlow").addEventListener("click", () => {
              view
                .goTo(
                  shiftCamera(60),
                  // Animation options for a slow linear camera flight
                  {
                    speedFactor: 0.1,
                    easing: "linear"
                  }
                )
                .catch(catchAbortError);
            });

    3.快速移动

     

     document.getElementById("linearFast").addEventListener("click", () => {
              view
                .goTo(
                  shiftCamera(60),
                  // Animation options for a fast linear camera flight
                  {
                    speedFactor: 6,
                    easing: "linear"
                  }
                )
                .catch(catchAbortError);
            });

     

    4.逐渐加快

     

     

     document.getElementById("expoIncrease").addEventListener("click", () => {
              view
                .goTo(
                  shiftCamera(60),
                  // Animation options for a camera flight with an increasing speed
                  {
                    duration: 4000,
                    easing: "in-expo"
                  }
                )
                .catch(catchAbortError);
            });

     

    5.在固定时间移动

     

    document.getElementById("fixedDuration").addEventListener("click", () => {
              view
                .goTo(shiftCamera(30), {
                  duration: 10000,
                  maxDuration: 10000 // Make sure to set maxDuration if the duration is bigger than 8000 ms
                })
                .catch(catchAbortError);
            });

     

    6.跳转至相应位置,并产生摆动的效果

     

     function customEasing(t) {
              return 1 - Math.abs(Math.sin(-1.7 + t * 4.5 * Math.PI)) * Math.pow(0.5, t * 10);
            }
    
            document.getElementById("bounceBerlin").addEventListener("click", () => {
              view
                .goTo(
                  {
                    position: {
                      x: 13.4,
                      y: 52.52,
                      z: 700000,
                      spatialReference: {
                        wkid: 4326
                      }
                    },
                    heading: 0,
                    tilt: 0
                  },
                  {
                    speedFactor: 0.3,
                    easing: customEasing
                  }
                )
                .catch(catchAbortError);
            });

     

     

     

     

     

     

     

     

  • 相关阅读:
    IOS-Storyboard全解析-第一部分
    IOS-Socket
    IOS-XMPP
    IOS-源代码管理工具(Git)
    IOS-源代码管理工具(SVN)
    python环境配置
    【移动开发】Android中WIFI开发总结(二)
    【移动开发】Android中WIFI开发总结(一)
    Android 连接Wifi和创建Wifi热点 demo
    Android 判断用户2G/3G/4G移动数据网络
  • 原文地址:https://www.cnblogs.com/1gaoyu/p/15167552.html
Copyright © 2011-2022 走看看