Merge branch 'master' of http://xny.yj-3d.com:3000/zh/sdk4.0_new
This commit is contained in:
		| @ -86,7 +86,7 @@ class RoutePlanning extends Base { | ||||
|       width: 32, | ||||
|       height: 32 | ||||
|     } | ||||
|     // this.edit(true) | ||||
|     this.edit(true) | ||||
|     this.clear() | ||||
|   } | ||||
|  | ||||
| @ -194,29 +194,31 @@ class RoutePlanning extends Base { | ||||
|       this._element_style = document.createElement('style') | ||||
|       this._element_style.type = 'text/css' | ||||
|       this._element_style.setAttribute('data-name', 'YJ_style_dialog') | ||||
|       this._element_style.innerHTML = css() | ||||
|       this._DialogObject = await new Dialog(this.sdk.viewer._container, { | ||||
|         title: '路径规划', | ||||
|         closeCallBack: () => { | ||||
|           this.tip && this.tip.destroy() | ||||
|           this.event && this.event.destroy() | ||||
|           this.Dialog.closeCallBack && this.Dialog.closeCallBack() | ||||
|         } | ||||
|       }) | ||||
|       await this._DialogObject.init() | ||||
|       // this._element_style.innerHTML = css() | ||||
|       // this._DialogObject = await new Dialog(this.sdk.viewer._container, { | ||||
|       //   title: '路径规划', | ||||
|       //   closeCallBack: () => { | ||||
|       //     this.tip && this.tip.destroy() | ||||
|       //     this.event && this.event.destroy() | ||||
|       //     this.Dialog.closeCallBack && this.Dialog.closeCallBack() | ||||
|       //   } | ||||
|       // }) | ||||
|       // await this._DialogObject.init() | ||||
|  | ||||
|       let div = document.createElement('div') | ||||
|       div.style.position = 'absolute' | ||||
|       div.style.left = '24px' | ||||
|       div.style.flet = '0' | ||||
|       div.style.display = 'flex' | ||||
|       this._DialogObject.footAppChild(div) | ||||
|       // let div = document.createElement('div') | ||||
|       // div.style.position = 'absolute' | ||||
|       // div.style.left = '24px' | ||||
|       // div.style.flet = '0' | ||||
|       // div.style.display = 'flex' | ||||
|       // document.getElementsByClassName('RoutePlanning')[0].getElementsByClassName('foot')[0].appendChild(div) | ||||
|       // // this._DialogObject.footAppChild(div) | ||||
|  | ||||
|       let queryBtn = document.createElement('button') | ||||
|       queryBtn.className = 'default' | ||||
|       queryBtn.innerHTML = | ||||
|         '<svg class="icon-query"><use xlink:href="#yj-icon-query"></use></svg>查询' | ||||
|       queryBtn.style.width = 'auto' | ||||
|       // let queryBtn = document.createElement('button') | ||||
|       // queryBtn.className = 'default' | ||||
|       // queryBtn.innerHTML = | ||||
|       //   '<svg class="icon-query"><use xlink:href="#yj-icon-query"></use></svg>查询' | ||||
|       // queryBtn.style.width = 'auto' | ||||
|       let queryBtn = document.getElementById('routeQuery') | ||||
|       queryBtn.addEventListener('click', () => { | ||||
|         if ( | ||||
|           (this.startLng || this.startLng === 0) && | ||||
| @ -271,24 +273,25 @@ class RoutePlanning extends Base { | ||||
|           this.tools.message({ type: 'warning', text: '请先设置起点和终点坐标!' }) | ||||
|         } | ||||
|       }) | ||||
|       div.appendChild(queryBtn) | ||||
|       // div.appendChild(queryBtn) | ||||
|  | ||||
|       let cleanBtn = document.createElement('button') | ||||
|       cleanBtn.className = 'default' | ||||
|       cleanBtn.innerHTML = | ||||
|         '<svg class="icon-route"><use xlink:href="#yj-icon-route"></use></svg>清除路线' | ||||
|       cleanBtn.style.width = 'auto' | ||||
|       cleanBtn.style.marginLeft = '10px' | ||||
|       // let cleanBtn = document.createElement('button') | ||||
|       // cleanBtn.className = 'default' | ||||
|       // cleanBtn.innerHTML = | ||||
|       //   '<svg class="icon-route"><use xlink:href="#yj-icon-route"></use></svg>清除路线' | ||||
|       // cleanBtn.style.width = 'auto' | ||||
|       // cleanBtn.style.marginLeft = '10px' | ||||
|       let cleanBtn = document.getElementById('clearRoute') | ||||
|       cleanBtn.addEventListener('click', () => { | ||||
|         this.clear() | ||||
|       }) | ||||
|       div.appendChild(cleanBtn) | ||||
|       // div.appendChild(cleanBtn) | ||||
|  | ||||
|       document.getElementsByTagName('head')[0].appendChild(this._element_style) | ||||
|       let contentElm = document.createElement('div') | ||||
|       contentElm.innerHTML = html() | ||||
|       this._DialogObject.contentAppChild(contentElm) | ||||
|  | ||||
|       // let contentElm = document.createElement('div') | ||||
|       // contentElm.innerHTML = html() | ||||
|       // this._DialogObject.contentAppChild(contentElm) | ||||
|       let contentElm = document.getElementsByClassName('RoutePlanning')[0] | ||||
|       if (this.options.gps) { | ||||
|         let locateCurrentBtn = document.createElement('button') | ||||
|         locateCurrentBtn.innerHTML = '当前位置' | ||||
| @ -300,7 +303,7 @@ class RoutePlanning extends Base { | ||||
|         let startColElm = contentElm.getElementsByClassName('start-col')[0] | ||||
|         startColElm.appendChild(locateCurrentBtn) | ||||
|  | ||||
|         let endPickBtnElm = this._DialogObject._element.body.getElementsByClassName( | ||||
|         let endPickBtnElm = contentElm._element.body.getElementsByClassName( | ||||
|           'end-pick-btn' | ||||
|         )[0] | ||||
|         endPickBtnElm.style.marginRight = '91px' | ||||
| @ -506,7 +509,7 @@ class RoutePlanning extends Base { | ||||
|   /** | ||||
|    * 拾取起点 | ||||
|    */ | ||||
|   pickStartPos(e) { | ||||
|   pickStartPos(func) { | ||||
|     this.tip && this.tip.destroy() | ||||
|     this.event && this.event.destroy() | ||||
|     this.tip = new MouseTip('左键选择起点坐标,右键取消', this.sdk) | ||||
| @ -522,6 +525,7 @@ class RoutePlanning extends Base { | ||||
|       let pos84 = this.cartesian3Towgs84(cartesian, this.sdk.viewer) | ||||
|       this.startLng = pos84.lng | ||||
|       this.startLat = pos84.lat | ||||
|       func(pos84) | ||||
|       !this.startEntity && | ||||
|         (this.startEntity = this.viewer.entities.add( | ||||
|           new Cesium.Entity({ | ||||
| @ -573,7 +577,7 @@ class RoutePlanning extends Base { | ||||
|   /** | ||||
|    * 拾取终点 | ||||
|    */ | ||||
|   pickEndPos(e) { | ||||
|   pickEndPos(func) { | ||||
|     this.tip && this.tip.destroy() | ||||
|     this.event && this.event.destroy() | ||||
|     this.tip = new MouseTip('左键选择终点坐标,右键取消', this.sdk) | ||||
| @ -589,6 +593,7 @@ class RoutePlanning extends Base { | ||||
|       let pos84 = this.cartesian3Towgs84(cartesian, this.sdk.viewer) | ||||
|       this.endLng = pos84.lng | ||||
|       this.endLat = pos84.lat | ||||
|       func(pos84) | ||||
|       !this.endEntity && | ||||
|         (this.endEntity = this.viewer.entities.add( | ||||
|           new Cesium.Entity({ | ||||
|  | ||||
		Reference in New Issue
	
	Block a user