1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- (function(b){if(!b)throw Error("\u8bf7\u5148\u5f15\u5165GeoGlobe\u6846\u67b6\uff01");b.Extends={};b.Extends.VERSION_NUMBER="GeoGlobeJSAPI 2020 -- $Version: 1.3.2 build-20020312 $"})(GeoGlobe||window.GeoGlobe);
- GeoGlobe.Extends.SplitMap=GeoGlobe.Class4OL({_mapArr:[],_fns:[],initialize:function(b){if(b.length<2||!b)throw Error("\u81f3\u5c11\u9700\u89812\u7ec4\u5730\u56fe");this._createMap(b)},_createMap:function(b){for(var f=0;f<b.length;f++)this._mapArr.push(b[f]instanceof mapboxgl.FreeCRSMap?b[f]:new GeoGlobe.Map(b[f]));this._syncMaps()},_syncMaps:function(){var b=this;this._mapArr.forEach(function(f,c){var a=b._mapArr.filter(function(a,b){return b!==c});b._fns[c]=b._sync.bind(b,f,a)});this._on()},_sync:function(b,
- f){this._off();this._moveToMapPosition(b,f);this._on()},_on:function(){var b=this;this._mapArr.forEach(function(f,c){f.on("move",b._fns[c])})},_off:function(){var b=this;this._mapArr.forEach(function(f,c){f.off("move",b._fns[c])})},_moveToMapPosition:function(b,f){var c=b.getCenter(),a=b.getZoom(),e=b.getBearing(),d=b.getPitch();f.forEach(function(b){b.jumpTo({center:c,zoom:a,bearing:e,pitch:d})})},getMap:function(b){if(this._mapArr[b])return this._mapArr[b];else if(b)throw Error("\u5f53\u524d\u6682\u65e0\u5206\u5c4f\u5730\u56fe");
- else return this._mapArr[0]},on:function(){this._on()},off:function(){this._off()},destroy:function(){if(this._mapArr.length){for(var b=0;b<this._mapArr.length;b++)this._mapArr[b].getContainer().remove();this._mapArr=[]}},CLASS_NAME:"GeoGlobe.Extends.SplitMap"});
- GeoGlobe.Extends.LayerControl=GeoGlobe.Class4OL({map:null,options:null,controlLayers:null,initialize:function(b,f){this.map=b;f=f||{};f=GeoGlobe.Util.pick(f,["top","left","right","bottom"]);GeoGlobe.Util.applyDefaults(f,{top:void 0,left:void 0,right:void 0,bottom:void 0});this.options=f;for(var c=this.map.getStyle().layers,a={},e=0;e<c.length;e++){var d=c[e].source,g=this.map.getSource(d),h=c[e].id;g.type==="vector"?(a.hasOwnProperty(d)||(a[d]=[]),a[d].push(c[e])):a[h]=c[e]}this.controlLayers=a},
- render:function(){this._createDom();this._bindEvent();console.log("\u521d\u59cb\u5c42\u7ea7",this.map.style._order)},_bindEvent:function(){var b=this,f=this.controlLayers;this._clickEvent=function(c){c=c||window.event;c=c.target||c.srcElement;c.getAttribute("layerControl")==="GeoGlobe-layer-close"&&b.destroy();if(c.getAttribute("layerControl")==="layerShow"){for(var a=c.parentNode;a.getAttribute("layerControl")!="GeoGlobe-layer-item";)a=a.parentNode;var e=a.getAttribute("layerid"),d=eval(a.getAttribute("isVTS"));
- if(c.classList.contains("title-icon-close")){if(d)for(var a=f[e],g=0;g<a.length;g++)b.map.showLayer(a[g].id);else b.map.showLayer(e);c.classList.remove("title-icon-close");c.classList.add("title-icon-open")}else{if(d){a=f[e];for(g=0;g<a.length;g++)b.map.hideLayer(a[g].id)}else b.map.hideLayer(e);c.classList.remove("title-icon-open");c.classList.add("title-icon-close")}}if(c.getAttribute("layerControl")==="editZindex"){for(var h=c.getAttribute("edit"),a=c.parentNode;a.getAttribute("layerControl")!=
- "GeoGlobe-layer-item";)a=a.parentNode;var e=a.getAttribute("layerid"),d=eval(a.getAttribute("isVTS")),i,j;if(d)i=f[e],j=i[0].id;var g=a.parentNode,n=g.children[0].getAttribute("layerid"),q=eval(g.children[0].getAttribute("isVTS")),k;if(q)k=f[n],k=k[k.length-1].id;var p=g.children[g.children.length-1].getAttribute("layerid"),r=eval(g.children[g.children.length-1].getAttribute("isVTS")),o;if(r)o=f[p],o=o[0].id;switch(h){case "top":if(q)if(d){for(h=0;h<i.length;h++)b.map.moveLayer(i[h].id,k);b.map.moveLayer(k,
- j)}else b.map.moveLayer(e,k),b.map.moveLayer(k,e);else if(d){for(h=0;h<i.length;h++)b.map.moveLayer(i[h].id,n);b.map.moveLayer(n,j)}else b.map.moveLayer(e,n),b.map.moveLayer(n,e);g.prepend(a);break;case "up":i=b._previousNode(a);var l=i.getAttribute("layerid");k=eval(i.getAttribute("isVTS"));var m;k&&(m=f[l]);if(k)for(h=0;h<m.length;h++)d?b.map.moveLayer(m[h].id,j):b.map.moveLayer(m[h].id,e);else d?b.map.moveLayer(l,j):b.map.moveLayer(l,e);g.insertBefore(a,i);break;case "down":j=b._nextNode(a);m=
- j.getAttribute("layerid");if(k=eval(j.getAttribute("isVTS")))l=f[m],l=l[0].id;if(k)if(d)for(h=0;h<i.length;h++)b.map.moveLayer(i[h].id,l);else b.map.moveLayer(e,l);else if(d)for(h=0;h<i.length;h++)b.map.moveLayer(i[h].id,m);else b.map.moveLayer(e,m);g.insertBefore(j,a);break;case "bottom":if(r)if(d)for(h=0;h<i.length;h++)b.map.moveLayer(i[h].id,o);else b.map.moveLayer(e,o);else if(d)for(h=0;h<i.length;h++)b.map.moveLayer(i[h].id,p);else b.map.moveLayer(e,p);g.append(a)}b._ctrLayerShowBtn();console.log("\u5c42\u7ea7",
- b.map.style._order)}if(c.getAttribute("layerControl")==="editOpacity"){i=document.getElementsByClassName("GeoGlobe-layer-opacity");for(g=0;g<i.length;g++)if(i[g].getAttribute("layerControl")==="GeoGlobe-layer-opacity"){for(a=c.parentNode;a.getAttribute("layerControl")!="GeoGlobe-layer-item";)a=a.parentNode;e=a.getAttribute("layerid");d=eval(a.getAttribute("isVTS"));i[g].style.top=a.offsetTop-a.parentNode.scrollTop+"px";i[g].style.display="block";i[g].firstElementChild.setAttribute("layerid",e);i[g].firstElementChild.setAttribute("isVTS",
- d);if(d)e=f[e][0].id;a=b.map.getLayer(e);a=b.map.getPaintProperty(a.id,a.type+"-opacity");e=100;a&&(e=a*100);i[g].firstElementChild.value=e;i[g].firstElementChild.style.backgroundSize=e+"% 100%";break}}if(c.getAttribute("layerControl")==="layer-opacity-close"){i=document.getElementsByClassName("GeoGlobe-layer-opacity");for(g=0;g<i.length;g++)if(i[g].getAttribute("layerControl")==="GeoGlobe-layer-opacity")i[g].style.display="none"}};document.body.addEventListener("click",this._clickEvent);this._inputEvent=
- function(c){var c=c||window.event,a=c.target||c.srcElement;if(a.getAttribute("layerControl")==="layer-opacity"){var e=a.getAttribute("layerid"),d=eval(a.getAttribute("isVTS"));a.oninput=function(c){a.style.backgroundSize=c.target.value+"% 100%";if(d)for(var h=f[e],i=0;i<h.length;i++)h[i].type!=="symbol"&&b.map.setOpacity(h[i].id,c.target.value/100);else b.map.setOpacity(e,c.target.value/100)}}};document.body.addEventListener("input",this._inputEvent,!0)},_nextNode:function(b){if(!b.nextSibling)return!1;
- return b.nextElementSibling||(b.nextSibling.nodeType==1?b.nextSibling:nextNode(b.nextSibling))},_previousNode:function(b){if(!b.previousSibling)return!1;return b.previousElementSibling||(b.previousSibling.nodeType==1?b.previousSibling:previousNode(b.previousSibling))},_ctrLayerShowBtn:function(){for(var b=document.querySelectorAll("div[layerControl='GeoGlobe-layer-item']"),f=0;f<b.length;f++){for(var c=b[f].firstElementChild.lastElementChild.children,a=[],e=0;e<c.length;e++)c[e].getAttribute("layerControl")===
- "editZindex"&&a.push(c[e]);for(c=0;c<a.length;c++)a[c].style.display="";if(f==0)a[0].style.display="none",a[1].style.display="none";if(f==b.length-1)a[2].style.display="none",a[3].style.display="none"}},_subString:function(b,f){var c=0,a="",e=/[^\x00-\xff]/g,d="",g=b.replace(e,"**").length;if(g>f){for(var h=0;h<g;h++){d=b.charAt(h).toString();d.match(e)!=null?c+=2:c++;if(c>f)break;a+=d}g>f&&(a+="...")}else a=b;return a},_createDom:function(){var b=this.options,f=document.createElement("div");f.classList.add("GeoGlobe-layer-list");
- f.setAttribute("layerControl","GeoGlobe-layer-list");for(var c in b){var a=b[c];a!==""&&typeof a==="number"&&(a+="px");f.style[c]=a}b=document.createElement("div");b.classList.add("GeoGlobe-layer-title");b.innerHTML='<span class="GeoGlobe-layer-name">\u56fe\u5c42\u7ba1\u7406</span><div class="GeoGlobe-layer-close" layerControl="GeoGlobe-layer-close" title="\u5173\u95ed"></div>';f.appendChild(b);b=document.createElement("article");b.classList.add("GeoGlobe-layer-opacity");b.setAttribute("layerControl",
- "GeoGlobe-layer-opacity");b.innerHTML='<input type="range" min="1" max="100" step="1" layerControl="layer-opacity" /><span class="layer-opacity-close" layerControl="layer-opacity-close"></span>';f.appendChild(b);b=document.createElement("div");b.classList.add("GeoGlobe-layer-items");c="";for(var a=this.controlLayers,e=Object.keys(a),d=e.length-1;d>=0;d--){var g=a[e[d]],h=!1;GeoGlobe.Util.isArray(g)&&(h=!0);var i='<span class="layer-edit-icon icon-opacity" layerControl="editOpacity" title="\u900f\u660e\u5ea6"></span>';
- if(h){for(var j=!1;0<g.lengrh;d++)if(g[0].type!="symbol"){j=!0;break}j||(i="")}g=this._subString(e[d],15);c+='<div class="GeoGlobe-layer-item" layercontrol="GeoGlobe-layer-item" layerid='+e[d]+" isVTS="+h+'><div class="GeoGlobe-layer-content"><div class="layer-title"><span class="title-icon title-icon-open" layercontrol="layerShow"></span><span class="layer-name" title='+e[d]+">"+g+'</span></div><div class="layer-edit"><span class="layer-edit-icon icon-top" layerControl="editZindex" edit="top" title="\u7f6e\u9876"></span><span class="layer-edit-icon icon-up" layerControl="editZindex" edit="up" title="\u4e0a\u79fb"></span><span class="layer-edit-icon icon-down" layerControl="editZindex" edit="down" title="\u4e0b\u79fb"></span><span class="layer-edit-icon icon-bottom" layerControl="editZindex" edit="bottom" title="\u7f6e\u5e95"></span>'+
- i+"</div></div></div>"}b.innerHTML=c;f.appendChild(b);this.createDom=f;document.body.appendChild(f);this._ctrLayerShowBtn()},destroy:function(){this.createDom.remove();document.body.removeEventListener("click",this._clickEvent);document.body.removeEventListener("input",this._inputEvent,!0);this.controlLayers=this.createDom=this.map=this._inputEvent=this._clickEvent=null},reset:function(){if(this.createDom==null)return!1;this.createDom.remove();document.body.removeEventListener("click",this._clickEvent);
- document.body.removeEventListener("input",this._inputEvent,!0);this._inputEvent=this._clickEvent=null;this.render();var b=this.controlLayers,f;for(f in b){var c=b[f];if(GeoGlobe.Util.isArray(c))for(var a=0;a<c.length;a++){var e=this.map.getLayoutProperty(c[a].id,"visibility");this.map.setLayoutProperty(c[a].id,"visibility",e)}else e=this.map.getLayoutProperty(c.id,"visibility"),this.map.setLayoutProperty(c.id,"visibility",e)}this.map._update(!0)},CLASS_NAME:"GeoGlobe.Extends.LayerControl"});
- GeoGlobe.Extends.VtsLayerControl=GeoGlobe.Class4OL({map:null,options:null,controlLayers:null,initialize:function(b,f){this.map=b;f=f||{};f=GeoGlobe.Util.pick(f,["top","left","right","bottom"]);GeoGlobe.Util.applyDefaults(f,{top:void 0,left:void 0,right:void 0,bottom:void 0});this.options=f;for(var c=this.map.getStyle().layers,a=[],e=0;e<c.length;e++){var d=c[e].source;this.map.getSource(d).type==="vector"&&(a.hasOwnProperty(d)||(a[d]=[]),a[d].push(c[e]))}this.controlLayers=a},render:function(){this._createDom();
- this._bindEvent();this._initDom()},_ctrLayerShowBtn:function(){for(var b=document.querySelectorAll("li[layerControl='GeoGlobe-vtslayer-item']"),f=0;f<b.length;f++){for(var c=b[f].firstElementChild.lastElementChild.children,a=[],e=0;e<c.length;e++)c[e].getAttribute("layerControl")==="editZindex"&&a.push(c[e]);for(c=0;c<a.length;c++)a[c].style.display="";if(f==0)a[0].style.display="none",a[1].style.display="none";if(f==b.length-1)a[2].style.display="none",a[3].style.display="none"}},_ctrSubLayerShowBtn:function(b){for(var f=
- 0;f<b.length;f++){for(var c=b[f].lastElementChild.children,a=[],e=0;e<c.length;e++)c[e].getAttribute("layerControl")==="editSubZindex"&&a.push(c[e]);for(c=0;c<a.length;c++)a[c].style.display="";if(f==0)a[0].style.display="none",a[1].style.display="none";if(f==b.length-1)a[2].style.display="none",a[3].style.display="none"}},_initSubColorBtn:function(b){function f(a){var b=a.replace(/rgba?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),c=parseFloat(b[3]||1),a=Math.floor(c*parseInt(b[0])+(1-
- c)*255),e=Math.floor(c*parseInt(b[1])+(1-c)*255),b=Math.floor(c*parseInt(b[2])+(1-c)*255);return"#"+("0"+a.toString(16)).slice(-2)+("0"+e.toString(16)).slice(-2)+("0"+b.toString(16)).slice(-2)}for(var c=0;c<b.length;c++){var a=b[c].getAttribute("layerid"),e=this.map.getLayer(a),d=b[c].lastElementChild.children,d=d[d.length-1];if(d.getAttribute("layerControl")==="editColor")a=this.map.getPaintProperty(a,e.type+"-color"),a=f(a),d.value=a}},_initSubLayerIcon:function(b){for(var f=0;f<b.length;f++){var c=
- b[f].getAttribute("layerid");c==="LEV13-14/\u4ea4\u901a\u7ebf/D\u96a7\u9053\u4e2d\u5fc3\u7ebf/label/Class"&&this.map.getLayer(c);var c=this.map.getLayoutProperty(c,"visibility"),a=b[f].firstElementChild.firstElementChild;c!="none"?a.classList.add("title-icon-open"):a.classList.add("title-icon-close")}},_ctrSubLayerIcon:function(b,f){for(var c=0;c<b.length;c++)f?(b[c].firstElementChild.firstElementChild.classList.add("title-icon-open"),b[c].firstElementChild.firstElementChild.classList.remove("title-icon-close")):
- (b[c].firstElementChild.firstElementChild.classList.remove("title-icon-open"),b[c].firstElementChild.firstElementChild.classList.add("title-icon-close"))},_ctrLayersIcon:function(b){for(var f=!0,c=0;c<b.length;c++)if(b[c].firstElementChild.firstElementChild.classList.contains("title-icon-open")){f=!0;break}else f=!1;b=b[0].parentNode.previousElementSibling.firstElementChild.children[1];f?(b.classList.add("title-icon-open"),b.classList.remove("title-icon-close")):(b.classList.remove("title-icon-open"),
- b.classList.add("title-icon-close"))},_nextNode:function(b){if(!b.nextSibling)return!1;return b.nextElementSibling||(b.nextSibling.nodeType==1?b.nextSibling:nextNode(b.nextSibling))},_previousNode:function(b){if(!b.previousSibling)return!1;return b.previousElementSibling||(b.previousSibling.nodeType==1?b.previousSibling:previousNode(b.previousSibling))},_initDom:function(){var b=this.controlLayers;this._ctrLayerShowBtn();for(var f=document.querySelectorAll("li[layerControl='GeoGlobe-vtslayer-item']"),
- c=0;c<f.length;c++){for(var a=f[c].getAttribute("sourceid"),a=b[a],e=!1,d=0;d<a.length;d++)if(this.map.getLayoutProperty(a[d].id,"visibility")==="visible"){e=!0;break}e?f[c].firstElementChild.firstElementChild.classList.add("title-icon-open"):f[c].firstElementChild.firstElementChild.classList.add("title-icon-close");a=f[c].lastElementChild.children;this._ctrSubLayerShowBtn(a);this._initSubColorBtn(a);this._initSubLayerIcon(a)}},_createDom:function(){var b=this.options,f=document.createElement("div");
- f.classList.add("GeoGlobe-vtslayer-list");f.setAttribute("layerControl","GeoGlobe-vtslayer-list");for(var c in b){var a=b[c];a!==""&&typeof a==="number"&&(a+="px");f.style[c]=a}b=document.createElement("div");b.classList.add("GeoGlobe-vtslayer-title");b.innerHTML='<span class="GeoGlobe-vtslayer-name">\u77e2\u91cf\u5207\u7247\u56fe\u5c42\u7ba1\u7406</span><div class="GeoGlobe-vtslayer-close" layerControl="GeoGlobe-vtslayer-close" title="\u5173\u95ed"></div>';f.appendChild(b);b=document.createElement("div");
- b.classList.add("GeoGlobe-vtslayer-opacity");b.setAttribute("layerControl","GeoGlobe-vtslayer-opacity");b.innerHTML='<input type="range" min="1" max="100" step="1" layerControl="vtslayer-opacity" /><span class="vtslayer-opacity-close" layerControl="vtslayer-opacity-close"></span>';f.appendChild(b);b=document.createElement("ul");b.classList.add("GeoGlobe-vtslayer-items");c="";for(var a=Object.keys(this.controlLayers),e=a.length-1;e>=0;e--){for(var d=this._subString(a[e],15),g=this.controlLayers[a[e]],
- h=!1,i=0;i<g.length;i++)if(g[i].type!="symbol"){h=!0;break}g="";h&&(g='<span class="vtslayer-edit-icon icon-opacity" layerControl="editOpacity" title="\u900f\u660e\u5ea6"></span>');c+='<li class="GeoGlobe-vtslayer-item" layerControl="GeoGlobe-vtslayer-item" sourceid="'+a[e]+'"><div class="GeoGlobe-vtslayer-content"><div class="vtslayer-title"><span class="toggle-icon" layerControl="GeoGlobe-vtslayer-toggle"></span><span class="title-icon title-icon-open" layercontrol="layerShow"></span><span class="layer-name" title="'+
- a[e]+'">'+d+'</span></div><div class="vtslayer-edit"><span class="vtslayer-edit-icon icon-top" edit="top" layerControl="editZindex" title="\u7f6e\u9876"></span><span class="vtslayer-edit-icon icon-up" edit="up" layerControl="editZindex" title="\u4e0a\u79fb"></span><span class="vtslayer-edit-icon icon-down" edit="down" layerControl="editZindex" title="\u4e0b\u79fb"></span><span class="vtslayer-edit-icon icon-bottom" edit="bottom" layerControl="editZindex" title="\u7f6e\u5e95"></span>'+g+"</div></div>"+
- this._createSubDom(a[e])+"</li>"}b.innerHTML=c;f.appendChild(b);this.createDom=f;document.body.appendChild(f)},_createSubDom:function(b){for(var f=this.controlLayers[b],c=["line","fill","circle"],a='<ul class="vtslayer-list">',e=f.length-1;e>=0;e--){var d=f[e].id,g=this._subString(d,12),h=f[e].type,i="";c.indexOf(h)>-1&&(i='<input type="color" class="vtslayer-edit-icon" layerControl="editColor"/>');var j='<span class="vtslayer-edit-icon icon-opacity" layerControl="editSubOpacity" title="\u900f\u660e\u5ea6"></span>';
- h==="symbol"&&(j="");a+='<li class="list-layer" layerControl="list-layer" sourceid="'+b+'" layerid="'+d+'"><div class="vtslayer-title"><span class="title-icon" layercontrol="subLayerShow"></span><span class="layer-name" title="'+d+'">'+g+'</span></div><div class="vtslayer-edit"><span class="vtslayer-edit-icon icon-top" edit="top" layerControl="editSubZindex" title="\u7f6e\u9876"></span><span class="vtslayer-edit-icon icon-up" edit="up" layerControl="editSubZindex" title="\u4e0a\u79fb"></span><span class="vtslayer-edit-icon icon-down" edit="down" layerControl="editSubZindex" title="\u4e0b\u79fb"></span><span class="vtslayer-edit-icon icon-bottom" edit="bottom" layerControl="editSubZindex" title="\u7f6e\u5e95"></span>'+
- j+i+"</div></li>"}a+="</ul>";return a},_subString:function(b,f){var c=0,a="",e=/[^\x00-\xff]/g,d="",g=b.replace(e,"**").length;if(g>f){for(var h=0;h<g;h++){d=b.charAt(h).toString();d.match(e)!=null?c+=2:c++;if(c>f)break;a+=d}g>f&&(a+="...")}else a=b;return a},_bindEvent:function(){var b=this,f=this.controlLayers;this._clickEvent=function(c){c=c||window.event;c=c.target||c.srcElement;c.getAttribute("layerControl")==="GeoGlobe-vtslayer-close"&&b.destroy();if(c.getAttribute("layerControl")==="GeoGlobe-vtslayer-toggle")c.classList.contains("toggle-icon-open")?
- (c.classList.remove("toggle-icon-open"),c.parentNode.parentNode.nextElementSibling.style.display="none"):(c.classList.add("toggle-icon-open"),c.parentNode.parentNode.nextElementSibling.style.display="block");if(c.getAttribute("layerControl")==="layerShow"){for(var a=c.parentNode;a.getAttribute("layerControl")!="GeoGlobe-vtslayer-item";)a=a.parentNode;var e=a.lastElementChild.children,d=a.getAttribute("sourceid"),a=f[d];if(c.classList.contains("title-icon-close")){for(d=0;d<a.length;d++)b.map.showLayer(a[d].id);
- c.classList.remove("title-icon-close");c.classList.add("title-icon-open");b._ctrSubLayerIcon(e,!0)}else{for(d=0;d<a.length;d++)b.map.hideLayer(a[d].id);c.classList.remove("title-icon-open");c.classList.add("title-icon-close");b._ctrSubLayerIcon(e,!1)}}if(c.getAttribute("layerControl")==="subLayerShow"){for(a=c.parentNode;a.getAttribute("layerControl")!="list-layer";)a=a.parentNode;d=a.getAttribute("layerid");c.classList.contains("title-icon-close")?(b.map.showLayer(d),c.classList.remove("title-icon-close"),
- c.classList.add("title-icon-open")):(b.map.hideLayer(d),c.classList.remove("title-icon-open"),c.classList.add("title-icon-close"));b._ctrLayersIcon(c.parentNode.parentNode.parentNode.children)}if(c.getAttribute("layerControl")==="editZindex"){for(var g=c.getAttribute("edit"),a=c.parentNode;a.getAttribute("layerControl")!="GeoGlobe-vtslayer-item";)a=a.parentNode;var e=a.parentNode,d=a.getAttribute("sourceid"),h=f[d],i=h[0].id;switch(g){case "top":d=e.children[0].getAttribute("sourceid");d=f[d];g=d[d.length-
- 1].id;for(d=0;d<h.length;d++)b.map.moveLayer(h[d].id,g);b.map.moveLayer(g,i);e.prepend(a);break;case "up":h=b._previousNode(a);d=h.getAttribute("sourceid");g=f[d];for(d=0;d<g.length;d++)b.map.moveLayer(g[d].id,i);e.insertBefore(a,h);break;case "down":i=b._nextNode(a);d=i.getAttribute("sourceid");g=f[d][0].id;for(d=0;d<h.length;d++)b.map.moveLayer(h[d].id,g);e.insertBefore(i,a);break;case "bottom":d=e.children[e.children.length-1].getAttribute("sourceid");i=f[d][0].id;for(d=0;d<h.length;d++)b.map.moveLayer(h[d].id,
- i);e.append(a)}b._ctrLayerShowBtn()}if(c.getAttribute("layerControl")==="editSubZindex"){g=c.getAttribute("edit");for(a=c.parentNode;a.getAttribute("layerControl")!="list-layer";)a=a.parentNode;e=a.parentNode;a.getAttribute("sourceid");a.getAttribute("layerid");h=e.children[0].getAttribute("layerid");i=e.children[e.children.length-1].getAttribute("layerid");d=a.getAttribute("layerid");switch(g){case "top":b.map.moveLayer(d,h);b.map.moveLayer(h,d);e.prepend(a);break;case "up":h=b._previousNode(a);
- i=h.getAttribute("layerid");b.map.moveLayer(i,d);e.insertBefore(a,h);break;case "down":i=b._nextNode(a);h=i.getAttribute("layerid");b.map.moveLayer(d,h);e.insertBefore(i,a);break;case "bottom":b.map.moveLayer(d,i),e.append(a)}b._ctrSubLayerShowBtn(e.children)}for(var a=document.getElementsByClassName("GeoGlobe-vtslayer-opacity"),j,d=0;d<a.length;d++)if(a[d].getAttribute("layerControl")==="GeoGlobe-vtslayer-opacity"){j=a[d];break}if(c.getAttribute("layerControl")==="editOpacity"){for(a=c.parentNode;a.getAttribute("layerControl")!=
- "GeoGlobe-vtslayer-item";)a=a.parentNode;d=a.getAttribute("sourceid");j.style.top=a.offsetTop-a.parentNode.scrollTop+"px";j.style.display="block";j.firstElementChild.setAttribute("sourceid",d);j.firstElementChild.setAttribute("editLayer","main");d=f[d][0].id;e=b.map.getLayer(d);a=b.map.getPaintProperty(e.id,e.type+"-opacity");e=100;a&&(e=a*100);j.firstElementChild.value=e;j.firstElementChild.style.backgroundSize=e+"% 100%"}if(c.getAttribute("layerControl")==="editSubOpacity"){for(a=c.parentNode;a.getAttribute("layerControl")!=
- "list-layer";)a=a.parentNode;d=a.getAttribute("layerid");e=b.map.getLayer(d);j.style.top=a.offsetTop-a.parentNode.scrollTop-a.parentNode.parentNode.parentNode.scrollTop-6+"px";j.style.display="block";j.firstElementChild.setAttribute("layerid",d);j.firstElementChild.setAttribute("editLayer","sub");a=b.map.getPaintProperty(d,e.type+"-opacity");e=100;a&&(e=a*100);j.firstElementChild.value=e;j.firstElementChild.style.backgroundSize=e+"% 100%"}if(c.getAttribute("layerControl")==="vtslayer-opacity-close")j.style.display=
- "none"};document.body.addEventListener("click",this._clickEvent,!0);this._inputEvent=function(c){var c=c||window.event,a=c.target||c.srcElement;if(a.getAttribute("layerControl")==="vtslayer-opacity"){c=a.getAttribute("editLayer");if(c==="main"){var e=a.getAttribute("sourceid");a.oninput=function(c){a.style.backgroundSize=c.target.value+"% 100%";for(var d=f[e],g=0;g<d.length;g++)d[g].type!=="symbol"&&b.map.setOpacity(d[g].id,c.target.value/100)}}if(c==="sub"){var d=a.getAttribute("layerid");a.oninput=
- function(c){a.style.backgroundSize=c.target.value+"% 100%";b.map.setOpacity(d,c.target.value/100)}}}if(a.getAttribute("layerControl")==="editColor"){for(c=a.parentNode;c.getAttribute("layerControl")!="list-layer";)c=c.parentNode;var d=c.getAttribute("layerid"),g=b.map.getLayer(d);a.oninput=function(a){b.map.setPaintProperty(d,g.type+"-color",a.target.value)}}};document.body.addEventListener("input",this._inputEvent,!0)},destroy:function(){this.createDom.remove();document.body.removeEventListener("click",
- this._clickEvent,!0);document.body.removeEventListener("input",this._inputEvent,!0);this.createDom=this.map=this.controlLayers=this._inputEvent=this._clickEvent=null},reset:function(){if(this.createDom==null)return!1;this.createDom.remove();document.body.removeEventListener("click",this._clickEvent,!0);document.body.removeEventListener("input",this._inputEvent,!0);var b=this.controlLayers,f;for(f in b)for(var c=b[f],a=0;a<c.length;a++){var e=this.map.getLayoutProperty(c[a].id,"visibility");this.map.setLayoutProperty(c[a].id,
- "visibility",e)}this.map._update(!0);this.render()},CLASS_NAME:"GeoGlobe.Extends.VtsLayerControl"});GeoGlobe.Extends.Compare=window.mapboxgl.Compare&&mapboxgl.Compare?mapboxgl.Compare:GeoGlobe.Class4OL({initialize:function(){throw Error("\u8bf7\u5148\u5f15\u5165mapbox-gl-compare\u63d2\u4ef6\uff01");},CLASS_NAME:"GeoGlobe.Extends.Compare"});
|