0

I've set up a rest API that is supplying geojson data from a database. The issue is each coordinate could/does have multiple items associated to it.

Currently troubleshooting the application's javascript file to load, and plot - but looking for feedback on best practice. Any information is appreciated. Thanks!

var foo = {
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "item": "A",
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          90,
          135
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "item": "B",
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          90,
          135
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "item": "C",
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          90,
          135
        ]
      }
    },
...
MrOtter
  • 1
  • 3
  • So what is the question? What do you want to achieve? – kboul Oct 30 '19 at 12:53
  • Should preface this with I'm fairly new to JS. But looking to display multiple items per a single coordinate - if this is even possible. Ultimately wanting to create a dashboard to display the map, but also wanting to list out all items associated to a click event on a given coordinate. – MrOtter Oct 30 '19 at 13:29
  • You can use marker clusters to achieve that. Your question is exactly the same with this [one](https://stackoverflow.com/a/22173475/4929531) – kboul Oct 30 '19 at 13:33
  • Thank you! I appreciate the feedback. This will display children in 'spiral' format. – MrOtter Oct 30 '19 at 15:34

0 Answers0