{"version":3,"file":"index.ec843b1b.js","sources":["../../vite/modulepreload-polyfill","../../main.js"],"sourcesContent":["const p = function polyfill() {\n const relList = document.createElement('link').relList;\n if (relList && relList.supports && relList.supports('modulepreload')) {\n return;\n }\n for (const link of document.querySelectorAll('link[rel=\"modulepreload\"]')) {\n processPreload(link);\n }\n new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type !== 'childList') {\n continue;\n }\n for (const node of mutation.addedNodes) {\n if (node.tagName === 'LINK' && node.rel === 'modulepreload')\n processPreload(node);\n }\n }\n }).observe(document, { childList: true, subtree: true });\n function getFetchOpts(script) {\n const fetchOpts = {};\n if (script.integrity)\n fetchOpts.integrity = script.integrity;\n if (script.referrerpolicy)\n fetchOpts.referrerPolicy = script.referrerpolicy;\n if (script.crossorigin === 'use-credentials')\n fetchOpts.credentials = 'include';\n else if (script.crossorigin === 'anonymous')\n fetchOpts.credentials = 'omit';\n else\n fetchOpts.credentials = 'same-origin';\n return fetchOpts;\n }\n function processPreload(link) {\n if (link.ep)\n // ep marker = processed\n return;\n link.ep = true;\n // prepopulate the load record\n const fetchOpts = getFetchOpts(link);\n fetch(link.href, fetchOpts);\n }\n};__VITE_IS_MODERN__&&p();","import './style.css';\nimport {Map, View} from 'ol';\nimport TileLayer from 'ol/layer/Tile';\nimport OSM from 'ol/source/OSM';\nimport TileWMS from 'ol/source/TileWMS';\nimport VectorLayer from 'ol/layer/Vector';\nimport VectorSource from 'ol/source/Vector';\nimport { format } from 'ol/coordinate';\nimport GeoJSON from 'ol/format/GeoJSON';\nimport {fromLonLat} from 'ol/proj';\nimport proj4 from 'proj4';\nimport {register} from 'ol/proj/proj4';\nimport Overlay from 'ol/Overlay';\nimport WMTS from 'ol/source/WMTS';\nimport WMTSTileGrid from 'ol/tilegrid/WMTS';\nimport {get as getProjection} from 'ol/proj';\nimport { Projection } from 'ol/proj';\nimport {getTopLeft, getWidth} from 'ol/extent';\nimport {Group as LayerGroup} from 'ol/layer';\nimport Layer from 'ol/layer/Layer';\n\n\nproj4.defs(\"EPSG:2180\",\"+proj=tmerc +lat_0=0 +lon_0=19 +k=0.9993 +x_0=500000 +y_0=-5300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs\");\nregister(proj4);\n\nconst container = document.getElementById('popup');\nconst content = document.getElementById('popup-content');\nconst closer = document.getElementById('popup-closer');\nconst legend = document.getElementById('legend');\n\nconst overlay = new Overlay({\n element: container,\n autoPan: true,\n autoPanAnimation: {\n duration: 250,\n },\n});\n\ncloser.onclick = function () {\n overlay.setPosition(undefined);\n closer.blur();\n return false;\n};\n\n\nconst projection = getProjection('EPSG:3857');\nconst projectionExtent = projection.getExtent();\nconst size = getWidth(projectionExtent) / 256;\n\nvar osmLayer = new TileLayer({\n id: 'osm',\n title: \"OpenStreetMap\",\n source: new OSM()\n});\n\nvar ortomapaLayer = new TileLayer({\n id: 'ortomapa',\n title: \"GeoPortal\",\n opacity: 1,\n source: new WMTS({\n attributions:\n '© Ortomapa',\n url: 'https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/HighResolution',\n layer: 'ORTOFOTOMAPA',\n matrixSet: 'EPSG:2180',\n format: 'image/png',\n projection: new Projection({\n code: \"EPSG:2180\",\n units: \"m\",\n extent: [144907.16581514146, 129171.69217334315, 890379.1658151413, 812697.4119729949]\n }),\n tileGrid: new WMTSTileGrid({\n\n origin: [100000, 850000],\n matrixIds: [\"EPSG:2180:0\",\n \"EPSG:2180:1\",\n \"EPSG:2180:2\",\n \"EPSG:2180:3\",\n \"EPSG:2180:4\",\n \"EPSG:2180:5\",\n \"EPSG:2180:6\",\n \"EPSG:2180:7\",\n \"EPSG:2180:8\",\n \"EPSG:2180:9\",\n \"EPSG:2180:10\",\n \"EPSG:2180:11\",\n \"EPSG:2180:12\",\n \"EPSG:2180:13\",\n \"EPSG:2180:14\",\n \"EPSG:2180:15\",\n \"EPSG:2180:16\"],\nresolutions: [2116.6709 * 4,\n 2116.6709 * 2,\n 2116.6709,\n 1058.33545,\n 529.167725,\n 264.5838625,\n 132.29193125,\n 66.145965625,\n 26.458386249999997,\n 13.229193124999998,\n 6.614596562499999,\n 2.645838625,\n 1.3229193125,\n 0.529167725,\n 0.2645838625,\n 0.13229193125,\n 0.13229193125 / 2],\n tileSize: 512\n }),\n style: 'default',\n wrapX: true,\n }),\n});\n\nvar kwateryLayer = new VectorLayer({\n title: \"Kwatery\",\n minZoom: 10,\n maxZoom: 19.99,\n source: new VectorSource({\n url: '/kwatery-2180.geojson',\n format: new GeoJSON(),\n }),\n });\n\nvar grobyLayer = new VectorLayer({\n title: \"Groby\",\n minZoom: 20,\n source: new VectorSource({\n url: '/groby.geojson',\n format: new GeoJSON(),\n }),\n });\n\nconst map = new Map({\n target: 'map',\n layers: [\n osmLayer,\n ortomapaLayer,\n kwateryLayer,\n grobyLayer,\n ],\n overlays: [overlay],\n view: new View({\n center: fromLonLat([23.2494,51.1282]),\n minZoom: 16,\n maxZoom: 22,\n zoom: 19\n })\n});\n\nmap.on('singleclick', function (evt) {\n var feature = map.forEachFeatureAtPixel(evt.pixel,\n function(feature, layer) {\n return feature;\n });\n if (feature) {\n const coordinate = evt.coordinate;\n if (feature.get('opis')) {\n content.innerHTML = '
' + feature.get('opis') + '
';\n overlay.setPosition(coordinate);\n }\n if (feature.get('grob')) {\n content.innerHTML = 'Sektor:' + feature.get('sektor') + ', Rząd: ' + feature.get('rzad') + ', Grób:' + feature.get('grob') + '
';\n jQuery.get( \"/api/szukaj/\" + feature.get('sektor') + '/' + feature.get('rzad') + '/' + feature.get('grob'), function( data ) {\n content.innerHTML += 'Pochowani w grobie:
' + data + '