2021-3月

一、html

1.class="form-control"

后面会有上下的加1减1的符号

 <div class="centerXY" style="background: #2128a266; box-shadow: 0px 1px 16px 0px #29449F;">
        <div class="input-group">
            <span class="input-group-addon">经度</span> <input type="number" class="form-control">
        </div>
        <div class="input-group"><span class="input-group-addon" >纬度</span> <input type="number"
                 class="form-control" >
        </div>
        <div class="input-group"><span class="input-group-addon" >高度</span> <input type="number"
                class="form-control" >
        </div>
        <div class="input-group text-right"><input id="btnCenterXY" type="button" class="btn btn-primary" value="确定">
        </div>
    </div>

image-20210319155618322

2.checkbox

<div class="checkbox checkbox-primary checkbox-inline">
        <input id="chkGfirstperson" class="styled" type="checkbox">
        <label for="chkGfirstperson">
            键盘漫游
        </label>
    </div>
$("#chkGfirstperson").change(function () {// 键盘漫游
            var val = $(this).is(':checked');
            viewer.mars.keyboard(val);
        });

image-20210322143137938

二、mars3d

1.创建页面的时候的几种方式

image-20210319161550220

image-20210319161554507

2.xyz

Z是当前坐标点的海拔,cameraZ才是视高

//{y: 36.62239, x: 117.001713, z: 138.27, cameraZ: 362.29835336075115}

​ // xyz 是当前视图中心点的经纬度和海拔

​ // 海拔 海拔 海拔

​ // cameraZ是视高

3.禁用开始的时候加载的动画

image-20210322112358926

三、JavaScript

1.!0

!0是true

!!0是false

{y: 36.62079, x: 117.006151, z: 104.25, cameraZ: 395.74929836815176}
widget.js?time=20190702:66 Cartesian3 {x: -2327370.62457271, y: 4566364.506217068, z: 3783796.971665846}
widget.js?time=20190702:74 Cartographic {longitude: 2.042155473553959, latitude: 0.6391601074116307, height: 103.11475219122286}
widget.js?time=20190702:75 117.00689
widget.js?time=20190702:76 36.621177
widget.js?time=20190702:77 103.1
widget.js?time=20190702:78

四、vscode

1.用户代码片段

image-20210322153108395

image-20210322153459545

五、坐标系

1.百度坐标、国测局坐标、WGS84坐标互转

https://blog.csdn.net/asd358924810/article/details/78243738

image-20210322154812996

image-20210322155225685

image-20210322155252183

上图这个mct2jwd 中经纬度是WGS84即 4326

总结:

4326:WGS84经纬度

​ 3857:web墨卡托投影,单位是米,

百度坐标、国测局坐标、WGS84坐标互转

​ 都是经纬度,wgs84加密>>>>国测局坐标(加密)>>>>>百度坐标

2.cesium 中的坐标转换

https://blog.csdn.net/qq_34149805/article/details/78393540

//通过弧度制,把经纬度转换成世界坐标4326>>>3857 
var ellipsoid = viewer.scene.globe.ellipsoid;
            var cartographic = Cesium.Cartographic.fromDegrees(120.448136, 36.166948, 500);
            var cartesian3 = ellipsoid.cartographicToCartesian(cartographic);
            console.log(cartesian3);
            //Cartesian3 {x: -2612587.9498698376, y: 4444489.05677647, z: 3743457.611150979}

//Cartesian3>>经纬度
var ellipsoid=viewer.scene.globe.ellipsoid;
var cartesian3=new Cesium.cartesian3(x,y,z);
var cartographic=ellipsoid.cartesianToCartographic(cartesian3);
var lat=Cesium.Math.toDegrees(cartographic.latitude);
var lng=Cesium.Math.toDegrees(cartographic.longitude);
var alt=cartographic.height;
posted @ 2021-04-17 12:03  zcbj588  阅读(80)  评论(0)    收藏  举报