mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 17:31:14 +01:00
Fix to fallback to index for unique feature key in <FeaturePropertyPopup />
This commit is contained in:
parent
63ed8c1de3
commit
5b3d579f87
1 changed files with 3 additions and 2 deletions
|
@ -21,8 +21,9 @@ function renderProperties(feature) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderFeature(feature) {
|
function renderFeature(feature, idx) {
|
||||||
return <div key={`${feature.sourceLayer}-${feature.id}`}>
|
const uniqueKey = feature.hasOwnProperty('id') ? feature.id : idx;
|
||||||
|
return <div key={`${feature.sourceLayer}-${uniqueKey}`}>
|
||||||
<div className="maputnik-popup-layer-id">{feature.layer['source-layer']}{feature.inspectModeCounter && <span> × {feature.inspectModeCounter}</span>}</div>
|
<div className="maputnik-popup-layer-id">{feature.layer['source-layer']}{feature.inspectModeCounter && <span> × {feature.inspectModeCounter}</span>}</div>
|
||||||
<InputBlock key={"property-type"} label={"$type"}>
|
<InputBlock key={"property-type"} label={"$type"}>
|
||||||
<StringInput value={feature.geometry.type} style={{backgroundColor: 'transparent'}} />
|
<StringInput value={feature.geometry.type} style={{backgroundColor: 'transparent'}} />
|
||||||
|
|
Loading…
Reference in a new issue