Git Product home page Git Product logo

Comments (6)

wrobstory avatar wrobstory commented on May 22, 2024

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.

NigelCleland avatar NigelCleland commented on May 22, 2024

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.

timhowcroft avatar timhowcroft commented on May 22, 2024

I was wondering if this ever got implemented? It would be super useful for the project I'm working on.

from folium.

ocefpaf avatar ocefpaf commented on May 22, 2024

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.

BibMartin avatar BibMartin commented on May 22, 2024

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.

ocefpaf avatar ocefpaf commented on May 22, 2024

Referenced here. closing this to avoid duplication.

from folium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.