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

rendering maps outside R studio #2

Open
thibautjombart opened this issue Aug 12, 2015 · 11 comments
Open

rendering maps outside R studio #2

thibautjombart opened this issue Aug 12, 2015 · 11 comments

Comments

@thibautjombart
Copy link
Member

Trying the tutorial on github, I get:

> quickMap(cholera$deaths, col.by="Count", size.by="Count")
Warning message:
In writeMap(bbm, x.map, ...) :
  Cannot render in HTML viewer pane (require RStudio v.>0.98.5).
              Use 'directView' argument to render into your browser.

This was running R from a terminal, not inside RStudio which I suspect works. Would be cool to render to the default browser by default.

@fkeck
Copy link
Member

fkeck commented Aug 12, 2015

You can pass the directView argument to quickMap via the "..."
So this should work:

quickMap(cholera$deaths, col.by="Count", size.by="Count", directView = "browser")

Normally, rleafmap checks if the user is using Rstudio and adapts its behaviour. Something is wrong here, I will try to have a look.

@thibautjombart
Copy link
Member Author

works, thanks!

@joanna-lewis
Copy link

Works for me too using directView = "browser", but not automatically.
A couple of other rendering issues: I found that heatMap produced a graph that's initially very zoomed-out. Is this the behaviour you would expect? I also don't see any colours, even when heat.map in the top-right is ticked.
Thanks!
zoomed_out
no_colour

@fkeck
Copy link
Member

fkeck commented Oct 28, 2015

Are you using RStudio Joanna? Or something else?
If you use Rstudio, do you get the map directly in the viewer pane?

For the zoom problem, it's normal (but not the best I agree). The problem is that rleafmap automatically set the zoom and position to fit all the data of the map. Here the result is not good because the largest element is the colored grid which cover a very large surface (even if not working you can see its geographical extent). A solution is to set manually setZoom.

I don't now why you don't see the colored grid. Looks like the image is not generated or the link is wrong. Could you send me the HTML which is generated by heatMap?

@joanna-lewis
Copy link

I'm using the Mac GUI (the one you get when you download R - I'm not even sure what it's called!) So the map is appearing in a browser (Firefox).

I'm attaching the html that was generated.
_map.html.txt

@fkeck
Copy link
Member

fkeck commented Oct 28, 2015

Ok, I couldn't reproduce the bug and I have no idea what's happening here.
Do you have this png file created : [working directory]/_data/_rasters/_heatmap.png ?
Can you try to open the HTML directly from your file manager, and with Safari ?

@joanna-lewis
Copy link

The colours are also missing when I open it in Safari, and the png file is not there (but the _rasters folder is). So looks like that is the problem.

@fkeck
Copy link
Member

fkeck commented Oct 29, 2015

Hi Joanna, I suspect this is because I forced to use the png function with the cairo library and the latter may be not available for you. I just patched rleafmap to fix this issue. Can you try to reinstall rleafmap from GitHub

remove.packages("rleafmap")
devtools::install_github("fkeck/rleafmap")

And then try the example again.

@thibautjombart
Copy link
Member Author

Incidentally, what is the official supported browser? On most shiny apps,
and a few js app I have tested, chrome was substantially faster than
firefox.
It will probably be useful to put a disclaimer out: only xxx supported. We
don't want to open the can of worms of browser specific issues.. ;)

On Thu, Oct 29, 2015 at 10:43 AM, fkeck notifications@github.com wrote:

Hi Joanna, I suspect this is because I forced to use the png function with
the cairo library and the latter may be not available for you. I just
patched rleafmap to fix this issue. Can you try to reinstall rleafmap
from GitHub

remove.packages("rleafmap")
devtools::install_github("fkeck/rleafmap")

And then try the example again.


Reply to this email directly or view it on GitHub
#2 (comment).

@fkeck
Copy link
Member

fkeck commented Oct 29, 2015

Theoretically all the browsers supported by Leaflet are ok : Chrome, Firefox, Safari 5+, Opera 12+, IE 7–11. This can be added somewhere.
I usually do my tests with Firefox and Chromium.

@joanna-lewis
Copy link

Awesome, it's working now :) Thank you!
colours

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

No branches or pull requests

3 participants