I am using selectedrow via the table to populate geojson in combination with the Geojson setting "Focus Camera on GeoJson" set to true, so that the map automatically centers the viewport to that specific point. However the default zoom is too high and you have to unzoom manually to even see where geographically the point is. I tried to set the zoom value on the basic section to a value from the selectedrow but this did not work. Any ideas on how this might be posssible?
Hey @bryangateley, are you only working with one point at a time or multiple points? If multiple, is your main goal to have the map zoomed in enough to show all the points, or do you want the page zoomed out enough to show where the points are geographically?
I'm having a similar issue. To answer your question in my case, I'm using a single geospatial geometry that represents a parcel of land. the default for "Focus Camera on GeoJson" is too close to see the context of the site. I'd like to control the zoom so that it centres on the parcel, but zooms out a bit more than the default setting.
Thanks!
bump - I'd like to reset my mapbox zoom with an EventHandler
Hi there! I was having a similar issue, and this is what I came up with. Keep in mind that this is specifically for seeing all the USA. You will have to change the polygon coordinates to the area of your choosing, if it is not the whole USA!
For geoJSON:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-125.0, 24.0], // Southwest corner of the USA
[-66.9, 24.0], // Southeast corner of the USA
[-66.9, 49.0], // Northeast corner of the USA
[-125.0, 49.0], // Northwest corner of the USA
[-125.0, 24.0] // Closing the polygon
]
]
}
}
]
}