Skip to content

Pattern #966

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

Merged
merged 22 commits into from
Jan 12, 2019
Merged

Pattern #966

merged 22 commits into from
Jan 12, 2019

Conversation

ColinTalbert
Copy link
Contributor

@ColinTalbert ColinTalbert commented Sep 18, 2018

This is my first attempt to author a plugin. It's working but I have a few concerns or questions.

The main one is that I need to pass a JS object with the pattern to the style_function. I did this by editing features.py to type check for branca MacroElements and passing their name to the output instead of themselves. Even still the name was getting passed enclosed in quotes, which I'm manually stripping for now. Ideas on an alternate or cleaner way to accomplish this business would be appreciated.

Also I wasn't quite sure how to structure the test.

here's the example:
http://nbviewer.jupyter.org/github/talbertc-usgs/folium/blob/pattern/examples/Pattern.ipynb

@jtbaker
Copy link
Contributor

jtbaker commented Sep 19, 2018

Cool PR, @talbertc-usgs! thanks for taking the time to submit.

@Conengmo Conengmo added the waiting for review PR is waiting to be reviewed label Oct 15, 2018
Copy link
Member

@ocefpaf ocefpaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just waiting on @Conengmo's 👍 to merge it.

@Conengmo
Copy link
Member

Hi @talbertc-usgs, I was checking out your PR and while doing that I made some changes:

  • The pattern classes should always be added to a Map object.
  • The pattern objects will be rendered in GeoJson.style_data() if they weren't added to anything. This means you no longer have to call stripes.add_to(m), which I assume many people would forget to do :)
  • The test_pattern() test now uses a local data file instead of getting it from a URL.

Since I also made some changes/simplifications to GeoJson, I would like for @ocefpaf or @jtbaker to have a look as well.

Even still the name was getting passed enclosed in quotes, which I'm manually stripping for now.

It's not perfect but for now this seems a good solution.

@Conengmo
Copy link
Member

Conengmo commented Jan 7, 2019

@talbertc-usgs do you want to take a final look at this? I would like to go ahead with merging this :)

@Conengmo Conengmo removed the waiting for review PR is waiting to be reviewed label Jan 12, 2019
@Conengmo Conengmo merged commit 75a44c3 into python-visualization:master Jan 12, 2019
@Conengmo
Copy link
Member

Hope you're not in the shutdown @talbertc-usgs? Anyway, thanks for making this PR! Hope you liked contributing to folium.

@ColinTalbert
Copy link
Contributor Author

ColinTalbert commented Jan 28, 2019 via email

@Conengmo
Copy link
Member

Hi Colin, I think it’s good for now, but do try it out for yourself. If you want to help out again with folium you’re very welcome to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants