-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Support for Vector Grid #943
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
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E231 missing whitespace after ','
folium/folium.py
Outdated
| """ | ||
| _default_js.append( | ||
| ('vectorGrid','https://unpkg.com/[email protected]/dist/Leaflet.VectorGrid.bundled.js')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E231 missing whitespace after ','
folium/folium.py
Outdated
| """ | ||
| _default_js.append( | ||
| ('vectorGrid','https://unpkg.com/[email protected]/dist/Leaflet.VectorGrid.bundled.js')) | ||
| vectorGrid = VectorGrid(tiles=tiles,name=name,options=options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E231 missing whitespace after ','
folium/folium.py
Outdated
| _default_js.append( | ||
| ('vectorGrid','https://unpkg.com/[email protected]/dist/Leaflet.VectorGrid.bundled.js')) | ||
| vectorGrid = VectorGrid(tiles=tiles,name=name,options=options) | ||
| self.add_child(vectorGrid,name=name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E231 missing whitespace after ','
| vectorGrid = VectorGrid(tiles=tiles,name=name,options=options) | ||
| self.add_child(vectorGrid,name=name) | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W391 blank line at end of file
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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