Support for Vector Grid#943
Conversation
Added VectorGrid support, check examples/VectorGrid
Added options for VectorGrid protobuf
folium/folium.py
Outdated
| for obj in args: | ||
| self.objects_to_stay_in_front.append(obj) | ||
|
|
||
| def add_vector_grid_protobuf(self,tiles,name=None,options=None): |
folium/folium.py
Outdated
|
|
||
| """ | ||
| _default_js.append( | ||
| ('vectorGrid','https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js')) |
folium/folium.py
Outdated
| """ | ||
| _default_js.append( | ||
| ('vectorGrid','https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js')) | ||
| vectorGrid = VectorGrid(tiles=tiles,name=name,options=options) |
folium/folium.py
Outdated
| _default_js.append( | ||
| ('vectorGrid','https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js')) | ||
| vectorGrid = VectorGrid(tiles=tiles,name=name,options=options) | ||
| self.add_child(vectorGrid,name=name) |
| vectorGrid = VectorGrid(tiles=tiles,name=name,options=options) | ||
| self.add_child(vectorGrid,name=name) | ||
|
|
||
|
|
folium/vector_layers.py
Outdated
| from folium.map import Marker, Layer | ||
|
|
||
| from jinja2 import Template | ||
| from jinja2 import Environment, PackageLoader, Template |
There was a problem hiding this comment.
F401 'jinja2.Environment' imported but unused
F401 'jinja2.PackageLoader' imported but unused
Added a generic vector grid (vector tiles) based choropleth component
|
@mumeraltaf sorry for the long time to review this. Nice stuff and great feature you have here but have you considered creating an external plugin and depend on folium instead? The reason I say this is b/c we won't be able to maintain the code. I would also recommend you pinning the |
|
I think this PR is nicely done, code looks good. Thanks for your effort @mumeraltaf! I'm inclined to include this in the repository because:
I would propose to move it to it's own plugin module though, since the appeal is not that broad (I assume) and technically it is a plugin. Furthermore, I think it's best not to include the Also, the two methods in Here are links to the two notebooks, which aren't working it seems by the way: |
53546b8 to
9f2299a
Compare
|
OK, so has this functionality been picked up anywhere yet? I like to display airspace using OpenAIP (https://maps.openaip.net) which is a vector tile layer as far as I can see: var OpenAIP = L.tileLayer('http://{s}.tile.maps.openaip.net/geowebcache/service/tms/1.0.0/openaip_basemap@EPSG%3A900913@png/{z}/{x}/{y}.{ext}', { |
|
This PR is very stale, so I'm going to close it now. This feature is still welcome, so if somebody wants to pick up the work here and address the comments (#943 (comment)) in a new PR that would be appreciated! |
|
This was also partially implemented in #1576, available in the 0.13.0 release. |
Addressing #937 and #563. Added a function to add vector tiles as base layer (namely protobuf) to a map.
Using VectorGrid plugin.
Usage Example: examples/VectorGrid.ipynb