UNPKG

@here/harp-examples

Version:
1 lines 3.56 kB
(()=>{"use strict";var e={167:(e,n,t)=>{n.K=void 0;const o=t(8957),i=t(3074),r=t(2998),a=t(3860),d=t(1929),l=t(4565);!function(e){const n=function(){document.body.innerHTML+="\n <style>\n #mapCanvas{\n top:0\n }\n #info{\n color: #fff;\n width: 80%;\n left: 50%;\n position: relative;\n margin: 10px 0 0 -40%;\n font-size: 15px;\n }\n @media screen and (max-width: 700px) {\n #info{\n font-size:11px;\n }\n }\n </style>\n <p id=info></p>\n ";const e=document.getElementById("mapCanvas"),n=new i.MapView({canvas:e,projection:o.sphereProjection,theme:"resources/berlin_tilezen_base_globe.json"});e.addEventListener("contextmenu",(e=>e.preventDefault())),i.CopyrightElementHandler.install("copyrightNotice",n),n.resize(window.innerWidth,window.innerHeight),window.addEventListener("resize",(()=>{n.resize(window.innerWidth,window.innerHeight)}));const t=new r.VectorTileDataSource({baseUrl:"https://vector.hereapi.com/v2/vectortiles/base/mc",authenticationCode:l.apikey});return n.addDataSource(t),n}(),t={target:new o.GeoCoordinates(25.19705,55.27419),tilt:25,zoomLevel:16.1,heading:0,globe:!0,headingSpeed:.1};n.addEventListener(i.MapViewEventNames.AfterRender,(()=>{t.heading=(t.heading+t.headingSpeed)%360,n.lookAt(t),n.update(),document.getElementById("info").innerHTML=`This view is set through the lookAt method: map.lookAt({target: dubai, zoomLevel: ${t.zoomLevel.toFixed(1)}, tilt: ${t.tilt.toFixed(1)}, heading: ${t.heading.toFixed(1)}})`}));const s=new a.GUI({width:300});s.add(t,"tilt",0,80,.1),s.add(t,"zoomLevel",1,20,.1),s.add(t,"globe").onChange((()=>{n.projection=t.globe?o.sphereProjection:o.mercatorProjection})),s.add(t,"headingSpeed",.1,10,.1);const p=new d;p.dom.style.bottom="0px",p.dom.style.top="",document.body.appendChild(p.dom),n.addEventListener(i.MapViewEventNames.Render,(()=>{p.end(),p.begin()}))}(n.K||(n.K={}))},4428:e=>{e.exports=THREE}},n={};function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{}};return e[o].call(i.exports,i,i.exports,t),i.exports}t.m=e,t.x=e=>{},t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.j=934,(()=>{var e={934:0,738:0},n=[[167,592]],o=e=>{},i=(i,r)=>{for(var a,d,[l,s,p,h]=r,c=0,u=[];c<l.length;c++)d=l[c],t.o(e,d)&&e[d]&&u.push(e[d][0]),e[d]=0;for(a in s)t.o(s,a)&&(t.m[a]=s[a]);for(p&&p(t),i&&i(r);u.length;)u.shift()();return h&&n.push.apply(n,h),o()},r=self.webpackChunk_here_harp_examples=self.webpackChunk_here_harp_examples||[];function a(){for(var o,i=0;i<n.length;i++){for(var r=n[i],a=!0,d=1;d<r.length;d++){var l=r[d];0!==e[l]&&(a=!1)}a&&(n.splice(i--,1),o=t(t.s=r[0]))}return 0===n.length&&(t.x(),t.x=e=>{}),o}r.forEach(i.bind(null,0)),r.push=i.bind(null,r.push.bind(r));var d=t.x;t.x=()=>(t.x=d||(e=>{}),(o=a)())})(),t.x()})();