Merge remote-tracking branch 'origin/master' into master
9 files modified
26 files added
| | |
| | | .idea |
| | | .vscode |
| | | data/ |
| | | libs/ |
| | |
| | | } |
| | | }, |
| | | { |
| | | "name": "测试", |
| | | "uri": "widgets/cs/Widget", |
| | | "position": { |
| | | "right": 10, |
| | | "top": 96, |
| | | "width": "350px", |
| | | "height": "320px", |
| | | "relativeTo": "map" |
| | | } |
| | | }, |
| | | { |
| | | "name": "卷帘对比", |
| | | "uri": "widgets/Rolling/Widget", |
| | | "position": { |
| | |
| | | "height": "50px", |
| | | "relativeTo": "map" |
| | | } |
| | | }, |
| | | { |
| | | "name": "我的标记", |
| | | "uri": "widgets/Sign/Widget", |
| | | "position": { |
| | | "right": 10, |
| | | "top": 96, |
| | | "width": "320px", |
| | | "height": "360px", |
| | | "relativeTo": "map" |
| | | } |
| | | |
| | | |
| | | }, |
| | | { |
| | | "name": "坐标定位", |
| | | "uri": "widgets/CoorPosition/Widget", |
| | | "position": { |
| | | "right": 10, |
| | | "top": 96, |
| | | "width": "217px", |
| | | "height": "180px", |
| | | "relativeTo": "map" |
| | | } |
| | | }, |
| | | { |
| | | "name": "场景快照", |
| | | "uri": "widgets/MapPrinting/Widget", |
| | | "position": { |
| | | "right": 10, |
| | | "top": 96, |
| | | "width": "200px", |
| | | "height": "40px", |
| | | "relativeTo": "map" |
| | | } |
| | | }, |
| | | { |
| | | "name": "路线导航", |
| | | "uri": "widgets/RouteNavigate/Widget", |
| | | "position": { |
| | | "right": 10, |
| | | "top": 96, |
| | | "width": "300px", |
| | | "height": "780px", |
| | | "relativeTo": "map" |
| | | } |
| | | } |
| | | ], |
| | | "groups": [], |
| | | "panel": { |
| | |
| | | ] |
| | | }, |
| | | { |
| | | "name": "赣州电子地图", |
| | | "tooltip": "赣州电子地图", |
| | | "iconUrl": "images/basemaps/tianditushiliang.png", |
| | | "layers": [ |
| | | { |
| | | "label": "赣州电子地图", |
| | | "type": "wmts", |
| | | "url": "http://sw797.com:6080/arcgis/rest/services/GZHS/MapServer/WMTS", |
| | | "layer": "GZHS", |
| | | "style": "default", |
| | | "format": "image/jpgpng", |
| | | "tileMatrixSetID": "default028mm", |
| | | "maximumLevel": 17 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | "name": "天地图矢量", |
| | | "tooltip": "天地图矢量", |
| | | "iconUrl": "images/basemaps/tianditushiliang.png", |
| | |
| | | { |
| | | "name": "谷歌", |
| | | "tooltip": "谷歌", |
| | | "iconUrl": "images/basemaps/tiandituimage.png", |
| | | "iconUrl": "images/basemaps/guge.jpg", |
| | | "layers": [ |
| | | { |
| | | "label": "谷歌", |
| | |
| | | { |
| | | "name": "百度", |
| | | "tooltip": "百度", |
| | | "iconUrl": "images/basemaps/tiandituimage.png", |
| | | "iconUrl": "images/basemaps/baiduimage.png", |
| | | "layers": [ |
| | | { |
| | | "label": "百度", |
| | |
| | | { |
| | | "name": "高德", |
| | | "tooltip": "高德", |
| | | "iconUrl": "images/basemaps/tianditushiliang.png", |
| | | "iconUrl": "images/basemaps/gaod.jpg", |
| | | "layers": [ |
| | | { |
| | | "label": "高德", |
| | |
| | | { |
| | | "name": "腾讯", |
| | | "tooltip": "腾讯", |
| | | "iconUrl": "images/basemaps/tiandituimage.png", |
| | | "iconUrl": "images/basemaps/tenx.jpg", |
| | | "layers": [ |
| | | { |
| | | "label": "腾讯", |
| | |
| | | { |
| | | "name": "Gis", |
| | | "tooltip": "Gis", |
| | | "iconUrl": "images/basemaps/tianditushiliang.png", |
| | | "iconUrl": "images/basemaps/gis.jpg", |
| | | "layers": [ |
| | | { |
| | | "type": "gis" |
| | |
| | | { |
| | | "name": "mapbox", |
| | | "tooltip": "mapbox", |
| | | "iconUrl": "images/basemaps/tiandituimage.png", |
| | | "iconUrl": "images/basemaps/mapbox.jpg", |
| | | "layers": [ |
| | | { |
| | | "type": "mapbox" |
| | |
| | | // this.map.extend(Cesium.viewerDragDropMixin); |
| | | this.map.scene.globe.depthTestAgainstTerrain = false; |
| | | this.map.scene.logarithmicDepthBuffer = false; |
| | | this.map.scene.globe.baseColor = Cesium.Color.WHITESMOKE ; |
| | | this.map.scene.globe.baseColor = Cesium.Color.BLACK; |
| | | window.viewer = this.map; |
| | | window.dcViewer = dcViewer; |
| | | var imageryLayers = this.map.imageryLayers; |
| | |
| | | |
| | | |
| | | //设置离线地图默认显示 |
| | | this.map.baseLayerPicker.viewModel.selectedImagery = this.map.baseLayerPicker.viewModel.imageryProviderViewModels[1]; |
| | | this.map.baseLayerPicker.viewModel.selectedImagery = this.map.baseLayerPicker.viewModel.imageryProviderViewModels[2]; |
| | | this.map.baseLayerPicker.viewModel.selectedTerrain = this.map.baseLayerPicker.viewModel.terrainProviderViewModels[2]; |
| | | $(".cesium-baseLayerPicker-sectionTitle").eq(0).html("底图"); |
| | | $(".cesium-baseLayerPicker-sectionTitle").eq(1).html("地形"); |
| | |
| | | 'http://cache1.arcgisonline.cn/arcgis/rest/services/SimpleFeature/ChinaBoundaryLine/MapServer' |
| | | }) |
| | | } |
| | | |
| | | else if (layerConfig.type == "mapbox") { |
| | | layer = new Cesium.MapboxImageryProvider({ |
| | | mapId: 'mapbox.country-boundaries-v1', |
| New file |
| | |
| | | <div class="jimu-widget-CoorPosition"> |
| | | <div class="CoorPosition-zbdw" id="CoorPosition-zbdw"> |
| | | <span class="CoorPosition-zbdw-pic"></span> |
| | | <div class="CoorPosition-zbdw-zbdw">坐标定位</div> |
| | | <span class="CoorPosition-zbdw-x">x</span> |
| | | </div> |
| | | <div class="CoorPosition-input"> |
| | | <div class="CoorPosition-input-JD mouseenterJD"> |
| | | <div class="jingDu">经度<input id="jingdu-val" value="114.93" type="text" class="jingDu-input"></div> |
| | | <div class="jiantou jinddu"> |
| | | <span class="span-jiantou" id="jingdu-th"> |
| | | <img class="leftjiantou" src="./images/leftjiantou.png" alt=""> |
| | | </span> |
| | | <span class="span-jiantou twojiantou" id="jingdu-td"> |
| | | <img class="leftjiantou" src="./images/rightjiantou.png" alt=""> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | <div class="CoorPosition-input-JD mouseenterED"> |
| | | <div class="jingDu">纬度<input id="weidu-val" value="25.83" type="text" class="jingDu-input"></div> |
| | | <div class="jiantou weidu"> |
| | | <span class="span-jiantou" id="weidu-th"> |
| | | <img class="leftjiantou" src="./images/leftjiantou.png" alt=""> |
| | | </span> |
| | | <span class="span-jiantou twojiantou" id="weidu-td"> |
| | | <img class="leftjiantou" src="./images/rightjiantou.png" alt=""> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | <div class="CoorPosition-input-JD mouseenterGD"> |
| | | <div class="jingDu">高度<input id="gaodu-val" value="1286" type="text" class="jingDu-input"></div> |
| | | <div class="jiantou gaodu"> |
| | | <span class="span-jiantou" id="gaodu-th"> |
| | | <img class="leftjiantou" src="./images/leftjiantou.png" alt=""> |
| | | </span> |
| | | <span class="span-jiantou twojiantou" id="gaodu-td"> |
| | | <img class="leftjiantou" src="./images/rightjiantou.png" alt=""> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <button class="queDing">确定</button> |
| | | </div> |
| New file |
| | |
| | | define([ |
| | | 'dojo/_base/declare', |
| | | 'dojo/_base/lang', |
| | | 'dojo/_base/array', |
| | | 'dojo/_base/html', |
| | | 'dojo/topic', |
| | | 'jimu/BaseWidget', |
| | | ], |
| | | function (declare, |
| | | lang, |
| | | array, |
| | | html, |
| | | topic, |
| | | BaseWidget |
| | | ) { |
| | | return declare([BaseWidget], { |
| | | baseClass: 'jimu-widget-CoorPosition', |
| | | name: 'CoorPosition', |
| | | startup: function () { |
| | | var that = this; |
| | | // 点击x隐藏面板 |
| | | $('.CoorPosition-zbdw-x').click(function () { |
| | | $('.jimu-widget-CoorPosition').hide(); |
| | | }) |
| | | |
| | | // 鼠标移入显示箭头 |
| | | $('.mouseenterJD').mouseenter(function () { |
| | | $('.jiantou.jinddu').css('display', 'block'); |
| | | }) |
| | | $('.mouseenterJD').mouseleave(function () { |
| | | $('.jiantou.jinddu').css('display', 'none'); |
| | | }) |
| | | |
| | | $('.mouseenterED').mouseenter(function () { |
| | | $('.jiantou.weidu').css('display', 'block'); |
| | | }) |
| | | $('.mouseenterED').mouseleave(function () { |
| | | $('.jiantou.weidu').css('display', 'none'); |
| | | }) |
| | | |
| | | $('.mouseenterGD').mouseenter(function () { |
| | | $('.jiantou.gaodu').css('display', 'block'); |
| | | }) |
| | | $('.mouseenterGD').mouseleave(function () { |
| | | $('.jiantou.gaodu').css('display', 'none'); |
| | | }) |
| | | |
| | | // 点击箭头增加或减少数字 |
| | | $('#jingdu-th').click(function () { |
| | | $('#jingdu-val').val(parseInt($('#jingdu-val').val()) + 1); |
| | | }) |
| | | $('#jingdu-td').click(function () { |
| | | $('#jingdu-val').val(parseInt($('#jingdu-val').val()) - 1); |
| | | }) |
| | | |
| | | $('#weidu-th').click(function () { |
| | | $('#weidu-val').val(parseInt($('#weidu-val').val()) + 1); |
| | | }) |
| | | $('#weidu-td').click(function () { |
| | | $('#weidu-val').val(parseInt($('#weidu-val').val()) - 1); |
| | | }) |
| | | $('#gaodu-th').click(function () { |
| | | $('#gaodu-val').val(parseInt($('#gaodu-val').val()) + 1); |
| | | }) |
| | | $('#gaodu-td').click(function () { |
| | | $('#gaodu-val').val(parseInt($('#gaodu-val').val()) - 1); |
| | | }) |
| | | |
| | | // 拖拽盒子 |
| | | $('.CoorPosition-zbdw').mousedown(function (e) { |
| | | var positionDiv = $(this).offset(); |
| | | var distenceX = e.pageX - positionDiv.left; |
| | | var distenceY = e.pageY - positionDiv.top; |
| | | |
| | | $(document).mousemove(function (e) { |
| | | var x = e.pageX - distenceX; |
| | | var y = e.pageY - distenceY; |
| | | if (x < 0) { |
| | | x = 0; |
| | | } else if (x > $(document).width() - $('.CoorPosition-zbdw').outerWidth(true)) { |
| | | x = $(document).width() - $('.CoorPosition-zbdw').outerWidth(true); |
| | | } |
| | | if (y < 0) { |
| | | y = 0; |
| | | } else if (y > $(document).height() - $('.CoorPosition-zbdw').outerHeight(true)) { |
| | | y = $(document).height() - $('.jimu-widget-CoorPosition').outerHeight(true); |
| | | } |
| | | $('.jimu-widget-CoorPosition').css({ |
| | | 'left': x + 'px', |
| | | 'top': y + 'px' |
| | | }); |
| | | }); |
| | | $(document).mouseup(function () { |
| | | $(document).off('mousemove'); |
| | | }); |
| | | }); |
| | | |
| | | // 点击确定flyTo |
| | | $('.queDing').click(function () { |
| | | console.log($('#jingdu-val').val()); |
| | | var lng = $('#jingdu-val').val(); |
| | | var lat = $('#weidu-val').val(); |
| | | var gaodu = $('#gaodu-val').val(); |
| | | that.map.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(lng, lat, gaodu) |
| | | }); |
| | | }) |
| | | |
| | | }, |
| | | |
| | | onOpen: function () { |
| | | |
| | | }, |
| | | |
| | | onClose: function () { |
| | | //面板关闭的时候触发 (when this panel is closed trigger) |
| | | }, |
| | | |
| | | onMinimize: function () { |
| | | this.resize(); |
| | | }, |
| | | |
| | | onMaximize: function () { |
| | | this.resize(); |
| | | }, |
| | | |
| | | resize: function () { |
| | | |
| | | }, |
| | | |
| | | destroy: function () { |
| | | //销毁的时候触发 |
| | | //todo |
| | | //do something before this func |
| | | this.inherited(arguments); |
| | | } |
| | | |
| | | }); |
| | | }); |
| New file |
| | |
| | | .jimu-widget-CoorPosition{ |
| | | background-color: #36403d; |
| | | font-size: 14px; |
| | | border: 1px solid rgb(69, 154, 251); |
| | | color: rgb(238, 235, 235); |
| | | font-size: 16px; |
| | | width: 100%; |
| | | height: 100%; |
| | | border-radius: 10px; |
| | | display: none; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .CoorPosition-zbdw { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 33px; |
| | | border-bottom: 1px solid rgb(69, 154, 251); |
| | | padding: 0 25px; |
| | | cursor: move; |
| | | } |
| | | |
| | | .CoorPosition-zbdw-pic { |
| | | position: absolute; |
| | | left: 6px; |
| | | top: 9px; |
| | | width: 15px; |
| | | height: 13px; |
| | | background: url(../../../images/toolbox.png ) no-repeat 0 -32px; |
| | | } |
| | | |
| | | .CoorPosition-zbdw-zbdw { |
| | | width: 100%; |
| | | line-height: 33px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .CoorPosition-zbdw-x { |
| | | position: absolute; |
| | | right: 6px; |
| | | top: 5px; |
| | | width: 10px; |
| | | font-size: 18px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .CoorPosition-input { |
| | | width: 100%; |
| | | /* background-color: blue; */ |
| | | padding: 8px 5px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .CoorPosition-input-JD { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 28px; |
| | | background-color: #3a464c; |
| | | margin-bottom: 3px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .jingDu { |
| | | line-height: 28px; |
| | | } |
| | | |
| | | .jingDu-input { |
| | | display: inline-block; |
| | | background-color: #3a464c; |
| | | border: none; |
| | | text-indent: 2em; |
| | | caret-color:#fff; |
| | | color: #fff; |
| | | } |
| | | |
| | | .queDing { |
| | | background-color: #244959; |
| | | border: none; |
| | | color: #fff; |
| | | margin-left: 160px; |
| | | padding: 5px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .jiantou { |
| | | position: absolute; |
| | | top: 4px; |
| | | right: 15px; |
| | | width: 15px; |
| | | height: 20px; |
| | | background-color: #fff; |
| | | z-index: 999; |
| | | display: none; |
| | | } |
| | | |
| | | .span-jiantou { |
| | | position: absolute; |
| | | top: -3px; |
| | | right: 14px; |
| | | width: 19px; |
| | | height: 19px; |
| | | color: #666; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .twojiantou { |
| | | top: 5px; |
| | | } |
| | | |
| | | .leftjiantou { |
| | | position: absolute; |
| | | right: -16px; |
| | | width: 19px; |
| | | height: 19px; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | { |
| | | "name": "CoorPosition", |
| | | "2D": true, |
| | | "3D": true, |
| | | "platform": "HTML", |
| | | "version": "2.10", |
| | | "wabVersion": "2.10", |
| | | "author": "jxdnosng", |
| | | "description": "", |
| | | "copyright": "", |
| | | "license": "", |
| | | "properties": { |
| | | "hasConfig": false, |
| | | "inPanel": false, |
| | | "hasVersionManager": false |
| | | } |
| | | } |
| New file |
| | |
| | | define( |
| | | ({ |
| | | _widgetLabel: "goCoorPosition" |
| | | }) |
| | | ); |
| New file |
| | |
| | | define({ |
| | | root: ({ |
| | | _widgetLabel: "CoorPosition" |
| | | }), |
| | | "es": 1, |
| | | "zh-cn": 1 |
| | | }); |
| New file |
| | |
| | | define( |
| | | ({ |
| | | _widgetLabel: "坐标定位" |
| | | }) |
| | | ); |
| | |
| | | define( |
| | | ({ |
| | | _widgetLabel: "地图打印" |
| | | _widgetLabel: "场景快照" |
| | | }) |
| | | ); |
| | |
| | | .jimu-widget-Plot{ |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: #0395f3; |
| | | background-color:black; |
| | | font-size: 14px; |
| | | border: 1px solid rgb(69, 154, 251); |
| | | border: 1px solid rgb(22, 33, 46); |
| | | color: rgb(238, 235, 235); |
| | | font-size: 16px; |
| | | display: none; |
| | |
| | | .jimu-widget-Plot .plot-box ul li button { |
| | | width: 60px; |
| | | height: 30px; |
| | | background-color: rgba(32, 160, 255, .2); |
| | | background-color: rgba(22, 25, 27, 0.2); |
| | | border: 1px solid #fff; |
| | | color: #fff; |
| | | cursor: pointer; |
| | |
| | | <div class="hezi-right-select"> |
| | | <span class="hezi-rightspan">右侧图层 :</span> |
| | | <select class="hezi-select" id="hezi-selectRight"> |
| | | <option class="optionVal3" value="1">天地图矢量</option> |
| | | <option class="optionVal3" value="3">天地图矢量</option> |
| | | <option class="optionVal4" value="2">天地图影像</option> |
| | | </select> |
| | | </div> |
| | |
| | | var layers = viewer.imageryLayers; |
| | | //addImageryProvider使用给定的ImageryProvider创建一个新层,并将其添加到集合中 UrlTemplateImageryProvider |
| | | that.ganZhouYinLeft = layers.addImageryProvider(new DC.ImageryLayerFactory.createXYZImageryLayer( |
| | | that.imageryProviderArrUrl[0] |
| | | that.imageryProviderAdd[0] |
| | | )); |
| | | } |
| | | |
| New file |
| | |
| | | <div class="route"> |
| | | <div class="route-title"> |
| | | <span class="pic"></span> |
| | | <div class="luxian">路线导航</div> |
| | | <span class="x">x</span> |
| | | </div> |
| | | <div class="route-sign"> |
| | | <div class="qiDianBox"> |
| | | <div class="qiDian">起点:</div> |
| | | <input type="text" class="input" id="qidianInput"> |
| | | <div id="xuanDian1"> |
| | | <img src="./images/qidian.png" alt=""> |
| | | </div> |
| | | </div> |
| | | <div class="zhongDianBox qiDianBox"> |
| | | <div class="qiDian">终点:</div> |
| | | <input class="input" type="text" id="zhongdianInput"> |
| | | <div id="xuanDian2"> |
| | | <img src="./images/zhongdian.png" alt=""> |
| | | </div> |
| | | </div> |
| | | <!-- 清空搜索按钮 --> |
| | | <div class="route-search"> |
| | | <button class="route-searchSearch">搜索</button> |
| | | <button class="route-searchClear">清空</button> |
| | | </div> |
| | | <div class="hengxian"></div> |
| | | </div> |
| | | <!-- 线路title --> |
| | | <div class="route-fangan"> |
| | | <div class="route-faTitle"> |
| | | <span class="route-zk">最快线路</span> |
| | | <span class="route-zd">最短线路</span> |
| | | <span class="route-gs">少走高速</span> |
| | | </div> |
| | | <!-- 面变1 --> |
| | | <div class="route-list route-list1"> |
| | | <!-- <div class="route-zlc"> |
| | | <span>总里程: 约1公里</span> |
| | | </div> --> |
| | | <!-- <div class="route-xsqb"> |
| | | <input class="input" type="checkbox" checked> |
| | | <span>显示全部详情</span> |
| | | </div> --> |
| | | <!-- <div class="route-lujin"> |
| | | <div class="lujin-div"> |
| | | <div class="one">2.从胡二面开始从胡二面开始</div> |
| | | <div class="two">1).从胡二面开始从胡二面开始</div> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <!-- 面变2 --> |
| | | <div class="route-list route-list2"> |
| | | <div class="route-zlc"> |
| | | <span>总里程: 约2公里</span> |
| | | </div> |
| | | <div class="route-xsqb"> |
| | | <input class="input" type="checkbox" checked> |
| | | <span>显示全部详情</span> |
| | | </div> |
| | | <div class="route-lujin"> |
| | | <div class="lujin-div"> |
| | | <div class="one">1.从胡二面开始从胡二面开始</div> |
| | | <div class="two">1).从胡二面开始从胡二面开始</div> |
| | | </div> |
| | | </div> |
| | | <div class="route-lujin"> |
| | | <div class="lujin-div"> |
| | | <div class="one">2.从胡二面开始从胡二面开始</div> |
| | | <div class="two">1).从胡二面开始从胡二面开始</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 面变3 --> |
| | | <div class="route-list route-list3"> |
| | | <div class="route-zlc"> |
| | | <span>总里程: 约3公里</span> |
| | | </div> |
| | | <div class="route-xsqb"> |
| | | <input class="input" type="checkbox" checked> |
| | | <span>显示全部详情</span> |
| | | </div> |
| | | <div class="route-lujin"> |
| | | <div class="lujin-div"> |
| | | <div class="one">1.从胡二面开始从胡二面开始</div> |
| | | <div class="two">1).从胡二面开始从胡二面开始</div> |
| | | </div> |
| | | </div> |
| | | <div class="route-lujin"> |
| | | <div class="lujin-div"> |
| | | <div class="one">2.从胡二面开始从胡二面开始</div> |
| | | <div class="two">1).从胡二面开始从胡二面开始</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="danji">单击完成绘制</div> |
| | | </div> |
| New file |
| | |
| | | define(['dojo/_base/declare', 'dojo/_base/lang', 'dojo/_base/array', 'dojo/_base/html', 'dojo/topic', 'jimu/BaseWidget', 'libs/layer/layer.js'], function (declare, lang, array, html, topic, BaseWidget, layer) { |
| | | return declare([BaseWidget], { |
| | | baseClass: 'jimu-widget-RouteNavigate', |
| | | name: 'RouteNavigate', |
| | | // 起点坐标变量 |
| | | cartesian: '', |
| | | // 终点坐标变量 |
| | | cartesian1: '', |
| | | |
| | | pic: 'qidian', |
| | | pic1: 'zhongdian', |
| | | |
| | | // 起点实体id |
| | | num: 1, |
| | | // 终点实体id |
| | | num1: 2, |
| | | |
| | | // 最快线路id |
| | | zknum: 3, |
| | | // 最短线路id |
| | | zdnum: 3, |
| | | // 少走高速线路id |
| | | gsnum: 3, |
| | | |
| | | // 起点坐标数组 |
| | | cartesianArr: [], |
| | | // 终点坐标数组 |
| | | cartesianArr1: [], |
| | | |
| | | // 起点实体对象 |
| | | updateadd: {}, |
| | | // 终点实体对象 |
| | | updateadd1: {}, |
| | | |
| | | // 起点经度 |
| | | lng: '', |
| | | // 终点经度 |
| | | lng1: '', |
| | | // 起点纬度 |
| | | lat: '', |
| | | // 终点纬度 |
| | | lat1: '', |
| | | |
| | | // 线路1全长 |
| | | itemQc: '', |
| | | // 线路2全长 |
| | | itemQc1: '', |
| | | // 线路3全长 |
| | | itemQc2: '', |
| | | |
| | | // 线路1坐标 |
| | | itemZb: '', |
| | | // 线路2坐标 |
| | | itemZb1: '', |
| | | // 线路3坐标 |
| | | itemZb2: '', |
| | | |
| | | // 线路1坐标切割成字符串 |
| | | itemZbStr: '', |
| | | // 线路2坐标切割成字符串 |
| | | itemZbStr1: '', |
| | | // 线路3坐标切割成字符串 |
| | | itemZbStr2: '', |
| | | |
| | | // 线路1坐标数组split |
| | | itemZbArr: [], |
| | | // 线路2坐标数组split |
| | | itemZbArr1: [], |
| | | // 线路3坐标数组split |
| | | itemZbArr2: [], |
| | | |
| | | // style路线id |
| | | postStr: {}, |
| | | |
| | | // 线段xianDuanArr数组 |
| | | xianDuanArr: [], |
| | | |
| | | // 方案线路1详情 |
| | | itemXld: '', |
| | | // 方案线路2详情 |
| | | itemXld1: '', |
| | | // 方案线路3详情 |
| | | itemXld2: '', |
| | | |
| | | // 方案线路1详情数组 |
| | | itemXldArr: [], |
| | | // 方案线路2详情数组 |
| | | itemXldArr1: [], |
| | | // 方案线路3详情数组 |
| | | itemXldArr2: [], |
| | | |
| | | // 线路段1坐标 |
| | | streetLatLon: '', |
| | | // 线路段2坐标 |
| | | streetLatLon1: '', |
| | | // 线路段3坐标 |
| | | streetLatLon2: '', |
| | | |
| | | // 方案1线路段高亮ID |
| | | streetLatLonId: 500, |
| | | // 方案2线路段高亮ID |
| | | streetLatLonId1: 600, |
| | | // 方案3线路段高亮ID |
| | | streetLatLonId2: 700, |
| | | |
| | | // 方案1线路段高亮ID数组 |
| | | streetLatLonIdArr: [], |
| | | // 方案2线路段高亮ID数组 |
| | | streetLatLonIdArr1: [], |
| | | // 方案3线路段高亮ID数组 |
| | | streetLatLonIdArr2: [], |
| | | |
| | | // 线路段1坐标数组 |
| | | streetLatLonArr: [], |
| | | // 线路段2坐标数组 |
| | | streetLatLonArr1: [], |
| | | // 线路段3坐标数组 |
| | | streetLatLonArr2: [], |
| | | |
| | | // 方案1坐标处理成字符串 |
| | | streetLatLonArrStr: '', |
| | | // 方案2坐标处理成字符串 |
| | | streetLatLonArrStr1: '', |
| | | // 方案3坐标处理成字符串 |
| | | streetLatLonArrStr2: '', |
| | | |
| | | // xianDuan1实参数组 |
| | | xldArr1: [], |
| | | |
| | | // 线路一转折点经纬度数组 |
| | | turnlatlonArr: [], |
| | | // 线路二转折点经纬度数组 |
| | | turnlatlonArr1: [], |
| | | // 线路三转折点经纬度数组 |
| | | turnlatlonArr2: [], |
| | | |
| | | // 线路一适宜中心经纬度 |
| | | center: '', |
| | | center1: '', |
| | | center2: '', |
| | | // 线路一适宜中心经纬度数组 |
| | | centerArr: [], |
| | | centerArr1: [], |
| | | centerArr2: [], |
| | | |
| | | // 起点回车键实体ID |
| | | qdNum: -1, |
| | | qdNum1: -2, |
| | | |
| | | // 起点回车实体坐标 |
| | | qdText: '', |
| | | qdText1: '', |
| | | |
| | | // 起点回车实体坐标数组 |
| | | qdTextArr: [], |
| | | qdTextArr1: [], |
| | | |
| | | // 起点回车实体坐标对象 接收 经纬度转成世界坐标 |
| | | qdCar: {}, |
| | | qdCar1: {}, |
| | | |
| | | // 起点回车键坐标数组 |
| | | qdCarArr: [], |
| | | qdCarArr1: [], |
| | | |
| | | // 线路一缩放比例 |
| | | scale: '', |
| | | |
| | | // 线路段高亮height数组 |
| | | heightArr: [], |
| | | heightArr1: [], |
| | | heightArr2: [], |
| | | |
| | | // 线路段高亮坐标数组 |
| | | centerArrGl: [], |
| | | centerArrGl1: [], |
| | | centerArrGl2: [], |
| | | |
| | | // 当前镜头 |
| | | cameraPosArr: [], |
| | | |
| | | // 当前heightJT |
| | | heightJTArr: [], |
| | | |
| | | startup: function startup() { |
| | | var that = this; |
| | | var scene = that.map.scene; |
| | | |
| | | // 点击搜索改变样式 |
| | | $('.route-searchSearch').mousedown(function () { |
| | | $(this).css('backgroundColor', '#36403d'); |
| | | }); |
| | | $('.route-searchSearch').on('mouseup', function () { |
| | | $(this).css('backgroundColor', 'rgb(69, 154, 251)'); |
| | | }); |
| | | |
| | | $('.route-searchClear').mousedown(function () { |
| | | $(this).css('backgroundColor', '#36403d'); |
| | | }); |
| | | $('.route-searchClear').on('mouseup', function () { |
| | | $(this).css('backgroundColor', 'rgb(69, 154, 251)'); |
| | | }); |
| | | |
| | | // 点击搜索按钮提示 |
| | | $('.route-searchSearch').on('click', function () { |
| | | if ($('#qidianInput').val() == '' || $('#zhongdianInput').val() == '') { |
| | | layer.msg('起点或终点没有值,请输入', { |
| | | time: 2000 |
| | | }); |
| | | } |
| | | // 起点跟终点有值触触发最快线路 |
| | | if ($('#qidianInput').val() != '' && $('#zhongdianInput').val() != '') { |
| | | $('.route-zk').trigger("click"); |
| | | } |
| | | }); |
| | | |
| | | // 点击清空按钮清空全部是数据 |
| | | $('.route-searchClear').on('click', function () { |
| | | clear(); |
| | | }); |
| | | |
| | | // 最快线路 |
| | | $('.route-zk').on('click', function () { |
| | | // 线路一适宜中心经纬度 |
| | | that.center = ''; |
| | | // 线路一适宜中心经纬度数组 |
| | | that.centerArr = []; |
| | | |
| | | // 清楚线路段实体 |
| | | if (that.streetLatLonIdArr.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr[0]); |
| | | } |
| | | if (that.streetLatLonIdArr1.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr1[0]); |
| | | } |
| | | if (that.streetLatLonIdArr2.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr2[0]); |
| | | } |
| | | |
| | | // 清除最短线路实体 |
| | | that.map.entities.removeById(that.zdnum); |
| | | that.map.entities.removeById(that.gsnum); |
| | | that.map.entities.removeById(that.zknum); |
| | | // 每次点击之前把html清空 |
| | | $('.route-list1').html(''); |
| | | // 把数据也清空 |
| | | that.itemQc = ''; |
| | | that.itemXldArr = []; |
| | | |
| | | $(this).addClass('routehover'); |
| | | $('.route-zd').removeClass('routehover'); |
| | | $('.route-gs').removeClass('routehover'); |
| | | |
| | | // 面板出现 |
| | | $('.route-list1').show(); |
| | | $('.route-list2').hide(); |
| | | $('.route-list3').hide(); |
| | | |
| | | // 调用ajax |
| | | if ($('#qidianInput').val() != '' && $('#zhongdianInput').val() != '') { |
| | | ajax1(); |
| | | // 中心坐标字符串转成数组 |
| | | that.centerArr = that.center.split(','); |
| | | |
| | | // 获取当前镜头位置的笛卡尔坐标 |
| | | var cameraPos = that.map.camera.position; |
| | | that.cameraPosArr.push(cameraPos); |
| | | |
| | | // 获取当前坐标系标准 |
| | | var ellipsoid = that.map.scene.globe.ellipsoid; |
| | | |
| | | // 根据坐标系标准,将笛卡尔坐标转换为地理坐标 |
| | | var cartographic = ellipsoid.cartesianToCartographic(cameraPos); |
| | | |
| | | // 获取镜头的高度 |
| | | var height = cartographic.height / 1.8; |
| | | that.heightJTArr.push(height); |
| | | |
| | | that.heightArr.push(height); |
| | | |
| | | // 将线路一适宜中心经纬度数组push到数组.给下次做判断 |
| | | that.centerArrGl.push(that.centerArr[0]); |
| | | |
| | | var heightWY = ''; |
| | | if (that.centerArr[0] == that.centerArrGl[0]) { |
| | | heightWY = that.heightArr[0]; |
| | | } else { |
| | | heightWY = height; |
| | | } |
| | | |
| | | // 相机跟随 |
| | | that.map.camera.setView({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(that.centerArr[0]), Number(that.centerArr[1]), heightWY) |
| | | }); |
| | | |
| | | $('.route-list1').append('\n <div class="route-zlc">\n <span>\u603B\u91CC\u7A0B: \u7EA6' + that.itemQc + '\u516C\u91CC</span>\n </div>\n '); |
| | | for (var i = 0; i < that.itemXldArr.length; i++) { |
| | | that.itemXldArr[i] = i + 1 + '.' + that.itemXldArr[i]; |
| | | $('.route-list1').append('\n <div class="route-lujin">\n <div class="lujin-div">\n <div class="one">' + that.itemXldArr[i] + '</div>\n </div>\n </div>\n '); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 点击最快线路段详情高亮 |
| | | $('.route-list1').on('click', '.route-lujin', function () { |
| | | // 删除其它 线路段 实体 |
| | | if (that.streetLatLonIdArr1.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr1[0]); |
| | | } |
| | | if (that.streetLatLonIdArr2.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr2[0]); |
| | | } |
| | | |
| | | // 当前this下标 |
| | | var index = $(this).index() - 1; |
| | | |
| | | // 当前时间ID |
| | | that.streetLatLonId += new Date().getTime(); |
| | | |
| | | // 坐标处理 |
| | | that.streetLatLonArrStr = that.streetLatLonArr[index].replace(/;/g, ','); |
| | | that.streetLatLonArrStr = that.streetLatLonArrStr.split(','); |
| | | |
| | | // 对坐标取半 |
| | | var arrta = []; |
| | | for (var i = 0; i < that.streetLatLonArrStr.length - 1; i += 2) { |
| | | arrta.push([that.streetLatLonArrStr[i], that.streetLatLonArrStr[i + 1]]); |
| | | } |
| | | var ind = parseInt(arrta.length / 2); |
| | | |
| | | // 绘制线段之前把之前的线段清空 |
| | | if (that.streetLatLonIdArr.length != 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr[0]); |
| | | that.streetLatLonIdArr = []; |
| | | // 定位过去 |
| | | that.map.camera.setView({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(arrta[ind][0]), Number(arrta[ind][1]), 60000) |
| | | }); |
| | | // 绘制线段 |
| | | xianDuan1(that.streetLatLonArrStr, that.streetLatLonId); |
| | | // 把当前时间ID push到数组 |
| | | that.streetLatLonIdArr.push(that.streetLatLonId); |
| | | } else { |
| | | // 定位过去 |
| | | that.map.camera.setView({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(arrta[ind][0]), Number(arrta[ind][1]), 60000) |
| | | }); |
| | | // 绘制线段 |
| | | xianDuan1(that.streetLatLonArrStr, that.streetLatLonId); |
| | | // 把当前时间ID push到数组 |
| | | that.streetLatLonIdArr.push(that.streetLatLonId); |
| | | } |
| | | }); |
| | | |
| | | // 点击最短线路段详情高亮 |
| | | $('.route-list2').on('click', '.route-lujin', function () { |
| | | // 删除其它 线路段 实体 |
| | | if (that.streetLatLonIdArr.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr[0]); |
| | | } |
| | | if (that.streetLatLonIdArr2.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr2[0]); |
| | | } |
| | | |
| | | // 当前this下标 |
| | | var index = $(this).index() - 1; |
| | | |
| | | // 当前时间ID |
| | | that.streetLatLonId1 += new Date().getTime(); |
| | | |
| | | // 坐标处理 |
| | | that.streetLatLonArrStr1 = that.streetLatLonArr1[index].replace(/;/g, ','); |
| | | that.streetLatLonArrStr1 = that.streetLatLonArrStr1.split(','); |
| | | |
| | | // 对坐标取半 |
| | | var arrta = []; |
| | | for (var i = 0; i < that.streetLatLonArrStr1.length - 1; i += 2) { |
| | | arrta.push([that.streetLatLonArrStr1[i], that.streetLatLonArrStr1[i + 1]]); |
| | | } |
| | | var ind = parseInt(arrta.length / 2); |
| | | |
| | | // 绘制线段之前把之前的线段清空 |
| | | if (that.streetLatLonIdArr1.length != 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr1[0]); |
| | | that.streetLatLonIdArr1 = []; |
| | | // 定位过去 |
| | | that.map.camera.setView({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(arrta[ind][0]), Number(arrta[ind][1]), 60000) |
| | | }); |
| | | // 绘制线段 |
| | | xianDuan1(that.streetLatLonArrStr1, that.streetLatLonId1); |
| | | // 把当前时间ID push到数组 |
| | | that.streetLatLonIdArr1.push(that.streetLatLonId1); |
| | | } else { |
| | | // 定位过去 |
| | | that.map.camera.setView({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(arrta[ind][0]), Number(arrta[ind][1]), 60000) |
| | | }); |
| | | // 绘制线段 |
| | | xianDuan1(that.streetLatLonArrStr1, that.streetLatLonId1); |
| | | // 把当前时间ID push到数组 |
| | | that.streetLatLonIdArr1.push(that.streetLatLonId1); |
| | | } |
| | | }); |
| | | |
| | | // 点击少走高速段详情高亮 |
| | | $('.route-list3').on('click', '.route-lujin', function () { |
| | | // 删除其它 线路段 实体 |
| | | if (that.streetLatLonIdArr1.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr1[0]); |
| | | } |
| | | if (that.streetLatLonIdArr.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr[0]); |
| | | } |
| | | |
| | | // 当前this下标 |
| | | var index = $(this).index() - 1; |
| | | |
| | | // 当前时间ID |
| | | that.streetLatLonId2 += new Date().getTime(); |
| | | |
| | | // 坐标处理 |
| | | that.streetLatLonArrStr2 = that.streetLatLonArr2[index].replace(/;/g, ','); |
| | | that.streetLatLonArrStr2 = that.streetLatLonArrStr2.split(','); |
| | | |
| | | // 对坐标取半 |
| | | var arrta = []; |
| | | for (var i = 0; i < that.streetLatLonArrStr2.length - 1; i += 2) { |
| | | arrta.push([that.streetLatLonArrStr2[i], that.streetLatLonArrStr2[i + 1]]); |
| | | } |
| | | var ind = parseInt(arrta.length / 2); |
| | | |
| | | // 绘制线段之前把之前的线段清空 |
| | | if (that.streetLatLonIdArr2.length != 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr2[0]); |
| | | that.streetLatLonIdArr2 = []; |
| | | // 相机跟随视角 |
| | | that.map.camera.setView({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(arrta[ind][0]), Number(arrta[ind][1]), 60000) |
| | | }); |
| | | // 绘制线段 |
| | | xianDuan1(that.streetLatLonArrStr2, that.streetLatLonId2); |
| | | // 把当前时间ID push到数组 |
| | | that.streetLatLonIdArr2.push(that.streetLatLonId2); |
| | | } else { |
| | | // 相机跟随视角 |
| | | that.map.camera.setView({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(arrta[ind][0]), Number(arrta[ind][1]), 60000) |
| | | }); |
| | | // 绘制线段 |
| | | xianDuan1(that.streetLatLonArrStr2, that.streetLatLonId2); |
| | | // 把当前时间ID push到数组 |
| | | that.streetLatLonIdArr2.push(that.streetLatLonId2); |
| | | } |
| | | }); |
| | | |
| | | // 最短线路 |
| | | $('.route-zd').on('click', function () { |
| | | // 线路一适宜中心经纬度 |
| | | that.center1 = ''; |
| | | // 线路一适宜中心经纬度数组 |
| | | that.centerArr1 = []; |
| | | |
| | | // 清楚线路段实体 |
| | | if (that.streetLatLonIdArr.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr[0]); |
| | | } |
| | | if (that.streetLatLonIdArr1.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr1[0]); |
| | | } |
| | | if (that.streetLatLonIdArr2.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr2[0]); |
| | | } |
| | | |
| | | // 清楚最快线路实体 |
| | | that.map.entities.removeById(that.zknum); |
| | | that.map.entities.removeById(that.gsnum); |
| | | that.map.entities.removeById(that.zdnum); |
| | | // 每次点击之前把html清空 |
| | | $('.route-list2').html(''); |
| | | // 把数据也清空 |
| | | that.itemQc1 = ''; |
| | | that.itemXldArr1 = []; |
| | | |
| | | $('.route-zk').removeClass('routehover'); |
| | | $(this).addClass('routehover'); |
| | | $('.route-gs').removeClass('routehover'); |
| | | |
| | | // 面板出现 |
| | | $('.route-list1').hide(); |
| | | $('.route-list2').show(); |
| | | $('.route-list3').hide(); |
| | | |
| | | // 调用ajax |
| | | if ($('#qidianInput').val() != '' && $('#zhongdianInput').val() != '') { |
| | | ajax2(); |
| | | // 中心坐标字符串转成数组 |
| | | that.centerArr1 = that.center1.split(','); |
| | | |
| | | // 获取当前镜头位置的笛卡尔坐标 |
| | | // that.cameraPos = that.map.camera.position; |
| | | |
| | | // 获取当前坐标系标准 |
| | | var ellipsoid = that.map.scene.globe.ellipsoid; |
| | | |
| | | // 根据坐标系标准,将笛卡尔坐标转换为地理坐标 |
| | | var cartographic = ellipsoid.cartesianToCartographic(that.cameraPosArr[0]); |
| | | |
| | | // 获取镜头的高度 |
| | | var height = cartographic.height / 1.8; |
| | | |
| | | that.heightArr1.push(that.heightJTArr[0]); |
| | | |
| | | // 将线路一适宜中心经纬度数组push到数组.给下次做判断 |
| | | that.centerArrGl1.push(that.centerArr1[0]); |
| | | |
| | | var heightWY = ''; |
| | | if (that.centerArr1[0] == that.centerArrGl1[0]) { |
| | | heightWY = that.heightArr1[0]; |
| | | } else { |
| | | heightWY = that.heightJTArr[0]; |
| | | } |
| | | |
| | | // 相机跟随 |
| | | that.map.camera.setView({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(that.centerArr1[0]), Number(that.centerArr1[1]), heightWY) |
| | | }); |
| | | |
| | | $('.route-list2').append('\n <div class="route-zlc">\n <span>\u603B\u91CC\u7A0B: \u7EA6' + that.itemQc1 + '\u516C\u91CC</span>\n </div>\n '); |
| | | for (var i = 0; i < that.itemXldArr1.length; i++) { |
| | | that.itemXldArr1[i] = i + 1 + '.' + that.itemXldArr1[i]; |
| | | $('.route-list2').append('\n <div class="route-lujin">\n <div class="lujin-div">\n <div class="one">' + that.itemXldArr1[i] + '</div>\n </div>\n </div>\n '); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 少走高速 |
| | | $('.route-gs').on('click', function () { |
| | | // 线路一适宜中心经纬度 |
| | | that.center2 = ''; |
| | | // 线路一适宜中心经纬度数组 |
| | | that.centerArr2 = []; |
| | | |
| | | // 清楚线路段实体 |
| | | if (that.streetLatLonIdArr.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr[0]); |
| | | } |
| | | if (that.streetLatLonIdArr1.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr1[0]); |
| | | } |
| | | if (that.streetLatLonIdArr2.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr2[0]); |
| | | } |
| | | |
| | | // 清楚最快线路实体 |
| | | that.map.entities.removeById(that.zknum); |
| | | that.map.entities.removeById(that.zdnum); |
| | | that.map.entities.removeById(that.gsnum); |
| | | // 每次点击之前把html清空 |
| | | $('.route-list3').html(''); |
| | | // 把数据也清空 |
| | | that.itemQc2 = ''; |
| | | that.itemXldArr2 = []; |
| | | |
| | | $('.route-zk').removeClass('routehover'); |
| | | $(this).addClass('routehover'); |
| | | $('.route-zd').removeClass('routehover'); |
| | | |
| | | // 面板出现 |
| | | $('.route-list1').hide(); |
| | | $('.route-list2').hide(); |
| | | $('.route-list3').show(); |
| | | |
| | | // 调用ajax |
| | | if ($('#qidianInput').val() != '' && $('#zhongdianInput').val() != '') { |
| | | ajax3(); |
| | | // 中心坐标字符串转成数组 |
| | | that.centerArr2 = that.center2.split(','); |
| | | |
| | | // 获取当前镜头位置的笛卡尔坐标 |
| | | // var cameraPos = that.map.camera.position; |
| | | |
| | | // 获取当前坐标系标准 |
| | | var ellipsoid = that.map.scene.globe.ellipsoid; |
| | | |
| | | // 根据坐标系标准,将笛卡尔坐标转换为地理坐标 |
| | | var cartographic = ellipsoid.cartesianToCartographic(that.cameraPosArr[0]); |
| | | |
| | | // 获取镜头的高度 |
| | | var height = cartographic.height / 1.8; |
| | | |
| | | that.heightArr2.push(that.heightJTArr[0]); |
| | | |
| | | // 将线路一适宜中心经纬度数组push到数组.给下次做判断 |
| | | that.centerArrGl2.push(that.centerArr2[0]); |
| | | |
| | | var heightWY = ''; |
| | | if (that.centerArr2[0] == that.centerArrGl2[0]) { |
| | | heightWY = that.heightArr2[0]; |
| | | } else { |
| | | heightWY = that.heightJTArr[0]; |
| | | } |
| | | |
| | | // 相机跟随 |
| | | that.map.camera.setView({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(that.centerArr2[0]), Number(that.centerArr2[1]), heightWY) |
| | | }); |
| | | |
| | | $('.route-list3').append('\n <div class="route-zlc">\n <span>\u603B\u91CC\u7A0B: \u7EA6' + that.itemQc2 + '\u516C\u91CC</span>\n </div>\n '); |
| | | for (var i = 0; i < that.itemXldArr2.length; i++) { |
| | | that.itemXldArr2[i] = i + 1 + '.' + that.itemXldArr2[i]; |
| | | $('.route-list3').append('\n <div class="route-lujin">\n <div class="lujin-div">\n <div class="one">' + that.itemXldArr2[i] + '</div>\n </div>\n </div>\n '); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 点击面板x关闭面板 |
| | | $('.route-title .x').on('click', function () { |
| | | $('.route').hide(); |
| | | clear(); |
| | | }); |
| | | |
| | | // 封装清空全部数据 |
| | | function clear() { |
| | | // 当前镜头 |
| | | that.cameraPosArr = []; |
| | | that.heightJTArr = []; |
| | | |
| | | // 线路段高亮height数组 |
| | | that.heightArr = []; |
| | | that.heightArr1 = []; |
| | | that.heightArr2 = []; |
| | | // 线路段高亮坐标数组 |
| | | that.centerArrGl = []; |
| | | that.centerArrGl1 = []; |
| | | that.centerArrGl2 = []; |
| | | |
| | | // 起点回车键数据 |
| | | that.qdText = ''; |
| | | that.qdTextArr = []; |
| | | that.qdCar = {}; |
| | | that.qdCarArr = []; |
| | | that.map.entities.removeById(that.qdNum); |
| | | // 终点回车键数据 |
| | | that.qdText1 = ''; |
| | | that.qdTextArr1 = []; |
| | | that.qdCar1 = {}; |
| | | that.qdCarArr1 = []; |
| | | that.map.entities.removeById(that.qdNum1); |
| | | |
| | | // 相机回复到原始经纬度 |
| | | that.map.camera.setView({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(115.297150), Number(25.742296), 800000) |
| | | }); |
| | | |
| | | // 线路一适宜中心经纬度 |
| | | that.center = ''; |
| | | that.center1 = ''; |
| | | that.center2 = ''; |
| | | // 线路一适宜中心经纬度数组 |
| | | that.centerArr = []; |
| | | that.centerArr1 = []; |
| | | that.centerArr2 = []; |
| | | |
| | | // 线路一转折点经纬度数组 |
| | | that.turnlatlonArr = []; |
| | | that.turnlatlonArr1 = []; |
| | | that.turnlatlonArr2 = []; |
| | | |
| | | // xianDuan1实参数组 |
| | | that.xldArr1 = []; |
| | | // 线段xianDuanArr数组 |
| | | that.xianDuanArr = []; |
| | | |
| | | // style路线id |
| | | that.postStr = {}; |
| | | |
| | | // 线路1坐标数组split |
| | | that.itemZbArr = []; |
| | | that.itemZbArr1 = []; |
| | | that.itemZbArr2 = []; |
| | | |
| | | // 起点实体对象 |
| | | that.updateadd = {}; |
| | | that.updateadd1 = {}; |
| | | |
| | | // 方案1线路段高亮ID数组 |
| | | if (that.streetLatLonIdArr.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr[0]); |
| | | } |
| | | if (that.streetLatLonIdArr1.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr1[0]); |
| | | } |
| | | if (that.streetLatLonIdArr2.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr2[0]); |
| | | } |
| | | |
| | | // 清空线路段实体 |
| | | that.map.entities.removeById(that.streetLatLonIdArr); |
| | | |
| | | // 每次点击之前把html清空 |
| | | $('.route-list1').html(''); |
| | | $('.route-list2').html(''); |
| | | $('.route-list3').html(''); |
| | | // 把数据也清空 |
| | | that.itemQc = ''; |
| | | |
| | | // 方案线路1详情数组 |
| | | that.itemXldArr = []; |
| | | |
| | | // 线路段1坐标数组 |
| | | that.streetLatLonArr = []; |
| | | that.streetLatLonArr1 = []; |
| | | that.streetLatLonArr2 = []; |
| | | |
| | | that.itemQc1 = ''; |
| | | // 方案线路2详情数组 |
| | | that.itemXldArr1 = []; |
| | | |
| | | that.itemQc2 = ''; |
| | | // 方案线路3详情数组 |
| | | that.itemXldArr2 = []; |
| | | that.itemIDArr2 = []; |
| | | |
| | | // 清空样式 |
| | | $('.route-zd').removeClass('routehover'); |
| | | $('.route-gs').removeClass('routehover'); |
| | | $('.route-zk').removeClass('routehover'); |
| | | |
| | | // 起点坐标 |
| | | that.cartesianArr = []; |
| | | // 终点坐标 |
| | | that.cartesianArr1 = []; |
| | | |
| | | // 清空起点跟终点图标 |
| | | that.map.entities.removeById(that.num); |
| | | that.map.entities.removeById(that.num1); |
| | | // 清楚线路实体 |
| | | that.map.entities.removeById(that.zknum); |
| | | that.map.entities.removeById(that.zdnum); |
| | | that.map.entities.removeById(that.gsnum); |
| | | |
| | | $('#qidianInput').val(''); |
| | | $('#zhongdianInput').val(''); |
| | | $('#routeTable').html(''); |
| | | $('#routeBottom').html(''); |
| | | $('#routeTable').hide(); |
| | | that.cartesian = ''; |
| | | that.cartesian1 = ''; |
| | | $('.routeXLD').html(''); |
| | | $('.routeXLD').hide(); |
| | | // 清楚线路段的实体 |
| | | that.map.entities.removeById(that.streetLatLonIdArr[0]); |
| | | that.map.entities.removeById(that.streetLatLonIdArr1[0]); |
| | | that.map.entities.removeById(that.streetLatLonIdArr2[0]); |
| | | } |
| | | |
| | | // 点击 起点按钮 绘制实体 |
| | | $('#xuanDian1').click(function (event) { |
| | | // 当前镜头 |
| | | that.cameraPosArr = []; |
| | | that.heightJTArr = []; |
| | | |
| | | // 线路段高亮height数组 |
| | | that.heightArr = []; |
| | | that.heightArr1 = []; |
| | | that.heightArr2 = []; |
| | | // 线路段高亮坐标数组 |
| | | that.centerArrGl = []; |
| | | that.centerArrGl1 = []; |
| | | that.centerArrGl2 = []; |
| | | |
| | | // 清空起点失去焦点图标 |
| | | that.map.entities.removeById(that.qdNum); |
| | | |
| | | // 线路段1坐标数组 |
| | | that.streetLatLonArr = []; |
| | | that.streetLatLonArr1 = []; |
| | | that.streetLatLonArr2 = []; |
| | | |
| | | // 删除其它 线路段 实体 |
| | | if (that.streetLatLonIdArr1.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr1[0]); |
| | | } |
| | | if (that.streetLatLonIdArr.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr[0]); |
| | | } |
| | | if (that.streetLatLonIdArr2.length > 0) { |
| | | that.map.entities.removeById(that.streetLatLonIdArr2[0]); |
| | | } |
| | | |
| | | // 每次点击之前把html清空 |
| | | $('.route-list1').html(''); |
| | | $('.route-list2').html(''); |
| | | $('.route-list3').html(''); |
| | | |
| | | // 把数据也清空 |
| | | that.itemQc = ''; |
| | | that.itemXldArr = []; |
| | | that.itemQc1 = ''; |
| | | that.itemXldArr1 = []; |
| | | that.itemQc2 = ''; |
| | | that.itemXldArr2 = []; |
| | | |
| | | // 样式清空 |
| | | $('.route-zd').removeClass('routehover'); |
| | | $('.route-zk').removeClass('routehover'); |
| | | $('.route-gs').removeClass('routehover'); |
| | | |
| | | // 清楚方案线路实体 |
| | | that.map.entities.removeById(that.zknum); |
| | | that.map.entities.removeById(that.zdnum); |
| | | that.map.entities.removeById(that.gsnum); |
| | | |
| | | that.item = ''; |
| | | that.itemQc = ''; |
| | | that.itemXldArr = []; |
| | | that.itemXldArr1 = []; |
| | | that.itemXldArr2 = []; |
| | | $('.routeXLD').html(''); |
| | | // 清楚线路段的实体 |
| | | that.map.entities.removeById(that.streetLatLonIdArr[0]); |
| | | that.map.entities.removeById(that.streetLatLonIdArr1[0]); |
| | | that.map.entities.removeById(that.streetLatLonIdArr2[0]); |
| | | |
| | | var handlers = new Cesium.ScreenSpaceEventHandler(that.map.scene.canvas); |
| | | // 监听鼠标移动 |
| | | handlers.setInputAction(function (moveEvent) { |
| | | // 点击完成绘制 |
| | | $('.route .danji').css({ 'display': 'block', 'left': moveEvent.startPosition.x + 10 + 'px', 'top': moveEvent.startPosition.y + 10 + 'px' }); |
| | | }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | // 监听鼠标点击 |
| | | handlers.setInputAction(function (clickEvent) { |
| | | $('.route .danji').hide(); |
| | | var pick = that.map.scene.pickPosition(clickEvent.position); |
| | | // 获取坐标 |
| | | var ray = that.map.camera.getPickRay(clickEvent.position); |
| | | that.cartesian = scene.globe.pick(ray, scene); |
| | | // 坐标转换 |
| | | var ellipsoid = that.map.scene.globe.ellipsoid; |
| | | var cartesian3 = new Cesium.Cartesian3(that.cartesian.x, that.cartesian.y, that.cartesian.z); |
| | | var cartographic = ellipsoid.cartesianToCartographic(cartesian3); |
| | | that.lat = Cesium.Math.toDegrees(cartographic.latitude).toFixed(5); //纬度 |
| | | that.lng = Cesium.Math.toDegrees(cartographic.longitude).toFixed(5); //经度 |
| | | $('#qidianInput').val(that.lng + ',' + that.lat); |
| | | // 判断是否是第一个实体 |
| | | that.cartesianArr.push(that.cartesian); |
| | | if (that.cartesianArr.length == 1) { |
| | | // 绘制entity |
| | | addPoint(that.cartesian, that.num, that.pic, that.updateadd); |
| | | } else { |
| | | that.updateadd.position = that.cartesian; |
| | | } |
| | | if (that.cartesian) { |
| | | $('.route .danji').css('display', 'none'); |
| | | handlers.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | } |
| | | handlers.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | |
| | | // 默认触发回车键 |
| | | if ($('#qidianInput').val() != '' && $('#zhongdianInput').val() != '') { |
| | | $('.route-zk').trigger("click"); |
| | | } |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | }); |
| | | |
| | | // 点击 终点按钮 绘制实体 |
| | | $('#xuanDian2').on('click', function (event) { |
| | | // 当前镜头 |
| | | that.cameraPosArr = []; |
| | | that.heightJTArr = []; |
| | | |
| | | // 线路段高亮height数组 |
| | | that.heightArr = []; |
| | | that.heightArr1 = []; |
| | | that.heightArr2 = []; |
| | | // 线路段高亮坐标数组 |
| | | that.centerArrGl = []; |
| | | that.centerArrGl1 = []; |
| | | that.centerArrGl2 = []; |
| | | |
| | | // 清空终点失去焦点图标 |
| | | that.map.entities.removeById(that.qdNum1); |
| | | |
| | | // 线路段1坐标数组 |
| | | that.streetLatLonArr = []; |
| | | that.streetLatLonArr1 = []; |
| | | that.streetLatLonArr2 = []; |
| | | |
| | | // 每次点击之前把html清空 |
| | | $('.route-list1').html(''); |
| | | $('.route-list2').html(''); |
| | | $('.route-list3').html(''); |
| | | |
| | | // 把数据也清空 |
| | | that.itemQc = ''; |
| | | that.itemXldArr = []; |
| | | that.itemQc1 = ''; |
| | | that.itemXldArr1 = []; |
| | | that.itemQc2 = ''; |
| | | that.itemXldArr2 = []; |
| | | |
| | | // 样式清空 |
| | | $('.route-zd').removeClass('routehover'); |
| | | $('.route-zk').removeClass('routehover'); |
| | | $('.route-gs').removeClass('routehover'); |
| | | |
| | | // 清楚方案线路实体 |
| | | that.map.entities.removeById(that.zknum); |
| | | that.map.entities.removeById(that.zdnum); |
| | | that.map.entities.removeById(that.gsnum); |
| | | |
| | | that.item = ''; |
| | | that.itemQc = ''; |
| | | that.itemXldArr = []; |
| | | that.itemXldArr1 = []; |
| | | that.itemXldArr2 = []; |
| | | $('.routeXLD').html(''); |
| | | // 清楚线路段的实体 |
| | | that.map.entities.removeById(that.streetLatLonIdArr[0]); |
| | | that.map.entities.removeById(that.streetLatLonIdArr1[0]); |
| | | that.map.entities.removeById(that.streetLatLonIdArr2[0]); |
| | | var handlers = new Cesium.ScreenSpaceEventHandler(that.map.scene.canvas); |
| | | // 监听鼠标移动 |
| | | handlers.setInputAction(function (moveEvent) { |
| | | // 点击完成绘制 |
| | | $('.route .danji').css({ 'display': 'block', 'left': moveEvent.startPosition.x + 10 + 'px', 'top': moveEvent.startPosition.y + 10 + 'px' }); |
| | | }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | // 监听鼠标点击 |
| | | handlers.setInputAction(function (clickEvent) { |
| | | $('.route .danji').hide(); |
| | | var pick = that.map.scene.pickPosition(clickEvent.position); |
| | | // 获取坐标 |
| | | var ray = that.map.camera.getPickRay(clickEvent.position); |
| | | that.cartesian1 = scene.globe.pick(ray, scene); |
| | | // 坐标转换 |
| | | var ellipsoid = that.map.scene.globe.ellipsoid; |
| | | var cartesian3 = new Cesium.Cartesian3(that.cartesian1.x, that.cartesian1.y, that.cartesian1.z); |
| | | var cartographic = ellipsoid.cartesianToCartographic(cartesian3); |
| | | that.lat1 = Cesium.Math.toDegrees(cartographic.latitude).toFixed(5); //纬度 |
| | | that.lng1 = Cesium.Math.toDegrees(cartographic.longitude).toFixed(5); //经度 |
| | | $('#zhongdianInput').val(that.lng1 + ',' + that.lat1); |
| | | that.cartesianArr1.push(that.cartesian1); |
| | | if (that.cartesianArr1.length == 1) { |
| | | // 绘制entity |
| | | addPoint1(that.cartesian1, that.num1, that.pic1, that.updateadd1); |
| | | } else { |
| | | that.updateadd1.position = that.cartesian1; |
| | | } |
| | | if (that.cartesian1) { |
| | | $('.route .danji').css('display', 'none'); |
| | | handlers.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | } |
| | | handlers.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | |
| | | // 默认触发最快线路事件 |
| | | if ($('#qidianInput').val() != '' && $('#zhongdianInput').val() != '') { |
| | | $('.route-zk').trigger("click"); |
| | | } |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | }); |
| | | |
| | | // 起点失去焦点绘制实体 |
| | | $('#qidianInput').blur(function (event) { |
| | | // 清空起点跟终点图标 |
| | | that.map.entities.removeById(that.num); |
| | | |
| | | // input值 |
| | | that.qdText = $(this).val(); |
| | | that.qdTextArr = that.qdText.split(','); |
| | | |
| | | that.lng = that.qdTextArr[0]; |
| | | that.lat = that.qdTextArr[1]; |
| | | |
| | | // 经纬度转成世界坐标 |
| | | that.qdCar = Cesium.Cartesian3.fromDegrees(that.qdTextArr[0], that.qdTextArr[1]); |
| | | |
| | | // 判断是否是第一个实体 |
| | | that.qdCarArr.push(that.qdCar); |
| | | if (that.qdCarArr.length == 1) { |
| | | // 绘制entity |
| | | addPoint(that.qdCar, that.qdNum, that.pic); |
| | | } else { |
| | | that.updateadd.position = that.qdCar; |
| | | } |
| | | |
| | | // // 起点跟终点有值触触发最快线路 |
| | | // if ($('#qidianInput').val() != '' && $('#zhongdianInput').val() != '') { |
| | | // $('.route-zk').trigger("click"); |
| | | // } |
| | | }); |
| | | |
| | | // 终点失去焦点绘制实体 |
| | | $('#zhongdianInput').blur(function (event) { |
| | | // 清空跟终点图标 |
| | | that.map.entities.removeById(that.num1); |
| | | |
| | | that.qdText1 = $(this).val(); |
| | | that.qdTextArr1 = that.qdText1.split(','); |
| | | |
| | | that.lng1 = that.qdTextArr1[0]; |
| | | that.lat1 = that.qdTextArr1[1]; |
| | | |
| | | // 经纬度转成世界坐标 |
| | | that.qdCar1 = Cesium.Cartesian3.fromDegrees(that.qdTextArr1[0], that.qdTextArr1[1]); |
| | | |
| | | // 判断是否是第一个实体 |
| | | that.qdCarArr1.push(that.qdCar1); |
| | | if (that.qdCarArr1.length == 1) { |
| | | // 绘制entity |
| | | addPoint1(that.qdCar1, that.qdNum1, that.pic1); |
| | | } else { |
| | | that.updateadd1.position = that.qdCar1; |
| | | } |
| | | }); |
| | | |
| | | // ajax1 |
| | | function ajax1() { |
| | | if (that.cartesian && that.cartesian1 || that.qdCar && that.qdCar1) { |
| | | var key = 'e9533f5acb2ac470b07f406a4d24b4f0'; |
| | | that.postStr = { 'orig': '', 'dest': '', style: 0 }; |
| | | that.postStr.orig = that.lng + ',' + that.lat; |
| | | that.postStr.dest = that.lng1 + ',' + that.lat1; |
| | | var dayUrl = 'http://api.tianditu.gov.cn/drive?postStr=' + JSON.stringify(that.postStr) + '&type=search&tk=' + key; |
| | | $.ajax({ |
| | | type: "get", |
| | | url: dayUrl, |
| | | async: false, |
| | | dataType: "xml", |
| | | success: function success(res) { |
| | | console.log(res); |
| | | // 线路children |
| | | var items = $(res).find('simple').children('item'); |
| | | for (var j = 0; j < items.length; j++) { |
| | | // 方案1线路详情 |
| | | that.itemXld = $($(res).find('simple').children('item')[j]).find('strguide').text(); |
| | | // 方案1线路详情push到数组 |
| | | that.itemXldArr.push(that.itemXld); |
| | | |
| | | // 每条线路段坐标 |
| | | that.streetLatLon = $($(res).find('simple').children('item')[j]).find('streetLatLon').text(); |
| | | // 每条线路段坐标push到streetLatLonArr |
| | | that.streetLatLonArr.push(that.streetLatLon); |
| | | }; |
| | | // 每条线路全长 |
| | | that.itemQc = $(res).find('distance').text(); |
| | | // 每条线路坐标 |
| | | that.itemZb = $(res).find('routelatlon').text(); |
| | | // 每条线路坐标做数据处理 |
| | | that.itemZbStr = that.itemZb.replace(/;/g, ','); |
| | | that.itemZbArr = that.itemZbStr.split(','); |
| | | // 线路一适宜中心经纬度 |
| | | that.center = $(res).find('center').text(); |
| | | // 线路一缩放比例 |
| | | that.scale = $(res).find('scale').text(); |
| | | // 线路ID |
| | | that.zknum = new Date().getTime(); |
| | | // 绘制线段 |
| | | xianDuan(that.itemZbArr, that.zknum); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // ajax2 |
| | | function ajax2() { |
| | | if (that.cartesian && that.cartesian1 || that.qdCar && that.qdCar1) { |
| | | var key = 'e9533f5acb2ac470b07f406a4d24b4f0'; |
| | | that.postStr = { 'orig': '', 'dest': '', style: 1 }; |
| | | that.postStr.orig = that.lng + ',' + that.lat; |
| | | that.postStr.dest = that.lng1 + ',' + that.lat1; |
| | | var dayUrl = 'http://api.tianditu.gov.cn/drive?postStr=' + JSON.stringify(that.postStr) + '&type=search&tk=' + key; |
| | | $.ajax({ |
| | | type: "get", |
| | | url: dayUrl, |
| | | async: false, |
| | | dataType: "xml", |
| | | success: function success(res) { |
| | | // 线路children |
| | | var items = $(res).find('simple').children('item'); |
| | | for (var j = 0; j < items.length; j++) { |
| | | // 方案1线路详情 |
| | | that.itemXld1 = $($(res).find('simple').children('item')[j]).find('strguide').text(); |
| | | that.itemXldArr1.push(that.itemXld1); |
| | | |
| | | // 每条线路段坐标 |
| | | that.streetLatLon1 = $($(res).find('simple').children('item')[j]).find('streetLatLon').text(); |
| | | // 每条线路段坐标push到streetLatLonArr |
| | | that.streetLatLonArr1.push(that.streetLatLon1); |
| | | }; |
| | | // 每条线路全长 |
| | | that.itemQc1 = $(res).find('distance').text(); |
| | | // 每条线路坐标 |
| | | that.itemZb1 = $(res).find('routelatlon').text(); |
| | | // 每条线路坐标做数据处理 |
| | | that.itemZbStr1 = that.itemZb1.replace(/;/g, ','); |
| | | that.itemZbArr1 = that.itemZbStr1.split(','); |
| | | // 线路一适宜中心经纬度 |
| | | that.center1 = $(res).find('center').text(); |
| | | // 线路ID |
| | | that.zdnum = new Date().getTime(); |
| | | // 绘制线段 |
| | | xianDuan(that.itemZbArr1, that.zdnum); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // ajax3 |
| | | function ajax3() { |
| | | if (that.cartesian && that.cartesian1 || that.qdCar && that.qdCar1) { |
| | | var key = 'e9533f5acb2ac470b07f406a4d24b4f0'; |
| | | that.postStr = { 'orig': '', 'dest': '', style: 2 }; |
| | | that.postStr.orig = that.lng + ',' + that.lat; |
| | | that.postStr.dest = that.lng1 + ',' + that.lat1; |
| | | var dayUrl = 'http://api.tianditu.gov.cn/drive?postStr=' + JSON.stringify(that.postStr) + '&type=search&tk=' + key; |
| | | $.ajax({ |
| | | type: "get", |
| | | url: dayUrl, |
| | | async: false, |
| | | dataType: "xml", |
| | | success: function success(res) { |
| | | // 线路children |
| | | var items = $(res).find('simple').children('item'); |
| | | for (var j = 0; j < items.length; j++) { |
| | | // 方案1线路详情 |
| | | that.itemXld2 = $($(res).find('simple').children('item')[j]).find('strguide').text(); |
| | | that.itemXldArr2.push(that.itemXld2); |
| | | |
| | | // 每条线路段坐标 |
| | | that.streetLatLon2 = $($(res).find('simple').children('item')[j]).find('streetLatLon').text(); |
| | | // 每条线路段坐标push到streetLatLonArr |
| | | that.streetLatLonArr2.push(that.streetLatLon2); |
| | | }; |
| | | // 每条线路全长 |
| | | that.itemQc2 = $(res).find('distance').text(); |
| | | // 每条线路坐标 |
| | | that.itemZb2 = $(res).find('routelatlon').text(); |
| | | // 每条线路坐标做数据处理 |
| | | that.itemZbStr2 = that.itemZb2.replace(/;/g, ','); |
| | | that.itemZbArr2 = that.itemZbStr2.split(','); |
| | | // 线路一适宜中心经纬度 |
| | | that.center2 = $(res).find('center').text(); |
| | | // 线路ID |
| | | that.gsnum = new Date().getTime(); |
| | | // 绘制线段 |
| | | xianDuan(that.itemZbArr2, that.gsnum); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // 创建线段的方法 |
| | | function xianDuan(item, id) { |
| | | that.xianDuanArr = []; |
| | | for (var i = 0; i < item.length - 1; i++) { |
| | | that.xianDuanArr.push(Number(item[i])); |
| | | } |
| | | that.map.entities.add({ |
| | | id: id, |
| | | polyline: { |
| | | positions: Cesium.Cartesian3.fromDegreesArray(that.xianDuanArr), |
| | | width: 5, |
| | | material: Cesium.Color.SKYBLUE, |
| | | clampToGround: true |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | function xianDuan1(item1, id1) { |
| | | that.xldArr1 = []; |
| | | for (var i = 0; i < item1.length - 1; i++) { |
| | | that.xldArr1.push(Number(item1[i])); |
| | | } |
| | | that.map.entities.add({ |
| | | id: id1, |
| | | polyline: { |
| | | positions: Cesium.Cartesian3.fromDegreesArray(that.xldArr1), |
| | | width: 5, |
| | | material: Cesium.Color.RED, |
| | | clampToGround: true |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 创建点方法(起点) |
| | | function addPoint(cartesian, id, pic) { |
| | | that.updateadd = viewer.entities.add({ |
| | | id: id, |
| | | position: cartesian, |
| | | billboard: { //图标 |
| | | image: './images/' + pic + '.png', |
| | | width: 40, |
| | | height: 40, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY |
| | | }, |
| | | label: { |
| | | text: that.str, |
| | | font: '8pt Source Han Sans CN', //字体样式 |
| | | fillColor: Cesium.Color.YELLOW, //字体颜色 |
| | | backgroundColor: Cesium.Color.AQUA, //背景颜色 |
| | | // showBackground: true, //是否显示背景颜色 |
| | | style: Cesium.LabelStyle.FILL, //label样式 |
| | | outlineWidth: 2, |
| | | verticalOrigin: Cesium.VerticalOrigin.CENTER, //垂直位置 |
| | | horizontalOrigin: Cesium.HorizontalOrigin.CENTER, //水平位置 |
| | | pixelOffset: new Cesium.Cartesian2(0, -30), //偏移 |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY |
| | | } |
| | | }); |
| | | }; |
| | | // 创建点方法(终点) |
| | | function addPoint1(cartesian, id, pic) { |
| | | that.updateadd1 = viewer.entities.add({ |
| | | id: id, |
| | | position: cartesian, |
| | | billboard: { //图标 |
| | | image: './images/' + pic + '.png', |
| | | width: 40, |
| | | height: 40, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY |
| | | }, |
| | | label: { |
| | | text: that.str, |
| | | font: '8pt Source Han Sans CN', //字体样式 |
| | | fillColor: Cesium.Color.YELLOW, //字体颜色 |
| | | backgroundColor: Cesium.Color.AQUA, //背景颜色 |
| | | // showBackground: true, //是否显示背景颜色 |
| | | style: Cesium.LabelStyle.FILL, //label样式 |
| | | outlineWidth: 2, |
| | | verticalOrigin: Cesium.VerticalOrigin.CENTER, //垂直位置 |
| | | horizontalOrigin: Cesium.HorizontalOrigin.CENTER, //水平位置 |
| | | pixelOffset: new Cesium.Cartesian2(0, -30), //偏移 |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY |
| | | } |
| | | }); |
| | | }; |
| | | }, |
| | | |
| | | onOpen: function onOpen() {}, |
| | | |
| | | onClose: function onClose() { |
| | | //面板关闭的时候触发 (when this panel is closed trigger) |
| | | }, |
| | | |
| | | onMinimize: function onMinimize() { |
| | | this.resize(); |
| | | }, |
| | | |
| | | onMaximize: function onMaximize() { |
| | | this.resize(); |
| | | }, |
| | | |
| | | resize: function resize() {}, |
| | | |
| | | destroy: function destroy() { |
| | | //销毁的时候触发 |
| | | //todo |
| | | //do something before this func |
| | | this.inherited(arguments); |
| | | } |
| | | |
| | | }); |
| | | }); |
| New file |
| | |
| | | .jimu-widget-RouteNavigate { |
| | | background-color: #36403d; |
| | | opacity: .8; |
| | | font-size: 14px; |
| | | border: 1px solid rgb(69, 154, 251); |
| | | color: rgb(238, 235, 235); |
| | | font-size: 16px; |
| | | width: 100%; |
| | | height: 100%; |
| | | border-radius: 10px; |
| | | display: none; |
| | | box-sizing: border-box; |
| | | overflow: auto; |
| | | } |
| | | |
| | | .route-title { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 10px; |
| | | width: 100%; |
| | | height: 35px; |
| | | border-bottom: 1px solid rgb(69, 154, 251); |
| | | } |
| | | |
| | | .route-title .pic { |
| | | top: 0; |
| | | left: 0; |
| | | width: 15px; |
| | | height: 15px; |
| | | background: url(../../../images/toolbox.png ) no-repeat 0 -159px; |
| | | } |
| | | |
| | | .route-title .luxian { |
| | | margin-left: -180px; |
| | | font-size: 14px; |
| | | cursor: default ; |
| | | } |
| | | |
| | | .route-title .x { |
| | | cursor: pointer; |
| | | font-style: 16px; |
| | | } |
| | | |
| | | .route-sign { |
| | | width: 100%; |
| | | height: 140px; |
| | | } |
| | | |
| | | .route-sign .qiDianBox { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | height: 50px; |
| | | padding: 10px; |
| | | } |
| | | |
| | | .route-sign .qiDianBox .qiDian { |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .route-sign .qiDianBox .input { |
| | | border: none; |
| | | height: 25px; |
| | | border-radius: 5px; |
| | | text-indent: 10px; |
| | | /* padding-right: 10px; */ |
| | | } |
| | | |
| | | .route-sign .qiDianBox button { |
| | | border: none; |
| | | border-radius: 5px; |
| | | background-color: #20a0ff; |
| | | color: #fff; |
| | | line-height: 25px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .route-sign .qiDianBox #xuanDian1 img, |
| | | .route-sign .qiDianBox #xuanDian2 img { |
| | | width: 30px; |
| | | height: 30px; |
| | | margin-top: 3px; |
| | | margin-right: 5px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .route-sign .zhongDianBox { |
| | | margin-top: -10px; |
| | | } |
| | | |
| | | .route-sign .hengxian { |
| | | margin: 20px auto 0; |
| | | width: 285px; |
| | | border-bottom: 1px solid #fff; |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | .route-fangan { |
| | | margin-top: 0px; |
| | | width: 100%; |
| | | padding: 0 10px; |
| | | } |
| | | |
| | | .route-faTitle { |
| | | width: 100%; |
| | | height: 30px; |
| | | display: flex; |
| | | text-align: center; |
| | | border: 1px solid #fff; |
| | | } |
| | | |
| | | .route-faTitle span { |
| | | flex: 1; |
| | | border-right: 1px solid #fff; |
| | | text-align: center; |
| | | line-height: 30px; |
| | | font-size: 13px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .routehover { |
| | | color: #68acf9; |
| | | } |
| | | |
| | | .route-list { |
| | | display: none; |
| | | width: 100%; |
| | | } |
| | | |
| | | .route-zlc { |
| | | width: 100%; |
| | | height: 30px; |
| | | background-color: rgb(23, 161, 150); |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .route-zlc span { |
| | | font-size: 12px; |
| | | line-height: 30px; |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | .route-xsqb { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | width: 100%; |
| | | height: 30px; |
| | | border-bottom: 1px solid #fff; |
| | | padding: 0 10px 0 0; |
| | | } |
| | | |
| | | .route-xsqb .inpupt { |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .route-xsqb span { |
| | | font-size: 13px ; |
| | | margin-left: 5px; |
| | | cursor: default; |
| | | } |
| | | |
| | | .route-lujin { |
| | | cursor: pointer; |
| | | width: 100%; |
| | | } |
| | | |
| | | .route-lujin .lujin-div { |
| | | width: 100%; |
| | | padding: 10px; |
| | | border-bottom: 1px solid #fff; |
| | | } |
| | | |
| | | .route-lujin .lujin-div .one { |
| | | font-size: 13px; |
| | | line-height: 20px; |
| | | } |
| | | |
| | | .route-lujin .lujin-div .two { |
| | | font-size: 12px; |
| | | margin-left: 10px; |
| | | line-height: 20px; |
| | | } |
| | | |
| | | #spanxialu { |
| | | color: #68acf9; |
| | | } |
| | | |
| | | |
| | | /* 搜索清空按钮 */ |
| | | .route-search { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | width: 100%; |
| | | padding: 0 95px; |
| | | margin-top: 10px; |
| | | margin-top: -2px; |
| | | } |
| | | |
| | | .route-search button { |
| | | border-radius: 5px; |
| | | cursor: pointer; |
| | | line-height: 20px; |
| | | width: 42px; |
| | | font-size: 12px; |
| | | border: none; |
| | | background-color: rgb(69, 154, 251); |
| | | color: #fff; |
| | | border: 1px solid rgb(69, 154, 251); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | { |
| | | "name": "RouteNavigate", |
| | | "2D": true, |
| | | "3D": true, |
| | | "platform": "HTML", |
| | | "version": "2.10", |
| | | "wabVersion": "2.10", |
| | | "author": "jxdnosng", |
| | | "description": "", |
| | | "copyright": "", |
| | | "license": "", |
| | | "properties": { |
| | | "hasConfig": false, |
| | | "inPanel": false, |
| | | "hasVersionManager": false |
| | | } |
| | | } |
| New file |
| | |
| | | define( |
| | | ({ |
| | | _widgetLabel: "goRouteNavigate" |
| | | }) |
| | | ); |
| New file |
| | |
| | | define({ |
| | | root: ({ |
| | | _widgetLabel: "RouteNavigate" |
| | | }), |
| | | "es": 1, |
| | | "zh-cn": 1 |
| | | }); |
| New file |
| | |
| | | define( |
| | | ({ |
| | | _widgetLabel: "路线导航" |
| | | }) |
| | | ); |
| | |
| | | height: 100%; |
| | | border-radius: 10px; |
| | | display: none; |
| | | position: fixed; |
| | | z-index: 100; |
| | | } |
| | | |
| | | .rollinng-table-hezis { |
| | |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 15px; |
| | | background-color:#3c464b; |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | .hezi-left-selects { |
| New file |
| | |
| | | <div id="sign_table"> |
| | | <div class="sign-head"> |
| | | <div class="sign-head-th"> |
| | | <i class="sign-head-th-pic"></i> |
| | | <span class="sign-head-th-biaoji">我的标记</span> |
| | | <span class="sign-head-th-xx">×</span> |
| | | </div> |
| | | <div class="sign-head-td"> |
| | | <ul class="sign-head-td-ul"> |
| | | <li class="sign-head-td-ul-border addPic addTianjia" title="添加注记"> |
| | | <img src="./images/tj.png" alt=""> |
| | | </li> |
| | | <li class="sign-head-td-ul-hengxian">|</li> |
| | | <li class="sign-head-td-ul-border dakai" id="dkwj" title="打开文件"> |
| | | <input type="file" class="file" id="fileDKWJ" /> |
| | | <img src="./images/dk.png" alt=""> |
| | | </li> |
| | | <li class="sign-head-td-ul-border dakai" id="djwj" title="叠加文件"> |
| | | <input type="file" class="file" id="fileDJWJ"> |
| | | <img src="./images/dakaiwenjian.png" alt=""> |
| | | </li> |
| | | <li class="sign-head-td-ul-border" id="bcwj" title="保存文件"> |
| | | <img src="./images/cwj.png" alt=""> |
| | | </li> |
| | | <li class="sign-head-td-ul-hengxian">|</li> |
| | | <li class="sign-head-td-ul-border" id="qkbj" title="清空标记"> |
| | | <img src="./images/shanchu.png" alt=""> |
| | | </li> |
| | | <li class="sign-head-td-ul-border" id="suo" title="是否编辑"> |
| | | <img id="jiesuo" src="./images/jiesuo.png" alt=""> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <div class="sign-content"> |
| | | <div class="sign-content-mc"> |
| | | <div class="sign-content-mc-hezi"> |
| | | <span>名称</span> |
| | | <!-- <img class="topPic" src="../../images/sign/-shanglajiantou.png" alt=""> |
| | | <img class="bottomPic" src="../../images/sign/-xialajiantou.png" alt=""> --> |
| | | </div> |
| | | <div class="caozuo">操作</div> |
| | | </div> |
| | | <div class="sign-content-my">没有找到匹配的记录</div> |
| | | <!-- <div class="11"> |
| | | <input type="text" value="我的标记" class="wdbj-text"> |
| | | <img class="wdbj-shanchu" src="../../images/sign/shanchu.png" alt=""> |
| | | </div> --> |
| | | <div class="sign-content-kb"></div> |
| | | </div> |
| | | <!-- 单击完成绘制 --> |
| | | <div class="danji">单击完成绘制</div> |
| | | <!-- 添加标记 --> |
| | | <div class="sign-tian"> |
| | | <div class="sign-tian-thead"> |
| | | <span>添加标记</span> |
| | | <span class="sign-tian-xxx">×</span> |
| | | </div> |
| | | <div class="sign-tian-tbody"> |
| | | <div class="sign-tian-hang"> |
| | | <div>名称</div> |
| | | <input class="sign_im_text sign-tian-hang-input" type="text" placeholder="请输入标记名称"> |
| | | </div> |
| | | <div class="sign-tian-hang qsrbz"> |
| | | <div>备注</div> |
| | | <textarea class="sign-tian-hang-textarea" placeholder="请输入备注 (可选填)"></textarea> |
| | | </div> |
| | | <div class="sign-tian-bao"> |
| | | <button class="baocun">保存</button> |
| | | <button class="shanchu">删除</button> |
| | | </div> |
| | | </div> |
| | | <div class="sanJiaoXing-pic"></div> |
| | | </div> |
| | | <!-- 提示文字 --> |
| | | <div class="tipWenZi"> |
| | | <div class="delWenZi actEdit">单击激活编辑</div> |
| | | <div class="delWenZi modifyEdit">释放完成修改</div> |
| | | <div class="delWenZi dragEdit">拖动该点修改位置</div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | define(['dojo/_base/declare', 'dojo/_base/lang', 'dojo/_base/array', 'dojo/_base/html', 'dojo/topic', 'jimu/BaseWidget'], function (declare, lang, array, html, topic, BaseWidget) { |
| | | return declare([BaseWidget], { |
| | | baseClass: 'jimu-widget-Sign', |
| | | name: 'Sign', |
| | | toggle: true, |
| | | // entities唯一id |
| | | num: 0, |
| | | // num数组 |
| | | arr: [], |
| | | // 文件名称 |
| | | fileName: '我的标记点', |
| | | // 定位图标位置 |
| | | cartesian: '', |
| | | // cartesian数组 |
| | | fileArr: [], |
| | | // 保存实体对象 |
| | | updateadd: {}, |
| | | // 实体名称 |
| | | str: '', |
| | | // 存放entities信息的数组 |
| | | arrDingWei: [], |
| | | // 存放entities信息的每一个对象 |
| | | arrObj: {}, |
| | | // updateadd数组 |
| | | onClickEntity: [], |
| | | // 请输入名称数组 |
| | | arrQsrbz: [], |
| | | // 导入名称数组 |
| | | Dname: [], |
| | | // 导入X坐标 |
| | | DzbX: '', |
| | | // 导入Y坐标 |
| | | DzbY: '', |
| | | // 导入的对象 |
| | | Dobj: [], |
| | | // 导入的自定义attr数组 |
| | | shuzi: [], |
| | | // 全局pick |
| | | qJpick: {}, |
| | | localCartesian: [], |
| | | localname: [], |
| | | localarr: [], |
| | | localqsrbz: [], |
| | | flag: false, |
| | | active: false, |
| | | entityAll: '', |
| | | ind: '', |
| | | startup: function startup() { |
| | | topic.subscribe("openSign", lang.hitch(this, this.onOpenSign)); |
| | | // var fileNames = '我的标记点'; |
| | | var that = this; |
| | | var scene = that.map.scene; |
| | | var handler = new Cesium.ScreenSpaceEventHandler(that.map.scene.canvas); |
| | | // var cartes = null; |
| | | $('.addPic').click(function (event) { |
| | | var handlers = new Cesium.ScreenSpaceEventHandler(that.map.scene.canvas); |
| | | |
| | | // 监听鼠标移动 |
| | | handlers.setInputAction(function (moveEvent) { |
| | | // 点击完成绘制 |
| | | $('.danji').css({ 'display': 'block', 'left': moveEvent.startPosition.x + 10 + 'px', 'top': moveEvent.startPosition.y + 10 + 'px' }); |
| | | }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | // 监听鼠标点击 |
| | | handlers.setInputAction(function (clickEvent) { |
| | | $('.sign-tian').hide(); |
| | | that.toggle = true; |
| | | |
| | | var pick = that.map.scene.pickPosition(clickEvent.position); |
| | | // 获取坐标 |
| | | var ray = that.map.camera.getPickRay(clickEvent.position); |
| | | that.cartesian = scene.globe.pick(ray, scene); |
| | | // 绘制entity |
| | | that.fileArr.push(that.cartesian); |
| | | addPoint(that.cartesian, that.num += 1 + new Date().getTime()); |
| | | window.localStorage.setItem('BJD', JSON.stringify(that.fileArr)); |
| | | window.localStorage.setItem('BJDarr', JSON.stringify(that.arr)); |
| | | |
| | | $('.sign-tian-hang-textarea').val(''); |
| | | $('.sign-tian').show(); |
| | | |
| | | $('.sign-tian').css({ 'left': clickEvent.position.x - $('.sign-tian').innerWidth() / 2 + 'px', 'top': clickEvent.position.y - 300 + 'px' }); |
| | | if (that.toggle && $('.sign-tian').css('display', 'block')) { |
| | | that.map.scene.postRender.addEventListener(moveDom); |
| | | that.toggle = false; |
| | | } else { |
| | | that.map.scene.postRender.removeEventListener(moveDom); |
| | | that.toggle = true; |
| | | } |
| | | |
| | | $('.sign_im_text').val(''); |
| | | $('.sign_im_text').attr('entityid', that.updateadd.id); |
| | | $('.sign-tian-hang-textarea').attr('entityid', that.updateadd.id); |
| | | |
| | | if (that.cartesian) { |
| | | $('.danji').css('display', 'none'); |
| | | handlers.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | } |
| | | |
| | | that.arrQsrbz.push($('.sign-tian-hang-textarea').val()); |
| | | that.updateadd.label.text = $('.sign_im_text').val() ? $('.sign_im_text').val() : '我的标记'; |
| | | $('.sign-content-my').hide(); |
| | | $('.sign-content').append('<div class = \'wdbj\'><div class = \'dingWeiFei\'><input class = \'wdbj-text\' disabled value = ' + ($('.sign_im_text').val() ? $('.sign_im_text').val() : '我的标记') + ' entitydataid=\'' + $('.sign_im_text').attr('entityid') + '\'></input></div><img class=\'wdbj-shanchu\' src=\'./images/shanchu.png\'></img></div>'); |
| | | |
| | | handlers.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | }); |
| | | |
| | | // 导入文件 |
| | | $('#fileDKWJ').on('change', function (event) { |
| | | $('#qkbj').trigger('click'); |
| | | that.arrQsrbz = []; |
| | | that.Dname = []; |
| | | var date = +new Date(); |
| | | var file = this.files[0]; //获取文件 |
| | | var reader = new FileReader(); |
| | | var datas; |
| | | reader.readAsText(file, "UTF-8"); |
| | | reader.onload = function () { |
| | | datas = JSON.parse(reader.result); |
| | | for (var i = 0; i < datas.length; i++) { |
| | | that.Dname.push(datas[i].name); |
| | | that.arrQsrbz.push(datas[i].describe); |
| | | that.Dzbx = datas[i].x; |
| | | that.Dzby = datas[i].y; |
| | | that.fileArr.push({ x: datas[i].x, y: datas[i].y, z: datas[i].z }); |
| | | addPoint(that.fileArr[i], datas[i].shuzi + date); |
| | | |
| | | window.localStorage.setItem('BJD', JSON.stringify(that.fileArr)); |
| | | window.localStorage.setItem('BJDarr', JSON.stringify(that.arr)); |
| | | window.localStorage.setItem('BJDname', JSON.stringify(that.Dname)); |
| | | window.localStorage.setItem('BJDqsrbz', JSON.stringify(that.arrQsrbz)); |
| | | |
| | | that.updateadd.label.text = datas[i].name; |
| | | $('.sign-content-my').hide(); |
| | | $('.sign-content').append('<div class = \'wdbj\'><div class = \'dingWeiFei\'><input class = \'wdbj-text\' disabled value = ' + that.Dname[i] + ' entitydataid = ' + (datas[i].shuzi + date) + ' ></input></div><img class=\'wdbj-shanchu\' src=\'./images/shanchu.png\'></img></div>'); |
| | | } |
| | | }; |
| | | event.target.value = null; |
| | | }); |
| | | |
| | | // 叠加文件 |
| | | $('#fileDJWJ').change(function () { |
| | | var date = +new Date(); |
| | | var file = this.files[0]; //获取文件 |
| | | var reader = new FileReader(); |
| | | var datas; |
| | | reader.readAsText(file, "UTF-8"); |
| | | reader.onload = function () { |
| | | datas = JSON.parse(reader.result); |
| | | for (var i = 0; i < datas.length; i++) { |
| | | that.arrQsrbz.push(datas[i].describe); |
| | | that.Dname.push(datas[i].name); |
| | | that.Dzbx = datas[i].x; |
| | | that.Dzby = datas[i].y; |
| | | that.fileArr.push({ x: datas[i].x, y: datas[i].y, z: datas[i].z }); |
| | | addPoint({ x: datas[i].x, y: datas[i].y, z: datas[i].z }, datas[i].shuzi + date); |
| | | |
| | | window.localStorage.setItem('BJD', JSON.stringify(that.fileArr)); |
| | | window.localStorage.setItem('BJDarr', JSON.stringify(that.arr)); |
| | | window.localStorage.setItem('BJDname', JSON.stringify(that.Dname)); |
| | | window.localStorage.setItem('BJDqsrbz', JSON.stringify(that.arrQsrbz)); |
| | | |
| | | that.updateadd.label.text = datas[i].name; |
| | | $('.sign-content-my').hide(); |
| | | $('.sign-content').append('<div class = \'wdbj\'><div class = \'dingWeiFei\'><input class = \'wdbj-text\' disabled value = ' + datas[i].name + ' entitydataid = ' + (datas[i].shuzi + date) + ' ></input></div><img class=\'wdbj-shanchu\' src=\'./images/shanchu.png\'></img></div>'); |
| | | } |
| | | }; |
| | | that.DzbX = ''; |
| | | that.DzbY = ''; |
| | | }); |
| | | |
| | | function moveDom() { |
| | | if (that.cartesian) { |
| | | var ellipsoid = that.map.scene.globe.ellipsoid; |
| | | var cartographic = ellipsoid.cartesianToCartographic(that.cartesian); |
| | | var lat = Cesium.Math.toDegrees(cartographic.latitude); |
| | | var lng = Cesium.Math.toDegrees(cartographic.longitude); |
| | | |
| | | var a = Cesium.Cartesian3.fromDegrees(lng, lat, 200); |
| | | |
| | | var px_position = Cesium.SceneTransforms.wgs84ToWindowCoordinates(that.map.scene, a); |
| | | $('.sign-tian').css({ 'left': px_position.x - $('.sign-tian').innerWidth() / 2 + 'px', 'top': px_position.y - 310 + 'px' }); |
| | | } |
| | | } |
| | | |
| | | // 创建点 |
| | | function addPoint(cartesian, id) { |
| | | that.updateadd = viewer.entities.add({ |
| | | id: id, |
| | | position: cartesian, |
| | | billboard: { //图标 |
| | | image: './images/dingwei.png', |
| | | width: 40, |
| | | height: 40, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY |
| | | }, |
| | | label: { |
| | | text: that.str, |
| | | font: '8pt Source Han Sans CN', //字体样式 |
| | | fillColor: Cesium.Color.YELLOW, //字体颜色 |
| | | backgroundColor: Cesium.Color.AQUA, //背景颜色 |
| | | // showBackground: true, //是否显示背景颜色 |
| | | style: Cesium.LabelStyle.FILL, //label样式 |
| | | outlineWidth: 2, |
| | | verticalOrigin: Cesium.VerticalOrigin.CENTER, //垂直位置 |
| | | horizontalOrigin: Cesium.HorizontalOrigin.CENTER, //水平位置 |
| | | pixelOffset: new Cesium.Cartesian2(0, -30), //偏移 |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY |
| | | } |
| | | |
| | | }); |
| | | that.arr.push(id); |
| | | if (that.onClickEntity.indexOf(that.updateadd) == -1) { |
| | | that.onClickEntity.push(that.updateadd); |
| | | } |
| | | }; |
| | | |
| | | function mouseEvent() { |
| | | // 点击定位图标弹框出现并可移动定位图标 |
| | | handler.setInputAction(function (movement) { |
| | | var pick = that.map.scene.pick(movement.position); |
| | | if (pick && pick.id) { |
| | | if (pick.id.id) { |
| | | for (var i = that.arr.length - 1; i >= 0; i--) { |
| | | if (pick.id.id == $($('.wdbj')[i]).find('input').attr('entitydataid')) { |
| | | that.ind = i; |
| | | handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | $('.actEdit').stop().hide(); |
| | | var ray = that.map.camera.getPickRay(movement.position); |
| | | that.cartesian = scene.globe.pick(ray, scene); |
| | | that.map.scene.postRender.addEventListener(moveDom); |
| | | $('.sign-tian-hang-textarea').val(''); |
| | | $('.sign-tian').show(); |
| | | $('.sign-tian').css({ 'left': movement.position.x - $('.sign-tian').innerWidth() / 2 + 'px', 'top': movement.position.y - 300 + 'px' }); |
| | | $('.sign_im_text').val($($('.wdbj')[i]).find('input').val()).attr('entityid', pick.id.id); |
| | | $('.sign-tian-hang-textarea').val(that.arrQsrbz[i]); |
| | | // 拖动该定位图标 |
| | | MoveEntity = function () { |
| | | var leftDownFlag = false; |
| | | var pointDraged = null; |
| | | var viewer; |
| | | function ConstructMoveEntity(options) { |
| | | viewer = options.viewer; |
| | | Init(); |
| | | } |
| | | function Init() { |
| | | // Select plane when mouse down 鼠标按下事件 |
| | | that.entityAll = handler.setInputAction(function (movement) { |
| | | pointDraged = viewer.scene.pick(movement.position); //选取当前的entity |
| | | leftDownFlag = true; |
| | | if (pointDraged) { |
| | | viewer.scene.screenSpaceCameraController.enableRotate = false; //锁定相机 |
| | | } |
| | | }, Cesium.ScreenSpaceEventType.LEFT_DOWN); |
| | | |
| | | // Release plane on mouse up 鼠标松开事件 |
| | | handler.setInputAction(function () { |
| | | leftDownFlag = false; |
| | | pointDraged = null; |
| | | $('.modifyEdit').stop().hide(); |
| | | viewer.scene.screenSpaceCameraController.enableRotate = true; |
| | | // handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | // handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN); |
| | | // handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP); |
| | | }, Cesium.ScreenSpaceEventType.LEFT_UP); |
| | | |
| | | // Update plane on mouse move |
| | | handler.setInputAction(function (movement) { |
| | | var pick = that.map.scene.pick(movement.endPosition); |
| | | if (pick && pick.id) { |
| | | if (pick.id.id) { |
| | | if (pick.id.id == $($('.wdbj')[that.ind]).find('input').attr('entitydataid')) { |
| | | $('.dragEdit').stop().show(); |
| | | $('.dragEdit').css({ 'left': movement.endPosition.x + 10 + 'px', 'top': movement.endPosition.y + 10 + 'px' }); |
| | | } |
| | | } |
| | | } else { |
| | | $('.dragEdit').stop().hide(); |
| | | } |
| | | if (leftDownFlag === true && pointDraged != null) { |
| | | $('.dragEdit').stop().hide(); |
| | | $('.modifyEdit').stop().show(); |
| | | $('.modifyEdit').css({ 'left': movement.endPosition.x + 10 + 'px', 'top': movement.endPosition.y + 10 + 'px' }); |
| | | for (var j = 0; j < that.arr.length; j++) { |
| | | if (pointDraged.id.id == $($('.wdbj')[j]).find('input').attr('entitydataid')) { |
| | | var _ray = viewer.camera.getPickRay(movement.endPosition); |
| | | var cartesian = viewer.scene.globe.pick(_ray, viewer.scene); |
| | | pointDraged.id.position = cartesian; |
| | | that.fileArr[j] = pointDraged.id.position._value; |
| | | } |
| | | } |
| | | $('.sign-tian').css('display', 'none'); |
| | | window.localStorage.setItem('BJD', JSON.stringify(that.fileArr)); |
| | | } |
| | | }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | }; |
| | | return ConstructMoveEntity; |
| | | }(); |
| | | var moveTool = MoveEntity({ 'viewer': that.map }); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | $('.dragEdit').stop().hide(); |
| | | } |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | |
| | | // 单击激活编辑 |
| | | handler.setInputAction(function (moveEvent) { |
| | | var pick = that.map.scene.pick(moveEvent.endPosition); |
| | | if (pick && pick.id) { |
| | | if (pick.id.id) { |
| | | $('.actEdit').stop().show(); |
| | | $('.actEdit').css({ 'left': moveEvent.endPosition.x + 10 + 'px', 'top': moveEvent.endPosition.y + 10 + 'px' }); |
| | | } |
| | | } else { |
| | | $('.actEdit').stop().hide(); |
| | | } |
| | | }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | } |
| | | mouseEvent(); |
| | | |
| | | // 清空实体entity |
| | | $('#qkbj').click(function () { |
| | | for (var i = 0; i < that.arr.length; i++) { |
| | | that.map.entities.removeById(that.arr[i]); |
| | | }; |
| | | $('.wdbj').remove(); |
| | | $('.sign-content-my').show(); |
| | | that.fileArr = []; |
| | | that.arrDingWei = []; |
| | | that.arrObj = []; |
| | | that.arr = []; |
| | | that.onClickEntity = []; |
| | | that.num = 0; |
| | | that.updateadd = []; |
| | | that.arrQsrbz = []; |
| | | that.localname = []; |
| | | window.localStorage.removeItem("BJD"); |
| | | window.localStorage.removeItem("BJDarr"); |
| | | window.localStorage.removeItem("BJDname"); |
| | | window.localStorage.removeItem("BJDqsrbz"); |
| | | }); |
| | | |
| | | // 导出文件方法 |
| | | function saveShareContent(content, fileName) { |
| | | var downLink = document.createElement('a'); |
| | | downLink.download = fileName; |
| | | //字符内容转换为blod地址 |
| | | var blob = new Blob([content]); |
| | | downLink.href = URL.createObjectURL(blob); |
| | | // 链接插入到页面 |
| | | document.body.appendChild(downLink); |
| | | downLink.click(); |
| | | // 移除下载链接 |
| | | document.body.removeChild(downLink); |
| | | } |
| | | // 导出文件 |
| | | $('#bcwj').click(function () { |
| | | var arrDingWei = []; |
| | | for (var j = 0; j < that.fileArr.length; j++) { |
| | | that.arrDingWei.push({ |
| | | date: new Date(+new Date() + 8 * 3600 * 1400).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''), |
| | | name: $($('.wdbj')[j]).find('input').val() ? $($('.wdbj')[j]).find('input').val() : '我的标记', |
| | | describe: that.arrQsrbz[j], |
| | | x: that.fileArr[j].x, |
| | | y: that.fileArr[j].y, |
| | | z: that.fileArr[j].z, |
| | | shuzi: $($('.wdbj')[j]).find('input').attr('entitydataid') |
| | | }); |
| | | } |
| | | that.arrDingWei.forEach(function (item, index) { |
| | | arrDingWei.push(item); |
| | | }); |
| | | saveShareContent(JSON.stringify(arrDingWei), that.fileName); |
| | | }); |
| | | |
| | | // 定位到实体 |
| | | $('.sign-content').on('click', '.dingWeiFei', function () { |
| | | if (that.arr.length > 0) { |
| | | for (var i = 0; i < that.arr.length; i++) { |
| | | if ($(this).find('.wdbj-text').attr('entitydataid') == that.arr[i]) { |
| | | var ellipsoid = that.map.scene.globe.ellipsoid; |
| | | var cartesian3 = new Cesium.Cartesian3(that.fileArr[i].x, that.fileArr[i].y, that.fileArr[i].z); |
| | | var cartographic = ellipsoid.cartesianToCartographic(cartesian3); |
| | | var lat = Cesium.Math.toDegrees(cartographic.latitude); |
| | | var lng = Cesium.Math.toDegrees(cartographic.longitude); |
| | | that.map.camera.flyTo({ |
| | | destination: Cesium.Cartesian3.fromDegrees(Number(lng), Number(lat), 20000) |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 切换是否解锁图片 |
| | | $('#suo').on('click', function () { |
| | | if (that.toggle) { |
| | | $('#jiesuo').attr('src', './images/suo.png'); |
| | | $('.sign-tian-hang-input').attr('disabled', 'disabled'); |
| | | $('.sign-tian-hang-textarea').attr('disabled', 'disabled'); |
| | | $('.delWenZi').remove(); |
| | | // handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN); |
| | | // handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP); |
| | | // handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | // handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | handler.destroy(); |
| | | $('.addPic').css('pointer-events', 'none'); |
| | | that.toggle = false; |
| | | } else { |
| | | $('.addPic').css('pointer-events', 'auto'); |
| | | handler = new Cesium.ScreenSpaceEventHandler(that.map.scene.canvas); |
| | | mouseEvent(); |
| | | $('#jiesuo').attr('src', './images/jiesuo.png'); |
| | | |
| | | $('.sign-tian-hang-input').removeAttr('disabled'); |
| | | $('.sign-tian-hang-textarea').removeAttr('disabled'); |
| | | $('.tipWenZi').append('<div class="delWenZi actEdit">\u5355\u51FB\u6FC0\u6D3B\u7F16\u8F91</div>\n <div class="delWenZi modifyEdit">\u91CA\u653E\u5B8C\u6210\u4FEE\u6539</div>\n <div class="delWenZi dragEdit">\u62D6\u52A8\u8BE5\u70B9\u4FEE\u6539\u4F4D\u7F6E</div>'); |
| | | that.toggle = true; |
| | | } |
| | | }); |
| | | |
| | | // 点击我的标记x关闭 |
| | | $('.sign-head').on('click', '.sign-head-th-xx', function () { |
| | | $('.jimu-widget-Sign').hide(); |
| | | for (var i = 0; i < that.arr.length; i++) { |
| | | // if ($(this).parent().parent().next().find('.wdbj-shanchu')[i].className == 'wdbj-shanchu') { |
| | | that.map.entities.removeById(that.arr[i]); |
| | | $(this).parents('.sign-head').next().find('.wdbj').remove(); |
| | | that.arrDingWei = []; |
| | | $($(this).parent().parent().next().find('.wdbj-shanchu').parent()[i]).remove(); |
| | | // } |
| | | } |
| | | if ($('.wdbj-shanchu').length == 0) { |
| | | $('.sign-content-my').show(); |
| | | } |
| | | that.onClose(); |
| | | }); |
| | | |
| | | // 点击添加标记x关闭 |
| | | $('.sign-tian-xxx').click(function () { |
| | | $('.sign-tian').hide(); |
| | | }); |
| | | |
| | | // 点击添加标记里的保存按钮关闭 |
| | | $('.jimu-widget-Sign').on('click', '.baocun', function () { |
| | | for (var i = 0; i < that.arr.length; i++) { |
| | | if ($('.wdbj').length > 0) { |
| | | if ($(this).parent().parent().find('.sign_im_text').attr('entityid') == $($('.wdbj')[i]).find('input').attr('entitydataid')) { |
| | | $($('.wdbj')[i]).find('input').val($(this).parent().parent().find('input.sign_im_text.sign-tian-hang-input').val() ? $(this).parent().parent().find('input.sign_im_text.sign-tian-hang-input').val() : "我的标记"); |
| | | $('.sign-tian').hide(); |
| | | that.onClickEntity[i].label.text = $($('.wdbj')[i]).find('input').val(); |
| | | that.arrQsrbz[i] = $('.sign-tian-hang-textarea').val(); |
| | | that.Dname[i] = $($('.wdbj-text')[i]).val(); |
| | | window.localStorage.setItem('BJDname', JSON.stringify(that.Dname)); |
| | | window.localStorage.setItem('BJDqsrbz', JSON.stringify(that.arrQsrbz)); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | $('.sign-tian').hide(); |
| | | that.updateadd.label.text = $('.sign_im_text').val() ? $('.sign_im_text').val() : '我的标记'; |
| | | }); |
| | | |
| | | // 点击添加标记里的删除按钮关闭 |
| | | $('.jimu-widget-Sign').on('click', '.shanchu', function () { |
| | | $('.sign-tian').hide(); |
| | | that.map.entities.removeById($('.sign_im_text').attr('entityid')); |
| | | for (var i = 0; i < that.arr.length; i++) { |
| | | if ($('.sign_im_text').attr('entityid') == $($('.wdbj')[i]).find('input').attr('entitydataid')) { |
| | | $($('.wdbj')[i]).hide(); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 点击我的标记里的删除按钮关闭 |
| | | $('.sign-content').on('click', '.wdbj-shanchu', function () { |
| | | if ($(this)[0].className == 'wdbj-shanchu') { |
| | | $(this).parent().remove(); |
| | | that.map.entities.removeById($(this).prev().find('input').attr('entitydataid')); |
| | | that.arrDingWei = []; |
| | | } |
| | | if ($('.wdbj-shanchu').length == 0) { |
| | | $('.sign-content-my').show(); |
| | | } |
| | | |
| | | for (var i = 0; i < that.arr.length; i++) { |
| | | if ($(this).prev().find('input').attr('entitydataid') == that.arr[i]) { |
| | | that.fileArr.splice(i, 1); |
| | | that.onClickEntity.splice(i, 1); |
| | | that.arrQsrbz.splice(i, 1); |
| | | that.Dname.splice(i, 1); |
| | | that.arr.splice(i, 1); |
| | | } |
| | | } |
| | | window.localStorage.setItem('BJD', JSON.stringify(that.fileArr)); |
| | | window.localStorage.setItem('BJDarr', JSON.stringify(that.arr)); |
| | | window.localStorage.setItem('BJDname', JSON.stringify(that.Dname)); |
| | | window.localStorage.setItem('BJDqsrbz', JSON.stringify(that.arrQsrbz)); |
| | | }); |
| | | }, |
| | | |
| | | onOpenSign: function onOpenSign(item) { |
| | | if (item == this.name) { |
| | | this.flag = true; |
| | | this.onOpen(); |
| | | } |
| | | }, |
| | | |
| | | onOpen: function onOpen() { |
| | | var that = this; |
| | | that.fileArr = []; |
| | | that.arr = []; |
| | | that.arrQsrbz = []; |
| | | that.localname = []; |
| | | that.localCartesian = []; |
| | | that.localarr = []; |
| | | that.localqsrbz = []; |
| | | if (that.flag == true && window.localStorage.getItem("BJD")) { |
| | | var addPoint = function addPoint(cartesian, id) { |
| | | that.updateadd = that.map.entities.add({ |
| | | id: id, |
| | | position: cartesian, |
| | | billboard: { //图标 |
| | | image: './images/dingwei.png', |
| | | width: 40, |
| | | height: 40, |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY |
| | | }, |
| | | label: { |
| | | text: that.str, |
| | | font: '8pt Source Han Sans CN', //字体样式 |
| | | fillColor: Cesium.Color.YELLOW, //字体颜色 |
| | | backgroundColor: Cesium.Color.AQUA, //背景颜色 |
| | | // showBackground: true, //是否显示背景颜色 |
| | | style: Cesium.LabelStyle.FILL, //label样式 |
| | | outlineWidth: 2, |
| | | verticalOrigin: Cesium.VerticalOrigin.CENTER, //垂直位置 |
| | | horizontalOrigin: Cesium.HorizontalOrigin.CENTER, //水平位置 |
| | | pixelOffset: new Cesium.Cartesian2(0, -30), //偏移 |
| | | heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY |
| | | } |
| | | |
| | | }); |
| | | that.arr.push(id); |
| | | if (that.onClickEntity.indexOf(that.updateadd) == -1) { |
| | | that.onClickEntity.push(that.updateadd); |
| | | } |
| | | }; |
| | | |
| | | that.localCartesian = JSON.parse(window.localStorage.getItem("BJD")); |
| | | that.localarr = JSON.parse(window.localStorage.getItem("BJDarr")); |
| | | that.localname = JSON.parse(window.localStorage.getItem("BJDname")); |
| | | that.localqsrbz = JSON.parse(window.localStorage.getItem("BJDqsrbz")); |
| | | for (var i = 0; i < JSON.parse(window.localStorage.getItem("BJD")).length; i++) { |
| | | that.fileArr.push(JSON.parse(window.localStorage.getItem("BJD"))[i]); |
| | | addPoint(JSON.parse(window.localStorage.getItem("BJD"))[i], that.localarr[i]); |
| | | |
| | | if (that.localqsrbz) { |
| | | $('.sign-tian-hang-textarea').val(that.localqsrbz[i]); |
| | | $('.sign_im_text').val(that.localname[i]); |
| | | $('.sign-content').append('<div class = \'wdbj\'><div class = \'dingWeiFei\'><input class = \'wdbj-text\' disabled value = ' + that.localname[i] + ' entitydataid = ' + that.localarr[i] + ' ></input></div><img class=\'wdbj-shanchu\' src=\'./images/shanchu.png\'></img></div>'); |
| | | that.onClickEntity[i].label.text = that.localname[i]; |
| | | that.Dname.push(JSON.parse(window.localStorage.getItem("BJDname"))[i]); |
| | | that.arrQsrbz.push(JSON.parse(window.localStorage.getItem('BJDqsrbz'))[i]); |
| | | that.updateadd.label.text = that.localname[i]; |
| | | $('.sign-tian-hang-textarea').val(that.localqsrbz[i]); |
| | | } |
| | | } |
| | | window.localStorage.setItem('BJD', JSON.stringify(that.fileArr)); |
| | | window.localStorage.setItem('BJDarr', JSON.stringify(that.arr)); |
| | | if ($('.wdbj').length > 0) { |
| | | $('.sign-content-my').hide(); |
| | | } |
| | | ; |
| | | } |
| | | }, |
| | | |
| | | onClose: function onClose() { |
| | | //面板关闭的时候触发 (when this panel is closed trigger) |
| | | this.flag = false; |
| | | }, |
| | | |
| | | onMinimize: function onMinimize() { |
| | | this.resize(); |
| | | }, |
| | | |
| | | onMaximize: function onMaximize() { |
| | | this.resize(); |
| | | }, |
| | | |
| | | resize: function resize() {}, |
| | | |
| | | destroy: function destroy() { |
| | | //销毁的时候触发 |
| | | //todo |
| | | //do something before this func |
| | | } |
| | | |
| | | }); |
| | | }); |
| New file |
| | |
| | | .jimu-widget-Sign { |
| | | width: 100%; |
| | | height: 320px; |
| | | background-color: #323a36; |
| | | font-size: 14px; |
| | | border: 1px solid rgb(69, 154, 251); |
| | | /* opacity : .8; */ |
| | | color: rgb(238, 235, 235); |
| | | font-size: 16px; |
| | | display: none; |
| | | } |
| | | |
| | | #sign_table { |
| | | position: relative; |
| | | } |
| | | |
| | | |
| | | |
| | | .sign-head { |
| | | width: 320px; |
| | | height: 90px; |
| | | /* background-color: red; */ |
| | | } |
| | | |
| | | .sign-head-th { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | width: 320px; |
| | | height: 40px; |
| | | /* background-color: blue; */ |
| | | padding: 0 10px; |
| | | border-bottom: 1px solid #377bc9; |
| | | |
| | | } |
| | | |
| | | .sign-head-th-pic { |
| | | margin-top: 4px; |
| | | width: 20px; |
| | | height: 18px; |
| | | background: url(../../../images/toolbox.png ) no-repeat 0 -63px; |
| | | } |
| | | |
| | | .sign-head-th-biaoji { |
| | | margin-left: -180px; |
| | | color: white; |
| | | } |
| | | |
| | | .sign-head-th-xx { |
| | | font-size: 30px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .sign-head-td { |
| | | margin-top: 5px; |
| | | overflow: hidden; |
| | | height: 50px; |
| | | } |
| | | |
| | | .sign-head-td-ul { |
| | | margin: 0; |
| | | padding: 0 10px; |
| | | list-style: none; |
| | | display: flex; |
| | | justify-content: start; |
| | | } |
| | | |
| | | .sign-head-td-ul li { |
| | | |
| | | margin-right: 10px; |
| | | text-align: center; |
| | | padding: 5px 0 0 0; |
| | | } |
| | | |
| | | .sign-head-td-ul-border { |
| | | cursor: pointer; |
| | | width: 30px; |
| | | height: 30px; |
| | | margin-top: 6px; |
| | | border: 1px solid white; |
| | | } |
| | | |
| | | .dakai { |
| | | position: relative; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .file { |
| | | position: absolute; |
| | | right: 0; |
| | | top: 0; |
| | | background-color: red; |
| | | width: 30px; |
| | | height: 30px; |
| | | opacity: 0; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .sign-head-td-ul img { |
| | | padding-bottom: 5px; |
| | | width: 20px; |
| | | height: 20px; |
| | | } |
| | | |
| | | .sign-content { |
| | | width: 316px; |
| | | height: 267px; |
| | | border: 1px solid #fff; |
| | | margin-left: 1px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .sign-content-mc { |
| | | /* position : absolute; */ |
| | | width: 315px; |
| | | height: 40px; |
| | | border: 1px solid #fff; |
| | | display: flex; |
| | | padding-left: 10px; |
| | | } |
| | | |
| | | .sign-content-mc-hezi { |
| | | width: 315px; |
| | | position: relative; |
| | | line-height: 40px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .sign-content-mc-hezi .topPic, |
| | | .bottomPic { |
| | | cursor: pointer; |
| | | right: 0; |
| | | position: absolute; |
| | | background: url(../../images/sign/-shanglajiantou.png) no-repeat; |
| | | width: 15px; |
| | | height: 15px; |
| | | } |
| | | |
| | | .sign-content-mc-hezi .bottomPic { |
| | | top: 17px; |
| | | } |
| | | |
| | | .sign-content-mc-hezi .topPic { |
| | | top: 10px; |
| | | } |
| | | |
| | | .sign-content-mc .caozuo { |
| | | width: 74px; |
| | | cursor: pointer; |
| | | margin-left: 10px; |
| | | border-left: 1px solid #fff; |
| | | line-height: 40px; |
| | | padding-left: 10px; |
| | | } |
| | | |
| | | .sign-content-my { |
| | | width: 314px; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | text-align: center; |
| | | border-bottom: 1px solid #fff; |
| | | } |
| | | |
| | | .wdbj { |
| | | width: 100%; |
| | | /* background-color: red; */ |
| | | height: 40px; |
| | | border-bottom: 1px solid #fff; |
| | | display: flex; |
| | | justify-content: space-around; |
| | | align-items: center; |
| | | } |
| | | |
| | | .wdbj:hover { |
| | | background-color: #3f4854; |
| | | } |
| | | |
| | | .wdbj .wdbj-text { |
| | | width: 248px; |
| | | line-height: 37px; |
| | | border: none; |
| | | background-color: #323a36; |
| | | color: #fff; |
| | | padding-left: 10px; |
| | | font-size: 15px; |
| | | border-right: 1px solid #fff; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .wdbj .wdbj-text:hover { |
| | | background-color: #3f4854; |
| | | } |
| | | |
| | | .wdbj-shanchu { |
| | | line-height: 40px; |
| | | padding-right: 10px; |
| | | height: 20px; |
| | | } |
| | | |
| | | .danji, |
| | | .actEdit, |
| | | .modifyEdit, |
| | | .dragEdit { |
| | | padding: 5px; |
| | | background-color: #141f18; |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | display : none; |
| | | border-radius: 5px; |
| | | } |
| | | |
| | | .actEdit { |
| | | top: 30px; |
| | | } |
| | | |
| | | .modifyEdit { |
| | | top: 60px; |
| | | } |
| | | |
| | | .dragEdit { |
| | | top: 90px; |
| | | } |
| | | |
| | | .sign-tian { |
| | | display: none; |
| | | position: fixed; |
| | | top: 50px; |
| | | left: 20px; |
| | | width: 280px; |
| | | height: 0px; |
| | | background-color: red; |
| | | } |
| | | |
| | | .sign-tian-thead { |
| | | overflow: hidden; |
| | | width: 100%; |
| | | height: 40px; |
| | | background-color: #29434a; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 0 8px; |
| | | border-bottom: 1px solid #47605b; |
| | | } |
| | | |
| | | .sign-tian-thead span { |
| | | font-weight: 500 |
| | | } |
| | | |
| | | .sign-tian-thead span:nth-child(2) { |
| | | font-size: 30px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .sign-tian-thead span:nth-child(2):hover { |
| | | color: red; |
| | | } |
| | | |
| | | .sign-tian-tbody { |
| | | width: 100%; |
| | | padding: 10px; |
| | | background-color: #434b54; |
| | | } |
| | | |
| | | .sign-tian-hang { |
| | | width: 100%; |
| | | height: 60px; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | |
| | | .sign-tian-hang-input { |
| | | margin-top: 5px; |
| | | background-color: #3f4954; |
| | | line-height: 25px; |
| | | width: 100%; |
| | | border: none; |
| | | color: #999; |
| | | padding: 5px; |
| | | font-size: 10px; |
| | | color: #fff; |
| | | } |
| | | |
| | | .sign-tian-hang-textarea { |
| | | margin-top: 5px; |
| | | height: 60px; |
| | | background-color: #3f4954; |
| | | font-size: 13px; |
| | | color: #999; |
| | | padding: 5px; |
| | | border: none; |
| | | resize: none; |
| | | width: 100%; |
| | | color: #fff; |
| | | font-family: '黑体'; |
| | | } |
| | | |
| | | .sign-tian-bao { |
| | | border-radius: 5px; |
| | | padding: 20px; |
| | | height: 30px; |
| | | text-align: center; |
| | | margin: 10px 0; |
| | | } |
| | | |
| | | .sign-tian-bao .baocun, |
| | | .sign-tian-bao .shanchu { |
| | | background-color: #385973; |
| | | color: #fff; |
| | | border: none; |
| | | line-height: 25px; |
| | | border-radius: 5px; |
| | | } |
| | | |
| | | .sign-tian-bao .shanchu { |
| | | background-color: #6a525a; |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | |
| | | .sanJiaoXing-pic { |
| | | position: absolute; |
| | | left: 50%; |
| | | margin-left: -10px; |
| | | width: 0; |
| | | height: 0; |
| | | border-top: 17px solid #3f4954; |
| | | border-left: 10px solid transparent; |
| | | border-right: 10px solid transparent |
| | | } |
| | | |
| | | /* .addPic { |
| | | pointer-events: none; |
| | | } */ |
| New file |
| | |
| | | { |
| | | "name": "Sign", |
| | | "2D": true, |
| | | "3D": true, |
| | | "platform": "HTML", |
| | | "version": "2.10", |
| | | "wabVersion": "2.10", |
| | | "author": "jxdnosng", |
| | | "description": "", |
| | | "copyright": "", |
| | | "license": "", |
| | | "properties": { |
| | | "hasConfig": false, |
| | | "inPanel": false, |
| | | "hasVersionManager": false |
| | | } |
| | | } |
| New file |
| | |
| | | define( |
| | | ({ |
| | | _widgetLabel: "goSign" |
| | | }) |
| | | ); |
| New file |
| | |
| | | define({ |
| | | root: ({ |
| | | _widgetLabel: "Sign" |
| | | }), |
| | | "es": 1, |
| | | "zh-cn": 1 |
| | | }); |
| New file |
| | |
| | | define( |
| | | ({ |
| | | _widgetLabel: "我的标记" |
| | | }) |
| | | ); |
| | |
| | | name: 'Tool', |
| | | layers: {}, |
| | | startup: function () { |
| | | |
| | | // 暴露在外的接口 |
| | | topic.subscribe("closeTool", lang.hitch(this, this.closeToolBox)); |
| | | this.inherited(arguments); |
| | |
| | | $('.jimu-widget-FlyRoute').hide(); |
| | | $('.jimu-widget-Sign').hide(); |
| | | $('.jimu-widget-DynamicRiver').hide(); |
| | | $('.jimu-widget-Screen').hide(); |
| | | $('.jimu-widget-Rolling').hide(); |
| | | $('.jimu-widget-Plot').hide(); |
| | | $('.jimu-widget-Measurement').hide(); |
| | | $('.tool-y-box').toggle() |
| | | } else if (calssName == 'Measurement-tool') { |
| | |
| | | $('.jimu-widget-Measurement').show(); |
| | | $('.jimu-widget-Sign').hide(); |
| | | $('.jimu-widget-FlyRoute').hide(); |
| | | $('.jimu-widget-Screen').hide(); |
| | | $('.jimu-widget-Plot').hide(); |
| | | $('.jimu-widget-DynamicRiver').hide(); |
| | | $('.tool-y-box').toggle() |
| | | $('.tool-y-box').toggle(); |
| | | $('.jimu-widget-Rolling').hide(); |
| | | } |
| | | else if (calssName == 'sign-tool') { |
| | | else if (calssName == 'Sign-tool') { |
| | | // 我的标记 |
| | | topic.publish('openSign', 'Sign'); |
| | | $('.jimu-widget-Rolling').hide(); |
| | | $('.jimu-widget-Location').hide(); |
| | | $('.jimu-widget-Sign').show(); |
| | | $('.jimu-widget-Measurement').hide(); |
| | | $('.jimu-widget-FlyRoute').hide(); |
| | | $('.jimu-widget-Screen').hide(); |
| | | $('.jimu-widget-Plot').hide(); |
| | | $('.jimu-widget-DynamicRiver').hide(); |
| | | $('.tool-y-box').toggle() |
| | | } |
| | |
| | | $('.jimu-widget-Rolling').show(); |
| | | $('#widgets_Rolling_Widget_17').show(); |
| | | $('.jimu-widget-Measurement').hide(); |
| | | $('.jimu-widget-Screen').hide(); |
| | | $('.jimu-widget-Plot').hide(); |
| | | $('.jimu-widget-FlyRoute').hide(); |
| | | $('.jimu-widget-DynamicRiver').hide(); |
| | | $('.tool-y-box').toggle(); |
| | |
| | | $('.jimu-widget-CoorPosition').show(); |
| | | $('.jimu-widget-Location').hide(); |
| | | $('.jimu-widget-Measurement').hide(); |
| | | $('.jimu-widget-Rolling').hide(); |
| | | $('.jimu-widget-Screen').hide(); |
| | | $('.jimu-widget-Sign').hide(); |
| | | $('.jimu-widget-FlyRoute').hide(); |
| | | $('.jimu-widget-Plot').hide(); |
| | | $('.jimu-widget-DynamicRiver').hide(); |
| | | $('.tool-y-box').toggle() |
| | | } |
| | |
| | | // 地图打印 |
| | | $('.jimu-widget-Location').hide(); |
| | | $('.jimu-widget-MapPrinting').show(); |
| | | $('.jimu-widget-Rolling').hide(); |
| | | $('.jimu-widget-CoorPosition').hide(); |
| | | $('.jimu-widget-Measurement').hide(); |
| | | $('.jimu-widget-Sign').hide(); |
| | | $('.jimu-widget-FlyRoute').hide(); |
| | | $('.jimu-widget-Plot').hide(); |
| | | $('.jimu-widget-DynamicRiver').hide(); |
| | | $('.jimu-widget-Screen').hide(); |
| | | $('.tool-y-box').toggle() |
| | | } |
| | | else if (calssName == 'RouteNavigate-tool') { |
| | |
| | | $('.jimu-widget-RouteNavigate').show(); |
| | | $('.jimu-widget-MapPrinting').hide(); |
| | | $('.jimu-widget-CoorPosition').hide(); |
| | | $('.jimu-widget-Rolling').hide(); |
| | | $('.jimu-widget-Measurement').hide(); |
| | | $('.jimu-widget-Sign').hide(); |
| | | $('.jimu-widget-Plot').hide(); |
| | | $('.jimu-widget-FlyRoute').hide(); |
| | | $('.jimu-widget-DynamicRiver').hide(); |
| | | $('.jimu-widget-Screen').hide(); |
| | | $('.tool-y-box').toggle() |
| | | } |
| | | else if (calssName == 'scene-tool') { |
| | |
| | | $('.jimu-widget-MapPrinting').hide(); |
| | | $('.jimu-widget-CoorPosition').hide(); |
| | | $('.jimu-widget-Measurement').hide(); |
| | | $('.jimu-widget-Rolling').hide(); |
| | | $('.jimu-widget-Sign').hide(); |
| | | $('.jimu-widget-FlyRoute').hide(); |
| | | $('.jimu-widget-DynamicRiver').hide(); |
| | | $('.jimu-widget-scene').show(); |
| | | $('.jimu-widget-Screen').hide(); |
| | | $('.jimu-widget-Plot').hide(); |
| | | $('.tool-y-box').toggle() |
| | | } |
| | | else if (calssName == 'Plot-tool') { |
| | |
| | | $('.jimu-widget-MapPrinting').hide(); |
| | | $('.jimu-widget-CoorPosition').hide(); |
| | | $('.jimu-widget-Measurement').hide(); |
| | | $('.jimu-widget-Rolling').hide(); |
| | | $('.jimu-widget-Sign').hide(); |
| | | $('.jimu-widget-FlyRoute').hide(); |
| | | $('.jimu-widget-DynamicRiver').hide(); |
| | | $('.jimu-widget-scene').hide(); |
| | | $('.jimu-widget-Plot').show(); |
| | | $('.jimu-widget-Screen').hide(); |
| | | $('.tool-y-box').toggle() |
| | | } |
| | | else if (calssName == 'Screen-tool') { |
| | |
| | | $('.jimu-widget-DynamicRiver').hide(); |
| | | $('.tool-y-box').toggle(); |
| | | $('.jimu-widget-Screen').show(); |
| | | $('.jimu-widget-Plot').hide(); |
| | | } |
| | | else if (calssName == 'Plots-tool') { |
| | | window.dcViewer.contextMenu.enable = false; |
| | | // 要素标绘 |
| | | $('.jimu-widget-RouteNavigate').hide(); |
| | | $('.jimu-widget-MapPrinting').hide(); |
| | | $('.jimu-widget-CoorPosition').hide(); |
| | | $('.jimu-widget-Measurement').hide(); |
| | | $('.jimu-widget-Rolling').hide(); |
| | | $('.jimu-widget-Sign').hide(); |
| | | $('.jimu-widget-FlyRoute').hide(); |
| | | $('.jimu-widget-DynamicRiver').hide(); |
| | | $('.jimu-widget-scene').hide(); |
| | | $('.jimu-widget-Plot').hide(); |
| | | $('.jimu-widget-Plots').show(); |
| | | $('.jimu-widget-Screen').hide(); |
| | | $('.tool-y-box').toggle() |
| | | } |
| | | |
| | | |