Geojson popup text
-
I’ve used the leaflet tools successfully before but never interrogated the geojson to get the popups to work. My geojson has a slightly more complex structure, with nested answers to questions. I can get certain elements out and display them, like the {elementid}.
But I want to pickout and display the answers from this section, which has multiple answers which usefully extends the pop up information on each “near miss” incident:
"properties":{"popup":[{"question":"Choose one option in position 1","response":"near miss when on a bike"},{"question":"How long ago was the incident ?","response":"Earlier this year"},{"question":"What happened?","response":null},{"question":"Reporting the incident","response":"I did not report the incident to the police"}
The pop up ideally would display something like this as per the link I have created:
Incident:
near miss when on a bike
;
When: Earlier this year;
Reporting the incident:I did not report the incident to the police
The full geojson
https://connectingdunbar.org.uk/files/2023/10/Drop-a-pin-where-you-had-a-near-miss.json
Any pointers or worked examples would be great!
Thanks in anticipation and thanks for extending the toolset for WordPress users
??
The page I need help with: [log in to see the link]
- The topic ‘Geojson popup text’ is closed to new replies.