gavinr / geojson-viewer

View GeoJSON from a URL (with permalinks)
https://gavinr.github.io/geojson-viewer/
10 stars 4 forks source link

Zoom extent - sometimes does not buffer enough #4

Open smalers opened 2 years ago

smalers commented 2 years ago

I've recently enabled the tool as a layer preview for dataset pages that the Open Water Foundation publishes. Thanks for providing this tool because other tools require interactive submission of the layer, which does not work for integration. Below is an example page:

https://data.openwaterfoundation.org/country/us/usgs/huc-basins/

I've noticed that some layers when viewed do not result in a sufficient buffer around the layer's features, for example:

https://gavinr.github.io/geojson-viewer/?url=https://data.openwaterfoundation.org/country/us/usgs/huc-basins/huc4-basin-1020-platte.geojson

This requires the user to zoom to see the whole layer. The behavior seems sporadic, as if the zoom level is remembered between different uses?

Also, it would be great if the viewer allowed changing the background layer. We often use the USGS topo map.

Thanks again for publishing this tool. It has allowed us to move forward with other development without having to build our own viewer.

gavinr commented 2 years ago

Sure, I'd accept a small PR that expands the viewed extent.

smalers commented 2 years ago

Sorry, but I don't develop web applications using Esri library, so it will be a while if I were to come up with suggested code. We mostly use Leaflet consuming GeoJSON, some of which comes from Esri web services.