0a5ab058a6
- Angular 12 application with PrimeNG components - 5 existing Cypress e2e test suites - SCSS styling with BEM naming convention - i18n support (10 languages) - Leaflet map integration - Complete component hierarchy and routing structure This baseline will be used for Angular → React migration.
15 lines
675 B
JavaScript
15 lines
675 B
JavaScript
import { createElementObject, createTileLayerComponent, updateGridLayer, withPane } from '@react-leaflet/core';
|
|
import { TileLayer } from 'leaflet';
|
|
export const WMSTileLayer = createTileLayerComponent(function createWMSTileLayer({ eventHandlers: _eh , params ={} , url , ...options }, context) {
|
|
const layer = new TileLayer.WMS(url, {
|
|
...params,
|
|
...withPane(options, context)
|
|
});
|
|
return createElementObject(layer, context);
|
|
}, function updateWMSTileLayer(layer, props, prevProps) {
|
|
updateGridLayer(layer, props, prevProps);
|
|
if (props.params != null && props.params !== prevProps.params) {
|
|
layer.setParams(props.params);
|
|
}
|
|
});
|