Question

I'm attempting to use MapBox to display multiple properties that are all clustered in a city.

(Haven't decided between this vs. Leaflet)

It's my first time dealing with geoJSON stuff, and attempting to create the file of the multiple addresses.

Here's a sample that I got from somewhere online, and Mapbox keeps saying this: Error: Could not read dropped GeoJSON

It's from this file called testing.geojson which only contains the following:

{
    "type": "MultiPoint",
    "coordinates": [
        [-105.01621, 39.57422],
        [-80.6665134, 35.0539943]
    ]
}

I'm really confused why it keeps generating that error, as I was hoping to make this sample work with actual addresses of the properties.

Any advice/help would be appreciated.

EDIT

Just realized that I didn't make it clear that I was attempting to create a geoJSON list so I could import it into the MapBox.

Was it helpful?

Solution

The GeoJSON in your question should be defined within the geometry attribute of your GeoJSON, like this:

{
    "type": "Feature",
    "geometry": { 
        "type": "MultiPoint", 
        "coordinates": [
            [-105.01621, 39.57422], 
            [-80.6665134, 35.0539943]
        ]
    },
    "properties": {}       
}

OTHER TIPS

This was a bug in our normalization of GeoJSON - it was handling other types and turning them into FeatureCollections, but I had missed this case. Just fixed it now, should no longer be a bug!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top