Skip to content

Commit 8f5f1a8

Browse files
authored
Merge pull request #93 from dfpc-coe/add-png
Add PNG Postfix
2 parents 4c7f152 + e0ffd6b commit 8f5f1a8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/parser/from_geojson.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,14 @@ export async function from_geojson(
200200

201201
if (feature.properties.icon) {
202202
// Web Rendering uses a ":", to avoid issues we support it on input and normalize it to a "/"
203-
feature.properties.icon = feature.properties.icon.split(':').join('/')
203+
if (feature.properties.icon.includes(':')) {
204+
feature.properties.icon = feature.properties.icon
205+
.split(':').join('/')
206+
207+
if (!feature.properties.icon.endsWith('.png')) {
208+
feature.properties.icon += '.png';
209+
}
210+
}
204211

205212
cot.event.detail.usericon = { _attributes: { iconsetpath: feature.properties.icon } }
206213
}

0 commit comments

Comments
 (0)