UNPKG

@here/harp-examples

Version:
1 lines 3.49 kB
(()=>{"use strict";var e={5880:(e,t,n)=>{t.j=void 0;const r=n(1526),o=n(8957),i=n(5636),a=n(3074),l=n(7210),s=n(6120);!function(e){class t extends l.DataProvider{connect(){return Promise.resolve()}ready(){return!0}getTile(e,t){const n=new Array,r=10/(1<<e.level);n.push(0,0);for(let e=0;e<4*Math.PI;e+=.1){const t=Math.cos(e)*e*r*.5,o=Math.sin(e)*e*r;n.push(t,o)}return Promise.resolve(new Float32Array([n.length,...n]))}dispose(){}}class n extends a.Tile{}class c extends l.TileDataSource{constructor(e){super(new l.TileFactory(n),e)}}!async function(e){const n=document.getElementById("mapCanvas"),l=new a.MapView({canvas:n,theme:{lights:[{type:"ambient",color:"#FFFFFF",name:"ambientLight",intensity:.9},{type:"directional",color:"#CCCBBB",name:"light1",intensity:.8,direction:{x:1,y:5,z:.5}},{type:"directional",color:"#F4DB9C",name:"light2",intensity:.8,direction:{x:-1,y:-3,z:1}}],styles:{customStyleSet:[{when:["==",["get","layer"],"line-layer"],technique:"solid-line",attr:{color:"#ff0000",lineWidth:"10px"}},{when:["==",["get","layer"],"line-layer"],technique:"dashed-line",attr:{color:"#ffff00",dashSize:"30px",gapSize:"20px",lineWidth:"4px"}},{when:["==",["get","layer"],"mesh-layer"],technique:"standard",attr:{color:"#0000ff",depthTest:!0}}]}},maxVisibleDataSourceTiles:300,decoderUrl:"decoder.bundle.js"});a.CopyrightElementHandler.install("copyrightNotice",l);const d=new i.MapControls(l);d.maxTiltAngle=50;const h=new o.GeoCoordinates(40.707,-74.01);l.lookAt({target:h,zoomLevel:16,tilt:50,heading:-20});const u=new i.MapControlsUI(d);n.parentElement.appendChild(u.domElement),l.resize(window.innerWidth,window.innerHeight),window.addEventListener("resize",(()=>{l.resize(window.innerWidth,window.innerHeight)}));const p=new c({name:"customDatasource",styleSetName:"customStyleSet",tilingScheme:o.webMercatorTilingScheme,dataProvider:new t,concurrentDecoderServiceName:s.CUSTOM_DECODER_SERVICE_TYPE,storageLevelOffset:-1,minGeometryHeight:-100,maxGeometryHeight:100});l.addDataSource(p);const y=new r.DebugTileDataSource(o.webMercatorTilingScheme,"debug",20);l.addDataSource(y)}()}(t.j||(t.j={}))},4428:e=>{e.exports=THREE}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.m=e,n.x=e=>{},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=17,(()=>{var e={17:0,738:0},t=[[5880,592]],r=e=>{},o=(o,i)=>{for(var a,l,[s,c,d,h]=i,u=0,p=[];u<s.length;u++)l=s[u],n.o(e,l)&&e[l]&&p.push(e[l][0]),e[l]=0;for(a in c)n.o(c,a)&&(n.m[a]=c[a]);for(d&&d(n),o&&o(i);p.length;)p.shift()();return h&&t.push.apply(t,h),r()},i=self.webpackChunk_here_harp_examples=self.webpackChunk_here_harp_examples||[];function a(){for(var r,o=0;o<t.length;o++){for(var i=t[o],a=!0,l=1;l<i.length;l++){var s=i[l];0!==e[s]&&(a=!1)}a&&(t.splice(o--,1),r=n(n.s=i[0]))}return 0===t.length&&(n.x(),n.x=e=>{}),r}i.forEach(o.bind(null,0)),i.push=o.bind(null,i.push.bind(i));var l=n.x;n.x=()=>(n.x=l||(e=>{}),(r=a)())})(),n.x()})();