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

Create Vector Tile Layers Automatically #11

Closed
lukasmartinelli opened this issue Jan 10, 2017 · 4 comments
Closed

Create Vector Tile Layers Automatically #11

lukasmartinelli opened this issue Jan 10, 2017 · 4 comments

Comments

@lukasmartinelli
Copy link

For users that just want to display a Mapbox GL style JSON with ol-mapbox-style there could be a more convenient higher level API.

Perhaps something like this. Ideally just passing the style URL.

var olms = require('ol-mapbox-style');
olms.addStyleLayer('https://raw.githubusercontent.com/openmaptiles/osm-bright-gl-style/master/style.json');

Would this be something that would fit into this repo? Otherwise I would put it into another repo which includes ol-mapbox-style.

In Maputnik right now I generate the vector sources dynamically (it is quite a hack though) for ol-mapbox-style but I would also like that users have this functionality when they use the style with OL3.

This would be an additional higher level API that takes care of:

  • Fetching the style
  • Resolving TileJSON
  • Create the layer
  • Create and apply the style func
@ahocevar
Copy link
Member

I think a higher level API does make sense, but I assume you'll need to pass it at least the Mapbox Style url and an ol.Map instance.

I have thought about a higher level API as well (but haven't implemented it). I was envisioning this to be a separate library that depends on ol-mapbox-style. Great if you want to get that started!

@ahocevar
Copy link
Member

ahocevar commented Feb 1, 2017

I have finished a restructuring of the library. This project is now the place for a higher level API. The basic functionality has moved into https://npmjs.com/package/mapbox-to-ol-style.

@ahocevar
Copy link
Member

ahocevar commented Feb 9, 2017

I am now working on this.

@ahocevar
Copy link
Member

Done. 13fbd1f.

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

No branches or pull requests

2 participants