{ "version": 3, "sources": ["../node_modules/maplibre-gl/rollup/maplibregl.js", "../src/map.js"], "sourcesContent": ["//\n// Our custom intro provides a specialized \"define()\" function, called by the\n// AMD modules below, that sets up the worker blob URL and then executes the\n// main module, storing its exported value as 'maplibregl'\n\n// The three \"chunks\" imported here are produced by a first Rollup pass,\n// which outputs them as AMD modules.\n\n// Shared dependencies, i.e.:\n/*\ndefine(['exports'], function (exports) {\n // Code for all common dependencies\n // Each module's exports are attached attached to 'exports' (with\n // names rewritten to avoid collisions, etc.)\n})\n*/\nimport './build/maplibregl/shared';\n\n// Worker and its unique dependencies, i.e.:\n/*\ndefine(['./shared.js'], function (__shared__js) {\n // Code for worker script and its unique dependencies.\n // Expects the output of 'shared' module to be passed in as an argument,\n // since all references to common deps look like, e.g.,\n // __shared__js.shapeText().\n});\n*/\n// When this wrapper function is passed to our custom define() above,\n// it gets stringified, together with the shared wrapper (using\n// Function.toString()), and the resulting string of code is made into a\n// Blob URL that gets used by the main module to create the web workers.\nimport './build/maplibregl/worker';\n\n// Main module and its unique dependencies\n/*\ndefine(['./shared.js'], function (__shared__js) {\n // Code for main GL JS module and its unique dependencies.\n // Expects the output of 'shared' module to be passed in as an argument,\n // since all references to common deps look like, e.g.,\n // __shared__js.shapeText().\n //\n // Returns the actual maplibregl (i.e. src/index.js)\n});\n*/\nimport './build/maplibregl/index';\n\nexport default maplibregl;\n", "import maplibregl from 'maplibre-gl';\nimport \"./style.scss\";\n\nimport \"maplibre-gl/dist/maplibre-gl.css\"\n\nconst key=\"XrQsj7upLPDwvXiflP14\"\n\n\n// {\"lng\":15.610783169541236,\"lat\":48.40934295478499}\n\nconst map = new maplibregl.Map({\n container: 'map',\n style: `https://api.maptiler.com/maps/dataviz/style.json?key=${key}`,\n center: [15.61078, 48.40934],\n zoom: 13,\n bearing: 0,\n pitch: 20\n});\nwindow.map = map\nmap.addControl(new maplibregl.NavigationControl());\nmap.on(\"load\",()=>{\n\n\nlet posts = []\n\nfunction renderData() {\n const featuresEl = document.getElementById(\"features\")\n posts.forEach(post => {\n const section = document.createElement(\"section\")\n section.id = \"map-post-\" + post.id\n const h3 = document.createElement(\"h3\")\n h3.innerText = post.title.rendered\n const p1 = document.createElement(\"p\")\n p1.innerHTML = post.excerpt.rendered\n const p2 = document.createElement(\"p\")\n const a = document.createElement(\"a\")\n a.href = post.link\n a.target = \"readmore\"\n a.innerText = \"Mehr lesen \u2026\"\n p2.appendChild(a)\n section.appendChild(h3)\n section.appendChild(p1)\n section.appendChild(p2)\n if (post.fimg_url) {\n const img = document.createElement(\"img\")\n img.src = post.fimg_url\n section.appendChild(img)\n }\n featuresEl.appendChild(section)\n })\n // const markerLayer = map.addLayer({\n // id: 'markers',\n // type: 'symbol',\n // source: \"\"\n // });\n\n\n posts.forEach(post => {\n const marker = new maplibregl.Marker()\n .setLngLat({lon: post.custom_fields.longitude, lat: post.custom_fields.latitude})\n .addTo(map);\n marker._element.addEventListener(\"click\", () => {\n const currentID = \"map-post-\" + post.id;\n const sidebarEl = document.getElementById(currentID)\n console.log(sidebarEl)\n sidebarEl.scrollIntoView({behavior: \"smooth\", block: 'nearest', inline: 'start'});\n sidebarEl.setAttribute('class', 'active');\n if (activeID && activeID !== currentID) {\n document.getElementById(activeID).setAttribute('class', '');\n }\n activeID = currentID\n\n })\n })\n bindClickListeners()\n}\n\nfunction reqListener() {\n posts = JSON.parse(this.responseText)\n renderData()\n}\n\nconst oReq = new XMLHttpRequest();\noReq.addEventListener(\"load\", reqListener);\noReq.open(\"GET\", \"https://raumforscherinnen.at/wp-json/wp/v2/posts?categories=5\");\noReq.send();\n\n// setTimeout(renderData, 500)\n\nfunction bindClickListeners() {\n const features = [].slice.call(document.querySelectorAll(\"#features section\"));\n features.forEach(element => {\n element.addEventListener(\"click\", () => {\n const id = element.id;\n setActiveChapter(id);\n });\n });\n}\n\n\nlet activeID = undefined;\n\nfunction setActiveChapter(clickedID) {\n if (clickedID === activeID) return;\n\n const postID = parseInt(clickedID.replace('map-post-', ''), 10);\n const clickedObject = posts.find(post => post.id === postID)\n map.flyTo({\n center: {lon: clickedObject.custom_fields.longitude, lat: clickedObject.custom_fields.latitude},\n zoom: 18,\n bearing: 0 //north up\n });\n\n document.getElementById(clickedID).setAttribute('class', 'active');\n if (activeID) {\n document.getElementById(activeID).setAttribute('class', '');\n }\n\n activeID = clickedID;\n}\n})\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qx+BA8CA,IAAAA,GAAeC,iBC9Cf,IAAAC,GAAuB,SAKvB,IAAMC,GAAI,uBAKJC,GAAM,IAAI,GAAAC,QAAW,IAAI,CAC3B,UAAW,MACX,MAAO,wDAAwDF,KAC/D,OAAQ,CAAC,SAAU,QAAQ,EAC3B,KAAM,GACN,QAAS,EACT,MAAO,EACX,CAAC,EACD,OAAO,IAAMC,GACbA,GAAI,WAAW,IAAI,GAAAC,QAAW,iBAAmB,EACjDD,GAAI,GAA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ACDG,GAAmB,CACvB,CAEA,SAASC,IAAc,CACnBd,GAAQ,KAAK,MAAM,KAAK,YAAY,EACpCC,GAAW,CACf,CAEA,IAAMc,GAAO,IAAI,eACjBA,GAAK,iBAAiB,OAAQD,EAAW,EACzCC,GAAK,KAAK,MAAO,+DAA+D,EAChFA,GAAK,KAAK,EAIV,SAASF,IAAqB,CACT,CAAC,EAAE,MAAM,KAAK,SAAS,iBAAiB,mBAAmB,CAAC,EACpE,QAAQG,IAAW,CACxBA,GAAQ,iBAAiB,QAAS,IAAM,CACpC,IAAMC,GAAKD,GAAQ,GACnBE,GAAiBD,EAAE,CACvB,CAAC,CACL,CAAC,CACL,CAGA,IAAIL,EAEJ,SAASM,GAAiBC,GAAW,CACjC,GAAIA,KAAcP,EAAU,OAE5B,IAAMQ,GAAS,SAASD,GAAU,QAAQ,YAAa,EAAE,EAAG,EAAE,EACxDE,GAAgBrB,GAAM,KAAKG,IAAQA,GAAK,KAAOiB,EAAM,EAC3DtB,GAAI,MAAM,CACN,OAAQ,CAAC,IAAKuB,GAAc,cAAc,UAAW,IAAKA,GAAc,cAAc,QAAQ,EAC9F,KAAM,GACN,QAAS,CACb,CAAC,EAED,SAAS,eAAeF,EAAS,EAAE,aAAa,QAAS,QAAQ,EAC7DP,GACA,SAAS,eAAeA,CAAQ,EAAE,aAAa,QAAS,EAAE,EAG9DA,EAAWO,EACf,CACA,CAAC", "names": ["maplibregl$1", "maplibregl", "import_maplibre_gl", "key", "map", "maplibregl", "posts", "renderData", "featuresEl", "post", "section", "h3", "p1", "p2", "a", "img", "currentID", "sidebarEl", "activeID", "bindClickListeners", "reqListener", "oReq", "element", "id", "setActiveChapter", "clickedID", "postID", "clickedObject"] }