Fix Leaflet map initialization: prevent DOM errors and ensure robust container checks
- Refactored initializeMap to accept the DOM node instead of the ref object - Updated all checks to use the DOM node directly - Improved useInitializeMap to only call initializeMap when the container is ready - Prevents "mapRef.current ist nicht definiert oder nicht im DOM" errors - Ensures map is only initialized when the container is attached
This commit is contained in:
@@ -343,7 +343,7 @@ function MapLayersControlPanel() {
|
||||
).values(),
|
||||
*/}
|
||||
{GisStationsStaticDistrict.Points.filter(p => !!p.Area_Name).map((item, index) => (
|
||||
<option key={item.Area_Name} value={item.IdLD}>
|
||||
<option key={item.Area_Name + "-" + item.IdLD} value={item.IdLD}>
|
||||
{item.Area_Name}
|
||||
</option>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user