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

Can we draw the polygon borders? #3

Open
SimonCoulombe opened this issue Oct 26, 2018 · 13 comments · May be fixed by #95
Open

Can we draw the polygon borders? #3

SimonCoulombe opened this issue Oct 26, 2018 · 13 comments · May be fixed by #95

Comments

@SimonCoulombe
Copy link

I've seen this issue on the original leaflet.glify, but I'm not sure how to implement it:
robertleeplummerjr/Leaflet.glify#14

cheers!

@tim-salabim
Copy link
Member

I am not sure either. I think it would be best if you add your request to the issue you mention above. It would surely be nice to have polygon borders.

@SimonCoulombe
Copy link
Author

will do!
Oh. and I forgot to thank you for your work on this package. I only found it yesterday and already made my first 60k polygons map. I'm hoping for 1 million now (.canadian postal codes), but I don't want to get my hope to high :)

@tim-salabim
Copy link
Member

I think you saw my post about 1.8 mio building footprints on twitter? Depending on polygon comexity you might need to chunk the data. There's also a faster way using data.table described in the inst/experiments folder of this repo.

I am very interested to hear back about any experience with this package so don't be shy to post your experience here.

@tim-salabim
Copy link
Member

@SimonCoulombe did you manage to plot the canadian zip codes?

@SimonCoulombe
Copy link
Author

Hi Tim,
Thanks for following up! I had to steer my time toward other projects, so mapping the postal codes has been on the back burner for a bit. I'll try to get to it when we get back from the holidays.

Merry Christmas (or holidays, whichever suits you better) :)

@tim-salabim
Copy link
Member

The upstream repo has a PR that has stalled a little, but maybe this will be added at some stage.

robertleeplummerjr/Leaflet.glify#32

tim-salabim pushed a commit that referenced this issue Apr 11, 2020
@nevilamos
Copy link

nevilamos commented May 28, 2020

Hi Tim,
still fairly new to github, trying to follow the outcome of issue#3 drawing borders - I would like to be able to draw just polygon borders with no fill. is this possible?
thanks

@tim-salabim
Copy link
Member

tim-salabim commented May 28, 2020

Yes! You just need to st_cast (assuming you use sf) your polygons to linestrings and then use addGlPolylines

@nevilamos
Copy link

nevilamos commented May 29, 2020 via email

@nevilamos
Copy link

I got this how I wanted eventually by drawing the ploygons completely transparent ( so I could still clikc on them to get attributes and also drawing the lines. Would be nice to roll into one as in addPolygons though.

@tim-salabim
Copy link
Member

tim-salabim commented Jun 2, 2020

When you use mapview with mapviewOptions(platform = "leafgl") you get both the polygons and the borders. I don't want to make this the default in leafgl, because a fix should not be too far away upstream. I think for making maps "manually" using leaflet et al. it is acceptable to do that one additional step.

I'll leave this open until we have a baked in solution for the polygon borders

@dholstius
Copy link

dholstius commented Jan 19, 2021

+1 for having borders baked in. HTML size is doubled when adding the polyline borders separately, "on top" of the polygons, via a subsequent call to addGlPolylines(). Guessing this is because all of the geometry is duplicated!

Thank you for all your hard work on this great library!

@tim-salabim
Copy link
Member

@dholstius yes the reason for doubling the size is that everything, especially the geometry data, is included twice. If I'm not mistaken, there is already a PR in the upstream repo to allow for drawing borders without having to add the data twice. So the current implementation here is a temporal workaround until we get that functionality cascaded down from upstream Leaflet.glify.

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 a pull request may close this issue.

4 participants