Comments (6)
Hi Nigel- take a look at issue #3. I thought this was going to be a really quick fix, but the GeoJson object that's created doesn't have the same methods as the standard popup (naturally). However, it looks like I didn't read the Leaflet GeoJSON spec closely enough when I was digging on the last issue. I just got this working: http://bl.ocks.org/wrobstory/5762547
Unfortunately, I have another project I really need to put some time into this week- I'm not sure if I'll be able to get this integrated into Folium until early next week.
If you want to take a shot at it, it should be relatively straightforward:
- Make sure the vega.py and jquery scripts are being written to the HTML
- Make sure the parse function is being written
- The
popup_bind
function will need to be written with layer-specific attributes, probably via a loaded JSON object with width/height and correct vega json spec reference - Each layer needs to call the popup binding
onEachFeature
:
L.geoJson(gjson_1, {style: style_1, onEachFeature: popup_bind}).addTo(map)
That should be it- we'll probably also want to create a new folder for all of the vega json, especially if there are going to be tens or hundreds of specs. I'll get it implemented by the end of next week, but if you want to take a shot at it, I'll be happy to merge the pull request.
Really excited to see your final product!
from folium.
Hi Rob,
Ahh, I see the similarities between the two.
Good work on getting an initial implementation up and running as well.
Unfortunately as my Javascript skills are slightly lacking and I have a three week trip coming up I'm not sure if I'll have time to get my head around all of the new language idioms I'd have to learn. I'll give it a shot though, even just reading the code will be useful for my learning either way.
Broadly, the above is a map of Electricity Spot prices in New Zealand on a particular day. What would be really cool is to select a region, have the map zoom in and bring up a Time Series of the price data plus some other relevant data (e.g. Local demand, local generation that sort of stuff).
from folium.
I was wondering if this ever got implemented? It would be super useful for the project I'm working on.
from folium.
Folium underwent a major re-factor and we are re-visiting old issues. That is some we all want to see implemented, but time is scarce.
With that said we need to generalize onEachFeature
to take external Popups or to read data from the GeoJSON itself.
@BibMartin onEachFeature
was removed on the re-factor. Do you have any plans?
from folium.
I guess this is part of the simple-style
move we discussed in #198 and #266.
The Popup and Icons will have to be read from the GeoJson.
I'd suggest to keep all that in #198 to have centralized tracking.
from folium.
Referenced here. closing this to avoid duplication.
from folium.
Related Issues (20)
- Remove the deadlink in `CONTRIBUTING.md` which mentions manual installation of chromedriver and Chrome HOT 3
- docs: Error executing `realtime.md`'s code during building of local documentation HOT 2
- raise Value Error('Custom files must have an attribution') in folium HOT 2
- raise Value Error('Custom files must have an attribution') HOT 2
- Terminator renders wrong effect HOT 3
- Choropleth and branca colormaps do not show up with numpy 2.0 HOT 10
- backslashes in popup break page. HOT 9
- Folium loads two versions of bootstrap HOT 1
- Realtime plugin: load local GeoJson file HOT 8
- Add ability to add a dynamic text/title per frame when using TimestampedGeoJson HOT 2
- Possibility to show all points from geojson file with the realtime plugin. HOT 2
- Folium maps not displayed with Safari in Iphones HOT 1
- GeoJson style is not being applied correctly HOT 2
- Keep original size of image in CustomIcon
- NumPy 2.0 support HOT 4
- AttributeError: module 'folium' has no attribute 'plugins' HOT 1
- Marker with same ID results into broken html HOT 1
- Make Folium follow the Leaflet class hierarchy more closely HOT 4
- Add example pattern for pulling JsCode snippets from external javascript files HOT 9
- Support function objects in Leaflet options. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from folium.