-
Notifications
You must be signed in to change notification settings - Fork 32
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
Color problem when using different tiles providers? #4
Comments
Can you provide your leaflet() %>%
addProviderTiles(provider = providers$CartoDB.DarkMatter) %>%
leaflet.glify:::addGlifyPolygons(nc, color = cols) %>%
fitBounds(lng1 = unname(st_bbox(nc)$xmin),
lng2 = unname(st_bbox(nc)$xmax),
lat1 = unname(st_bbox(nc)$ymin),
lat2 = unname(st_bbox(nc)$ymax)) # making the second map with a different tile provider:
leaflet() %>%
addProviderTiles(provider = providers$OpenStreetMap.Mapnik) %>%
leaflet.glify:::addGlifyPolygons(nc, color = cols) %>%
fitBounds(lng1 = unname(st_bbox(nc)$xmin),
lng2 = unname(st_bbox(nc)$xmax),
lat1 = unname(st_bbox(nc)$ymin),
lat2 = unname(st_bbox(nc)$ymax)) Session info (click to view)R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] colourvalues_0.1.1 leaflet.glify_0.1.0 leaflet_2.0.2 sf_0.7-0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.18 magrittr_1.5 units_0.6-1 xtable_1.8-3 R6_2.2.2 tools_3.5.1 grid_3.5.1
[8] e1071_1.7-0 DBI_1.0.0.9000 rapidjsonr_1.1 htmltools_0.3.6 crosstalk_1.0.0 class_7.3-14 yaml_2.2.0
[15] digest_0.6.17 shiny_1.1.0 spData_0.2.9.3 later_0.7.3 htmlwidgets_1.2 promises_1.0.1 mime_0.5
[22] geojsonsf_1.2 compiler_3.5.1 classInt_0.2-3 jsonlite_1.5 httpuv_1.4.5 |
Working on Rstudio server |
Considering you didn't have the problem, I did more test on my side. I've tried to use this code on my windows machine. Actually, in that case, the result is even worst, I get nothing display for the first map and only the tiles with no polygons for the second call. here is my sessionInfo for me Windows machine. All my packages are up to date but R is 3.5.0.
|
Are your problems in RStudio viewer, the browser or both? And which browser are you using? Chrome does normally not allow local files to be served, so nothing may be displayed. Firefox usually works fine. |
I'm continuing my tests both on windows and linux. On windows:
For the problem on my linux machine, I'm currently updating my machine and it's taking a long time. I'll post my results as soon as I have them. |
Thanks! Can you please also provide screeshots with those that show the console, not the inspector. |
For Linux: I'm on rstudio Server, running on a azure virtual machine with ubuntu 16.04 and called by Chrome on my local windows machine. I can't use firefox on this machine, corporate policy... I've updated all R and the packages but I didn't update my Rstudio server. If I run the script, I get the same thing as before the update. see below: |
Perfect thanks! |
Is that it? |
can you just click on link id="glpolygonsdt-1-attachment" rel="attachment" href="lib/glpolygonsdt-1/glpolygons_data.json" in this tab please. The href part should be clickable |
`{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"id":1},"geometry":{"type":"Polygon","coordinates":[[[-81.47257911591413,36.23448491106877],... |
Did you put that first ` there? Or is this part of what you see in the browser? A screenshot would be better |
Ok, I can reproduce the error. It happens when I open the |
When adding
|
Ok, I see the same behaviour when using R GUI ("file:///") which seems to have problems with relative attachments.
and try to open that in firefox. This should diplay the shapes. As for your RStudio server problem, would you mind trying to set |
For the
The file produced do not have polygons. Seems to me like were are troubleshooting to distinct problems... |
Thanks for testing, I have seen the weird opacity behaviour before, but didn't encounter it recently. No idea what changed though... strange For the url part in mapshot just provide a path where you want to save the map, like |
Yeah, just figure after doing |
New update: Good news, I fixed my proxy problem and I can reproduce the color/opacity bug on windows/Rstudio. So in that case, if I call in the viewer pane, only CartoBD works and OpenStreet map doesn't (kind of weird behaviour...). If I use However, I still do not see my shape if I call the script in the R GUI. |
I think I found the culprit regarding the missing shapes https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs I will investigate |
@BastienFR the above commit should fix the issue with no shapes being shown. The "funny colour" issue is likely beyond this repo, but may need to be addressed in the downstream JS dependency. |
Good, the shape is being shown now no problem! Thanks. For the colors, I'll try to manage around the tiles selection and opacity to find something that works for me. Hopefully the problem will get fix some time. Thanks for your time and your great package. |
I just found that in Opera the colors seem to be fine, no matter the background. Do you have any chance to test and confirm this? |
bummer! I will keep investigating... The shape should reappear once you interact with the map |
To add to the whole confusion... I have access today to another computer with windows 10 this time. The main difference with this computer vs the other ones used above is that it's my own computer not on a corporate network (actually Azure Machines within my company firewall). Other things could maybe have changes (mostly version of the different software), but that time I get it right on both Chrome and Firefox: So, could it be some king of security issue? It would be weird considering that it's linked with the opacity level. Also, we never had any problem with the base leaflet with that setup, why would leaflet.glify be different? But now that I'm thinking about it, I think our Azure machine are very limited graphic wise while my personal machine has a Nvidia 1060. Could the GL part of the code of your software requires more graphical computing power? Adding the opacity would complicate the rendering? However, why would it work with CartoDB and the dark background... Could the fact that my machine are Virtual caused the problem? I'm sending that out there, but this is way over my level. |
Over my skill level too unfortunately. BTW, I cannot access the html which is a localhost... |
For the local host, it was a copy-paste mistake, I've fixed it |
So after talking to some people more aware of our server, it doesn't seem the graphical capacity of our system is the problem. Actually, to be sure I've build the map on rstudio linux server, saved it with |
Can you email me the map? |
https://www.dropbox.com/sh/icbll2annfo32ar/AADDhf3NfCyRIngTieijKkiLa?dl=0 In the dropbox link is the problematic map. I actually joined 2 maps: The first: test_glify, I’ve created it on Rstudio Server on a Linux Azure VM and save it using mapview::mapshot. I couldn't view it on either of my computer The second: test_glify_works , I’ve created it on my personal windows machine, it worked there. Try them both, you’ll notice that there is a huge file difference. Like the polygons weren’t saved with the problematic one. The same code was used to save both. |
Ok, Time out. I think the problem of shape not displayed is because I've updated the package only on my windows machine and not my linux one (I'm getting confuse with all the tests I'm doing, that's a bad sign...) So in the dropbox link, it's probably the same bug you already fixed. However I can't confirm it because I exceeded (???) my github api limit... I'll could retest it tomorrow. I redid the same test but on my Azure Windows machine which is updated for your package. I've added a folder in the dropbox link (test2) with the result. Interestingly, these 3 maps, which are not working on 2 of my machines are all working find on my personal machine... Therefore, it seems like it's pointing to again some kind of remote rendering issue... Tomorrow, I'll get a couple of colleagues to test the visualisation on there side as well. sorry about that |
I did more and more tests and I think I found the root of it. It's quite an obscure problem. The problem of bad colors when Now, for an obscure reason, this doesn't apply if we use Now, clearly this is out of the repo, however I still think is worth documenting it here. The only possible workaround I've found is to use Hopefully a chrome or webgl update will fix that soon. If anybody sees that and have access to other kind of remote desktop (other than Azure or Citrix), it would be nice to know if they are experiencing the same problem. |
Reopening, as I still see this on my laptop w ubuntu. Chrome, Firefox show wrong colors, Opera and RStudio viewer are fine... |
I've noticed the the color used to with
addGlifyPolygons
doesn't work for all tile providers.See RE:
Do you know what the problem is?
The text was updated successfully, but these errors were encountered: