@here/harp-examples
Version:
harp.gl Examples
1 lines • 3.43 kB
JavaScript
(()=>{"use strict";var e={2555:(e,n,t)=>{n.m=void 0;const o=t(8957),r=t(5636),i=t(3074),a=t(2998),s=t(4428),c=t(4565);!function(e){const n=new s.BoxGeometry(100,100,100),t=new s.MeshStandardMaterial({color:16711934});document.body.innerHTML+="<style>\n #mapCanvas{\n top:0;\n }\n #info{\n color: #000;\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>Long click to add a pink box under the mouse cursor, with respect of buildings' height.</p>\n ";const l=function(e){const a=document.getElementById("mapCanvas"),c=new i.MapView({canvas:a,theme:"resources/berlin_tilezen_base.json"});i.CopyrightElementHandler.install("copyrightNotice",c);const l=new r.MapControls(c);l.maxTiltAngle=50;const p=new o.GeoCoordinates(40.707,-74.01);c.lookAt({target:p,zoomLevel:17,tilt:50});const d=new r.MapControlsUI(l);return a.parentElement.appendChild(d.domElement),c.resize(window.innerWidth,window.innerHeight),window.addEventListener("resize",(()=>{c.resize(window.innerWidth,window.innerHeight)})),new r.LongPressHandler(a,(e=>{const o=c.intersectMapObjects(e.pageX,e.pageY);if(0===o.length)return;const r=new s.Vector3;for(const e of o)if(e.point instanceof s.Vector3){r.copy(e.point),r.add(c.worldCenter);break}const i=function(){const e=new s.Mesh(n,t);return e.renderOrder=Number.MAX_SAFE_INTEGER,e}();i.anchor=r,c.mapAnchors.add(i),c.update()})),c}(),p=new a.VectorTileDataSource({baseUrl:"https://vector.hereapi.com/v2/vectortiles/base/mc",apiFormat:a.APIFormat.XYZOMV,styleSetName:"tilezen",authenticationCode:c.apikey,authenticationMethod:{method:a.AuthenticationMethod.QueryString,name:"apikey"},copyrightInfo:c.copyrightInfo});l.addDataSource(p)}(n.m||(n.m={}))},4428:e=>{e.exports=THREE}},n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{}};return e[o].call(r.exports,r,r.exports,t),r.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=439,(()=>{var e={439:0,738:0},n=[[2555,592]],o=e=>{},r=(r,i)=>{for(var a,s,[c,l,p,d]=i,h=0,u=[];h<c.length;h++)s=c[h],t.o(e,s)&&e[s]&&u.push(e[s][0]),e[s]=0;for(a in l)t.o(l,a)&&(t.m[a]=l[a]);for(p&&p(t),r&&r(i);u.length;)u.shift()();return d&&n.push.apply(n,d),o()},i=self.webpackChunk_here_harp_examples=self.webpackChunk_here_harp_examples||[];function a(){for(var o,r=0;r<n.length;r++){for(var i=n[r],a=!0,s=1;s<i.length;s++){var c=i[s];0!==e[c]&&(a=!1)}a&&(n.splice(r--,1),o=t(t.s=i[0]))}return 0===n.length&&(t.x(),t.x=e=>{}),o}i.forEach(r.bind(null,0)),i.push=r.bind(null,i.push.bind(i));var s=t.x;t.x=()=>(t.x=s||(e=>{}),(o=a)())})(),t.x()})();