Skip to content

Commit

Permalink
fix task map property list on task markers (#2236)
Browse files Browse the repository at this point in the history
* fix task map property list on task markers
  • Loading branch information
CollinBeczak authored Jan 17, 2024
1 parent e70d74b commit dc935a3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/components/EnhancedMap/TaskFeatureLayer/TaskFeatureLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -33,7 +34,13 @@ const TaskFeatureLayer = props => {
const propertyList = (featureProperties, onBack) => {
const contentElement = document.createElement('div')
ReactDOM.render(
<PropertyList featureProperties={featureProperties} onBack={onBack} />,
<IntlProvider key={props.intl.locale}
locale={props.intl.locale}
messages={props.intl.messages}
textComponent="span"
>
<PropertyList featureProperties={featureProperties} onBack={onBack} />
</IntlProvider>,
contentElement
)
return contentElement
Expand Down Expand Up @@ -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)
})
Expand Down

0 comments on commit dc935a3

Please sign in to comment.