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.
13 lines
612 B
JavaScript
13 lines
612 B
JavaScript
import { createElementObject, createTileLayerComponent, updateGridLayer, withPane } from '@react-leaflet/core';
|
|
import { TileLayer as LeafletTileLayer } from 'leaflet';
|
|
export const TileLayer = createTileLayerComponent(function createTileLayer({ url , ...options }, context) {
|
|
const layer = new LeafletTileLayer(url, withPane(options, context));
|
|
return createElementObject(layer, context);
|
|
}, function updateTileLayer(layer, props, prevProps) {
|
|
updateGridLayer(layer, props, prevProps);
|
|
const { url } = props;
|
|
if (url != null && url !== prevProps.url) {
|
|
layer.setUrl(url);
|
|
}
|
|
});
|