Skip to content
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

Read GeoJSON style from file as default #198

Closed
ocefpaf opened this issue Aug 21, 2015 · 7 comments
Closed

Read GeoJSON style from file as default #198

ocefpaf opened this issue Aug 21, 2015 · 7 comments
Assignees
Labels
enhancement Feature request or idea about how to make folium better

Comments

@ocefpaf
Copy link
Member

ocefpaf commented Aug 21, 2015

We have a template (geojson_style.js) for styling the GeoJSON object.

function {{ style }}(feature) {
    return {
        {%- if quantize_fill %}
        fillColor: {{ quantize_fill }},
        {%- else %}
        fillColor: '{{ fill_color }}',
        {%- endif %}
        weight: {{ line_weight }},
        opacity: {{ line_opacity }},
        color: '{{ line_color }}',
        fillOpacity: {{ fill_opacity }}
    };
}

The template is filled here and that usually happens with the default values. But if the GeoJSON file has properties defined a simple function style_1(feature) {return feature.properties;} would suffice and, in same cases, that is the expected behavior.

I would like to discuss here the possibility of making "reading from properties" the default behavior instead of the default values we have and leave the kwargs as an override option.

@ocefpaf
Copy link
Member Author

ocefpaf commented Dec 3, 2015

It won't be default but a function for the simple-spec will be available.

See #266.

@ocefpaf ocefpaf reopened this Dec 3, 2015
@ocefpaf ocefpaf added this to the v0.2.1 milestone Dec 3, 2015
@ocefpaf ocefpaf added the enhancement Feature request or idea about how to make folium better label Dec 3, 2015
@ocefpaf
Copy link
Member Author

ocefpaf commented Dec 4, 2015

We should also implement a way to add onEachFeature.

(See #6 (comment))

@baobobs
Copy link

baobobs commented Dec 15, 2015

It would be great to have popup capability added to geojson / choropleth layers. Eager to see onEachFeature added. Thanks guys!

@ocefpaf ocefpaf modified the milestones: v0.2.1, v0.3.0 Dec 17, 2015
@ocefpaf
Copy link
Member Author

ocefpaf commented Sep 23, 2016

Closing this as we never found a champion to write the simple style.

@ocefpaf ocefpaf closed this as completed Sep 23, 2016
@jgoad
Copy link

jgoad commented Nov 29, 2016

@ocefpaf Sorry I just followed the rabbit hole of issues to get to this point. Does this mean there is no implementation for popups on geojson layers?

@ocefpaf
Copy link
Member Author

ocefpaf commented Feb 3, 2017

@ocefpaf Sorry I just followed the rabbit hole of issues to get to this point. Does this mean there is no implementation for popups on geojson layers?

I plan to work on this soon, unless someone beats me to it.

@jzf2101
Copy link

jzf2101 commented Aug 1, 2017

Any news on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or idea about how to make folium better
Projects
None yet
Development

No branches or pull requests

4 participants