1
2
3
4
5
6
7
8
9
10
11
12
13
| !function(){var b,a=window.location.href,c=a.lastIndexOf("/");0<c&&c<a.length-1&&(a=a.substring(c+1));window.GeoworldUtils={bucket:a,declare:function(){},highlight:function(){},registered:[],finishedLoading:function(){window.GeoworldUtils.reset();b&&(window.GeoworldUtils.highlight(b),b(),b=void 0);document.body.className=document.body.className.replace(/(?:\s|^)GeoworldUtils-loading(?:\s|$)/," ")},addToggleButton:function(a,b,c,f){window.GeoworldUtils.declare(c);var d=document.createElement("input");
| d.checked=b;d.type="checkbox";d.style.pointerEvents="none";b=document.createElement("label");b.appendChild(d);b.appendChild(document.createTextNode(a));b.style.pointerEvents="none";a=document.createElement("button");a.type="button";a.className="geoworld-button";a.appendChild(b);a.onclick=function(){window.GeoworldUtils.reset();window.GeoworldUtils.highlight(c);d.checked=!d.checked;c(d.checked)};document.getElementById(f||"toolbar").appendChild(a)},addToolbarButton:function(a,b,c){window.GeoworldUtils.declare(b);
| var f=document.createElement("button");f.type="button";f.className="geoworld-button";f.onclick=function(){window.GeoworldUtils.reset();window.GeoworldUtils.highlight(b);b()};f.textContent=a;document.getElementById(c||"toolbar").appendChild(f)},addDefaultToolbarButton:function(a,c,e){window.GeoworldUtils.addToolbarButton(a,c,e);b=c},addDefaultToolbarMenu:function(a,c){window.GeoworldUtils.addToolbarMenu(a,c);b=a[0].onselect},addToolbarMenu:function(a,c){var e=document.createElement("select");e.className=
| "geoworld-button";e.onchange=function(){window.GeoworldUtils.reset();var c=a[e.selectedIndex];c&&"function"===typeof c.onselect&&c.onselect()};document.getElementById(c||"toolbar").appendChild(e);b||"function"!=typeof a[0].onselect||(b=a[0].onselect);for(var f=0,d=a.length;f<d;++f){var k=document.createElement("option");k.textContent=a[f].text;k.value=a[f].value;e.appendChild(k)}},reset:function(){}}}();
| (function(b){var a=!1,c=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(b){function h(){!a&&this.__init__&&this.__init__.apply(this,arguments)}var e=this.prototype;a=!0;var f=new this;a=!1;for(var d in b)f[d]="function"===typeof b[d]&&"function"===typeof e[d]&&c.test(b[d])?function(a,b){return function(){var c=this._super;this._super=e[a];var f=b.apply(this,arguments);this._super=c;return f}}(d,b[d]):b[d];h.prototype=f;h.prototype.constructor=h;h.extend=
| arguments.callee;return h}})(window);var GeoworldLib={},cssRegExp=/\.css/,SuperMap3D="SuperMap3D";
| GeoworldLib.utils={resourceMap:{},loadScript:function(b,a){var c=document.createElement("script");c.type="text/javascript";c.readyState?c.onreadystatechange=function(){if("loaded"===c.readyState||"complete"===c.readyState)c.onreadystatechange=null,a()}:(c.onload=function(){a()},c.onerror=function(a){console.log(a)});c.src=b;document.body.appendChild(c)},loadCss:function(b){var a=document.createElement("link");a.setAttribute("type","text/css");a.setAttribute("rel","stylesheet");a.setAttribute("href",
| b);document.getElementsByTagName("head")[0].appendChild(a)},loadScriptRecursive:function(b,a,c){a>=b.length?c&&c():cssRegExp.test(b[a])?(GeoworldLib.utils.loadCss(b[a]),GeoworldLib.utils.loadScriptRecursive(b,a+1,c)):GeoworldLib.utils.loadScript(b[a],function(){GeoworldLib.utils.loadScriptRecursive(b,a+1,c)})},loadResources:function(b,a){for(var c=[],g=0;g<b.length;g++)b[g]===SuperMap3D?c.push(GEOWORLD_BASE_URL+"ThirdParty/SuperMap3D.js"):c.push(GeoworldLib.utils.resourceMap[b[g]]);GeoworldLib.utils.loadScriptRecursive(c,
| 0,a)},loadResourcesPromise:function(b){var a=Geoworld.when.defer();GeoworldLib.utils.loadResources(b,function(){a.resolve()});return a.promise},requireFuncPromise:function(b){var a=Geoworld.when.defer();window.requireJsFunc(b,function(b){a.resolve(b)});return a.promise},loadJson:function(b,a,c,g){$.ajax({url:c,cache:b,async:a,success:function(a){g&&g(a)},error:function(a){}})},loadJsonPromise:function(b,a,c){var g=Geoworld.when.defer();$.ajax({url:c,cache:b,async:a,success:function(a){g.resolve(a)},
| error:function(a){console.info(a)}});return g.promise}};window.inited=!1;window.EarthCtrl=void 0;
| GeoworldLib.createInstance=function(b,a,c,g){function h(a,d,e){window.inited=!0;window.EarthCtrl=a;Geoworld.defined(d.defaultViewRectangle)?Geoworld.Camera.DEFAULT_VIEW_RECTANGLE=d.defaultViewRectangle:Geoworld.Camera.DEFAULT_VIEW_RECTANGLE=Geoworld.Rectangle.fromDegrees(79,0,130,60);a=new a(b,e,{ellipsoidCoordinates:d.ellipsoidCoordinates});a.coreMap.camera.setView({destination:Geoworld.Camera.DEFAULT_VIEW_RECTANGLE});c&&c(a)}void 0===a.gisserver&&(a.gisserver="http://localhost:8080");if(window.inited)a.projectTree?
| h(window.EarthCtrl,a,a.projectTree):GeoworldLib.utils.loadJsonPromise(!1,!0,a.configLink).then(function(b){h(window.EarthCtrl,a,b)});else{var e=new XMLHttpRequest;e.onreadystatechange=function(){4===e.readyState&&200===e.status&&(GeoworldLib.utils.resourceMap=JSON.parse(e.responseText))};e.open("get",a.gisserver+"/verification/licensecheck",!1);e.send();window.GEOWORLD_BASE_URL=a.gisserver+"/MapSDK/Geoworld/";GeoworldLib.utils.loadResources(["main-css","style-css","zepto","geoworld-minify-release",
| SuperMap3D,"requirejs","map-vectortile-min","map-api-min"],function(){window.requireJsFunc=requirejs;GeoworldLib.utils.requireFuncPromise(["EarthCtrl"]).then(function(a){window.EarthCtrl=a}).then(function(){return a.projectTree?a.projectTree:GeoworldLib.utils.loadJsonPromise(!1,!0,a.configLink)}).then(function(b){h(window.EarthCtrl,a,b)})})}};
|
|