-
Notifications
You must be signed in to change notification settings - Fork 67
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
can we render layers as vector tiles? #216
Comments
Totes. It might give us better rendering performance in some instances. Might want to be intelligent about when to convert to VT and when to leave a layer as-is. |
This is a fun idea. Some questions:
|
Good questions. The interaction piece would be interesting to research further. So the high-level decision here, assuming interaction is less than optimal, is do we: A) optimize for file size and forgo some user interaction (map clicks)? OR B) allow for complete user interaction and assume small file usage in dropchop? IMO it seems A is more powerful, since we can build other ways to view layer information.
Not exactly sure - I'd love to see point features drawn as SVG circles instead of map markers at some point. Would be faster and less bulky. Eh? |
Does Turf.js work against vector tiles? It seems to me that geojson-vt converts GeoJSON into a different format. Otherwise, we might have to convert from vector tile back to GeoJSON to do analysis. |
I'm thinking that the vector tile piece is really only for the actual drawing of the map, which is where a lot of the lag comes from right now. I think we store all of the raw data as GeoJSON so turf can just run off of that, but when rendering on the map we covert to vector tile. |
Oh OK. Sounds good to me then. |
Heyo! That's awesome. What are the details?! not sure about the linux gif maker |
I don't have my work with me right now, but the basics are using I'm not certain why the geometry coordinates are divided by 16, but I'm assuming because the square of 16 is 256 which would be the image size per tile. But it... Well, except it doesn't show the layer in the layerlist, and there's no logic for deciding when to use vector tiles, and I haven't tested it with Turf, and on and on. |
OK. I've pushed a proof of concept here. Feel free to play around with it. Lots of things are borked as I said earlier. But it does render the vector tiles. Some steps you'll need to get this commit working.
I'm sure a lot of the steps above could be automated in the gulpfile. But I haven't gotten that far yet. |
In preparation for my upcoming talk at the February 2016 meeting I've been revisiting this work on a new branch that proposes migrating Dropchop from Mapbox.js to Mapbox-GL-JS. Mapbox-GL-JS uses the GeoJSON-VT library for rendering out of the box. This means we'll be able to handle much larger GeoJSON files. In my branch I've loaded a 17MB point file in ~2 seconds where it completely chokes on the master branch. This would be a large refactor. Also, mapbox-gl-js has not reached v1.0.0 yet so there may be continuing breaking changes until then. Here's a list of what works (as of 35b73d2) and what needs to be done to move ahead. My hope is that most of these will be simple fixes once we adapt to the new API.
Please feel free to |
What if we used https://github.com/mapbox/geojson-vt to turn all layers into VTs?
The text was updated successfully, but these errors were encountered: