Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update VectorSource.md #3056

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SethArchambault
Copy link

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

  • I have tested this on a device/simulator for each compatible OS
  • [na] I updated the documentation with running yarn generate in the root folder
  • [ na] I added/updated a sample - if a new feature was implemented (/example)

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.
@mfazekas
Copy link
Contributor

@SethArchambault thanks much. Please note that this is a generated .md file, you need to change in the source code comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants