You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
4.1 KiB
JavaScript
2 lines
4.1 KiB
JavaScript
2 weeks ago
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2004],{21954:function(e,t,n){var r=n(12739),o=n(41376),u=n(54354),c=n(40349),i=n(12174),a=n(8768),f=n(91712),l=n(91118),s=n(70277),p=n(87103),y=n(40985),d=n(79847),v=n(95783),b=n(42010),m=n(41372),g=n(19352);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function O(){return(O="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=E(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(this,arguments)}function E(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=B(e)););return e}function Z(e,t){return(Z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=B(e);if(t){var o=B(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return P(this,n)}}function P(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var R=document.getElementById("tileCoordZ"),I=document.getElementById("tileCoordX"),_=document.getElementById("tileCoordY"),k=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Z(e,t)}(c,e);var t,n,o,u=j(c);function c(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),u.call(this,{featureClass:r.Z})}return t=c,(n=[{key:"readFeatures",value:function(e,t){return t.extent=(0,g.dl)().getTileCoordExtent([parseInt(R.value),parseInt(I.value),parseInt(_.value)]),O(B(c.prototype),"readFeatures",this).call(this,e,t)}}])&&w(t.prototype,n),o&&w(t,o),Object.defineProperty(t,"prototype",{writable:!1}),c}(a.Z),x=new c.Z({formatConstructors:[k,f.Z,l.Z,s.Z,p.ZP,y.Z]}),C=new o.Z({interactions:(0,i.ce)().extend([x]),layers:[new b.Z({source:new d.Z})],target:"map",view:new u.ZP({center:[0,0],zoom:2})});x.on("addfeatures",(function(e){var t=new v.Z({features:e.features});C.addLayer(new m.Z({source:t})),C.getView().fit(t.getExtent())}));var S=function(e){var t=[];if(C.forEachFeatureAtPixel(e,(function(e){t.push(e)})),t.length>0){var n,r,o=[];for(n=0,r=t.length;n<r;++n){var u=t[n].get("name")||t[n].get("_name")||t[n].get("layer");u&&o.push(u)}document.getElementById("info").innerHTML=o.join(", ")||" "}else document.getElementById("info").innerHTML=" "};C.on("pointermove",(function(e){if(!e.dragging){var t=C.getEventPixel(e.originalEvent);S(t)}})),C.on("click",(function(e){S(e.pixel)}));var T=document.getElementById("download");document.getElementById("download-mvt").addEventListener("click",(function(){!function(e,t){fetch(e).then((function(e){return e.blob()})).then((function(e){navigator.msSaveBlob?navigator.msSaveBlob(e,t):(T.href=URL.createObjectURL(e),T.download=t,T.click())}))}("https://basemaps.arcgis.com/v1/arcgis/rest/services/World_Basemap/VectorTileServer/tile/"+R.value+"/"+_.value+"/"+I.value+".pbf",R.value+"-"+I.value+"-"+_.value+".mvt")}))}
|
||
|
//# sourceMappingURL=drag-and-drop-custom-mvt.js.map
|