maps
maps copied to clipboard
Update VectorSource.tsx comment
Description
Made clear that maxZoomLevel doesn't actually hide the data. Setting this can actually help reveal data! This was quite surprising to find, with the doc written as they were.
Used the language here: https://docs.mapbox.com/style-spec/reference/sources/#vector-maxzoom
So adding 13 to the VectorSource's maxZoomLevel here, actually allowed the LineLayer to keep showing data. I guess because the url the titleUrlTemplate was pointing at did not provide data beyond 13, so it's essentially caching it.
<ErrorBoundary>
<MapboxGL.VectorSource
id={sourceId}
tileUrlTemplates={[url,]}
maxZoomLevel={13}
>
<MapboxGL.LineLayer
id={lineLayerId}
sourceLayerID={sourceId}
style={{
visibility: visibility,
lineColor: lineColor,
lineWidth: ['interpolate', ['linear',], ['zoom',], 16, 0.8, 18, 5,],
lineOpacity: ['interpolate', ['linear',], ['zoom',], 16, 0.8, 18, 1,],
}}
minZoomLevel={11}
/>
Checklist
- [x] I have tested this on a device/simulator for each compatible OS
- [na] I updated the documentation with running
yarn generatein the root folder - [ na] I added/updated a sample - if a new feature was implemented (
/example)
@SethArchambault thanks much. Please note that this is a generated .md file, you need to change in the source code comments