From dc935a33c4f5b2ea92620bcd99879e9bd7a7c2ee Mon Sep 17 00:00:00 2001
From: Collin Beczak <88843144+CollinBeczak@users.noreply.github.com>
Date: Wed, 17 Jan 2024 00:24:33 -0600
Subject: [PATCH] fix task map property list on task markers (#2236)
* fix task map property list on task markers
---
.../TaskFeatureLayer/TaskFeatureLayer.js | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/components/EnhancedMap/TaskFeatureLayer/TaskFeatureLayer.js b/src/components/EnhancedMap/TaskFeatureLayer/TaskFeatureLayer.js
index 5ff49b778..71224de1a 100644
--- a/src/components/EnhancedMap/TaskFeatureLayer/TaskFeatureLayer.js
+++ b/src/components/EnhancedMap/TaskFeatureLayer/TaskFeatureLayer.js
@@ -13,6 +13,7 @@ import PropertyList from '../PropertyList/PropertyList'
import resolveConfig from 'tailwindcss/resolveConfig'
import tailwindConfig from '../../../tailwind.config.js'
import layerMessages from '../LayerToggle/Messages'
+import { IntlProvider } from 'react-intl'
const colors = resolveConfig(tailwindConfig).theme.colors
const HIGHLIGHT_SIMPLESTYLE = {
@@ -33,7 +34,13 @@ const TaskFeatureLayer = props => {
const propertyList = (featureProperties, onBack) => {
const contentElement = document.createElement('div')
ReactDOM.render(
- ,
+
+
+ ,
contentElement
)
return contentElement
@@ -73,8 +80,10 @@ const TaskFeatureLayer = props => {
Object.assign(styleableFeature.markerSimplestyles(layer), HIGHLIGHT_SIMPLESTYLE)
)
popup.on('remove', function() {
- // Restore original styling when popup closes
- styleableFeature.popLeafletLayerSimpleStyles(layer)
+ if (layer && layer._leaflet_events) {
+ // Restore original styling when popup closes
+ styleableFeature.popLeafletLayerSimpleStyles(layer)
+ }
})
popup.openOn(map)
})