Files
panel/src/components/ui/mapLayers.js

228 lines
7.5 KiB
JavaScript

// Map layer configurations
import { generateLayerConfig } from './wmtsCapabilities';
// Generate layer configurations from WMTS capabilities
const polishOrthophoto = generateLayerConfig('orthophoto');
export const mapLayers = {
base: [
{
name: "OpenStreetMap",
checked: true,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
maxZoom: 20
},
{
name: "🇵🇱 Polish Orthophoto (Standard)",
attribution: '&copy; <a href="https://www.geoportal.gov.pl/">Geoportal</a>',
url: "https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ORTO&STYLE=default&TILEMATRIXSET=EPSG:3857&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=image/jpeg",
maxZoom: 20,
checked: false
},
{
name: "🇵🇱 Polish Orthophoto (High Resolution)",
attribution: '&copy; <a href="https://www.geoportal.gov.pl/">Geoportal</a>',
url: "https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/HighResolution?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ORTO&STYLE=default&TILEMATRIXSET=EPSG:3857&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=image/jpeg",
maxZoom: 20,
checked: false
},
{
name: "🌍 Google Satellite",
attribution: '&copy; Google',
url: "http://mt1.google.com/vt/lyrs=s&hl=pl&x={x}&y={y}&z={z}",
maxZoom: 20,
checked: false
}, {
name: "🌍 Google Hybrid",
attribution: '&copy; Google',
url: "http://mt1.google.com/vt/lyrs=y&hl=pl&x={x}&y={y}&z={z}",
maxZoom: 20,
checked: false
},
{
name: "Satellite (Esri)",
attribution: '&copy; <a href="https://www.esri.com/">Esri</a> &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
url: "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
maxZoom: 20
},
{
name: "Topographic",
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="https://carto.com/attributions">CARTO</a>',
url: "https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",
maxZoom: 20
}
].filter(Boolean), // Remove any null entries
overlays: [
{
name: "🌍 Google Roads",
type: "tile",
attribution: '&copy; Google',
url: "http://mt1.google.com/vt/lyrs=h&hl=pl&x={x}&y={y}&z={z}",
maxZoom: 20,
opacity: 1.0,
checked: false
}, {
name: "📋 Polish Cadastral Data (Działki) - Server 1",
type: "wms",
attribution: '&copy; <a href="https://www.gugik.gov.pl/">GUGiK</a> - Krajowa Integracja Ewidencji Gruntów',
url: "https://integracja01.gugik.gov.pl/cgi-bin/KrajowaIntegracjaEwidencjiGruntow",
params: {
service: 'WMS',
request: 'GetMap',
layers: 'powiaty,powiaty_obreby,zsin,obreby,dzialki,geoportal,numery_dzialek,budynki',
styles: ',,,,,,,',
format: 'image/png',
transparent: true,
version: '1.3.0',
srs: 'EPSG:3857',
exceptions: 'xml',
tiled: true
},
opacity: 0.8,
checked: false
},
{
name: "📋 Polish Cadastral Data (Działki) - Server 2",
type: "wms",
attribution: '&copy; <a href="https://www.gugik.gov.pl/">GUGiK</a> - Krajowa Integracja Ewidencji Gruntów',
url: "https://integracja.gugik.gov.pl/cgi-bin/KrajowaIntegracjaEwidencjiGruntow",
params: {
service: 'WMS',
request: 'GetMap',
layers: 'dzialki,obreby,numery_dzialek,budynki,kontury,uzytki',
styles: ',,,,,,',
format: 'image/png',
transparent: true,
version: '1.3.0',
srs: 'EPSG:3857',
tiled: true
},
opacity: 0.8,
checked: false
},
{
name: "🏗️ Polish Spatial Planning",
type: "wms",
attribution: '&copy; <a href="https://www.geoportal.gov.pl/">Geoportal</a>',
url: "https://mapy.geoportal.gov.pl/wss/ext/KrajowaIntegracjaMiejscowychPlanowZagospodarowaniaPrzestrzennego",
params: {
service: 'WMS',
request: 'GetMap',
layers: 'raster,wektor-str,wektor-lzb,wektor-pow,wektor-lin,wektor-pkt,granice',
styles: ',,,,,,',
format: 'image/png',
transparent: true,
version: '1.3.0',
srs: 'EPSG:3857',
tiled: true
},
opacity: 0.7,
checked: false
},
{
name: "🛣️ LP-Portal Roads",
type: "wms",
attribution: '&copy; <a href="https://lp-portal.pl/">LP-Portal</a>',
url: "https://geoserver.lp-portal.pl/geoserver/pzdnowysacz/wms",
params: {
service: 'WMS',
request: 'GetMap',
layers: '00_6_mapainteraktywna_drogi',
styles: '',
format: 'image/png8',
transparent: true,
version: '1.3.0',
srs: 'EPSG:3857',
tiled: true
},
opacity: 0.9,
checked: false
},
{
name: "🏷️ LP-Portal Street Names",
type: "wms",
attribution: '&copy; <a href="https://lp-portal.pl/">LP-Portal</a>',
url: "https://geoserver.lp-portal.pl/geoserver/pzdnowysacz/wms",
params: {
service: 'WMS',
request: 'GetMap',
layers: '00_5_mapainteraktywna_opisy_drog,00_3_mapainteraktywna_nazwy_ulic',
styles: '',
format: 'image/png8',
transparent: true,
version: '1.1.1',
srs: 'EPSG:3857',
tiled: true
},
opacity: 1.0,
checked: false
},
{
name: "📐 LP-Portal Parcels",
type: "wms",
attribution: '&copy; <a href="https://lp-portal.pl/">LP-Portal</a>',
url: "https://geoserver.lp-portal.pl/geoserver/pzdnowysacz/wms",
params: {
service: 'WMS',
request: 'GetMap',
layers: 'dzialki',
styles: '',
format: 'image/png',
transparent: true,
version: '1.1.1',
srs: 'EPSG:3857',
tiled: true
},
opacity: 0.6,
checked: false
},
{
name: "📍 LP-Portal Survey Markers",
type: "wms",
attribution: '&copy; <a href="https://lp-portal.pl/">LP-Portal</a>',
url: "https://geoserver.lp-portal.pl/geoserver/pzdnowysacz/wms",
params: {
service: 'WMS',
request: 'GetMap',
layers: '00_2_view_geop_odcinek_pikietaz_glob_multi',
styles: '',
format: 'image/png8',
transparent: true,
version: '1.1.1',
crs: 'EPSG:3857',
tiled: true
},
opacity: 0.8,
checked: false
}
]
};
// WMTS services configuration with GetCapabilities URLs
export const wmtsServices = {
polishOrthophoto: {
capabilitiesUrl: "https://mapy.geoportal.gov.pl/wss/service/PZGIK/ORTO/WMTS/StandardResolution?Service=WMTS&Request=GetCapabilities",
layer: "ORTO",
style: "default",
tilematrixSet: "EPSG:2180",
format: "image/jpeg"
}
};
// Helper function to check WMTS capabilities
export async function checkWMTSCapabilities(serviceKey) {
const service = wmtsServices[serviceKey];
if (!service) return null;
try {
const response = await fetch(service.capabilitiesUrl);
const xml = await response.text();
console.log(`WMTS Capabilities for ${serviceKey}:`, xml);
return xml;
} catch (error) {
console.error(`Failed to fetch WMTS capabilities for ${serviceKey}:`, error);
return null;
}
}