feat: Add Improved Polish Orthophoto Map component with WMTS support
- Introduced ImprovedPolishOrthophotoMap component for displaying Polish orthophoto layers using WMTS. - Implemented custom WMTSLayer for handling tile requests. - Added Google Satellite and OpenStreetMap layers for comparison. - Included debug information for network requests to Geoportal. - Enhanced LeafletMap to support WMS overlays and improved layer control. - Created PolishGeoLayers module for easy access to various Polish geospatial layers. - Added TransparencyDemoMap for adjustable layer opacity controls. - Updated mapLayers configuration to include new Polish orthophoto layers and WMS overlays. - Refactored wmtsCapabilities to use updated URLs and parameters for better compatibility.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { MapContainer, TileLayer, Marker, Popup, LayersControl } from 'react-leaflet';
|
||||
import { MapContainer, TileLayer, WMSTileLayer, Marker, Popup, LayersControl } from 'react-leaflet';
|
||||
import 'leaflet/dist/leaflet.css';
|
||||
import { useEffect } from 'react';
|
||||
import { mapLayers } from './mapLayers';
|
||||
@@ -29,8 +29,7 @@ export default function EnhancedLeafletMap({
|
||||
useEffect(() => {
|
||||
fixLeafletIcons();
|
||||
}, []);
|
||||
|
||||
const { BaseLayer } = LayersControl;
|
||||
const { BaseLayer, Overlay } = LayersControl;
|
||||
|
||||
return (
|
||||
<MapContainer
|
||||
@@ -41,6 +40,7 @@ export default function EnhancedLeafletMap({
|
||||
>
|
||||
{showLayerControl ? (
|
||||
<LayersControl position="topright">
|
||||
{/* Base Layers */}
|
||||
{mapLayers.base.map((layer, index) => (
|
||||
<BaseLayer
|
||||
key={index}
|
||||
@@ -55,6 +55,32 @@ export default function EnhancedLeafletMap({
|
||||
/>
|
||||
</BaseLayer>
|
||||
))}
|
||||
{/* Overlay Layers */}
|
||||
{mapLayers.overlays && mapLayers.overlays.map((layer, index) => (
|
||||
<Overlay
|
||||
key={`overlay-${index}`}
|
||||
checked={layer.checked}
|
||||
name={layer.name}
|
||||
>
|
||||
{layer.type === "wms" ? (
|
||||
<WMSTileLayer
|
||||
attribution={layer.attribution}
|
||||
url={layer.url}
|
||||
params={layer.params}
|
||||
format={layer.params.format}
|
||||
transparent={layer.params.transparent}
|
||||
opacity={layer.opacity}
|
||||
/>
|
||||
) : (
|
||||
<TileLayer
|
||||
attribution={layer.attribution}
|
||||
url={layer.url}
|
||||
maxZoom={layer.maxZoom}
|
||||
opacity={layer.opacity}
|
||||
/>
|
||||
)}
|
||||
</Overlay>
|
||||
))}
|
||||
</LayersControl>
|
||||
) : (
|
||||
// Default layer when no layer control
|
||||
|
||||
Reference in New Issue
Block a user