-
Notifications
You must be signed in to change notification settings - Fork 118
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
Adding a MapboxLayer for creating a single layer from a Mapbox style #268
Conversation
It looks like |
Nice, thanks @tschaub! I think it should also be confirmed that the source type is Looking at this pull request, another nice API improvement could be a |
Thanks @tschaub for your continued effort on this. I just created openlayers/openlayers#10993, which will help to fix the typecheck issues we have in this pull request. I'm also currently working on a pull request here to fix the Typescript configuration to make inheritance from OpenLayers classes work. |
Unfortunately, after fixing openlayers/openlayers#10993, we are running into a TypeScript issue (maybe microsoft/TypeScript#36830). For now, I think it makes sense to add a |
@tschaub If you rebase this pull request on top of master, type checking will work - and indicate that you're accessing protected methods of
Not sure how to best deal with that. Maybe add the MapboxVectorLayer to |
Thanks for making the TypeScript stuff work better. I do think this makes sense in the |
This adds a
MapboxVectorLayer
constructor that can be used like a normal OpenLayers layer. I wanted to make things work (where possible) with a style created with Mapbox studio and hosted on api.mapbox.com.Example usage:
Where the
styleURL
andaccessToken
are copied from studio:I'm leaving this as a draft pull request because I'm sure there are issues that I didn't consider. But the example works for me with a custom style and
mapbox://styles/mapbox/bright-v9
.I was uncertain about the glyph URLs. Also wondering if something like the
normalize*URL
functions would be useful elsewhere in the library.