mages / googleVis

Interface between R and the Google Chart Tools
https://mages.github.io/googleVis/
360 stars 155 forks source link

Changing icons #55

Closed paulvern closed 7 years ago

paulvern commented 7 years ago

Can you please give me a sample code to change the standard icons in gvisMap to custom icons (for example this: https://d30y9cdsu7xlg0.cloudfront.net/png/25853-200.png)? I've tried a lot of different input formats as options but It seems nothing will show when changing the standard pins to a custom image (the map simply doesn't draw). Thank you very much.

mages commented 7 years ago

Here is an example:

library(googleVis)
df <- data.frame(Adress=c("EC3M 7HA", "東京都新宿区北新宿2-21-1"),
                 Tip=c("Lloyd's", "Tokyo R User Group"))
plot(gvisMap(df, "Adress", "Tip",
             options=list(mapType='normal',
                          icons="{'default': {'normal': 'http://icons.iconarchive.com/icons/icons-land/vista-map-markers/48/Map-Marker-Ball-Azure-icon.png',
                                               'selected': 'http://icons.iconarchive.com/icons/icons-land/vista-map-markers/48/Map-Marker-Ball-Right-Azure-icon.png'}
                                  }", width=800, height=250)))
paulvern commented 7 years ago

This is the result for me: no pins at all. Is there something wrong in my network?

google

mages commented 7 years ago

I guess so, as this is what I see (note the pin icons in England and Japan): screenshot

paulvern commented 7 years ago

I changed the address of the icon to another one and now it works. Definitely something was blocked by our proxy. Thank you very much. Is there any option to show points as heat maps as you can do with google fusion tables or to explode the pins when multiple pins are at the same coordinates?

mages commented 7 years ago

I am not aware of it. I think, the Google Charts Forum is the best place to seek advice: https://groups.google.com/forum/#!forum/google-visualization-api