-
Notifications
You must be signed in to change notification settings - Fork 152
Description
Hi
i am trying to get the custom marker set as described in https://developers.google.com/chart/interactive/docs/gallery/map#adding-multiple-marker-sets to work so that some points in my map use one marker icon while the rest use another marker icon...cant seem to get that to work..note that i can change the default marker icon..that works..so i added a new column to my data frame (doing this in R) called Marker (from what i understood from the html example) and it is correctly set to say some points have the Marker label as "pink" while the rest are set to "default"..but what i see is that all points end up using the "default" marker..
Here is my code...any help wold be very much appreciated.. have spent several hours on this...i am hoping this is supported...if not could you suggest an alternate way of doing this?
df = df %>%
mutate(LatLong=gsub(",", ":", lat_long)) %>%
mutate(Tip=paste("Times seen
", "Count=", total, sep=""))%>%
mutate(Marker=ifelse(total>300, "pink", "default"))
icons = "{'pink': {'normal': 'http://icons.iconarchive.com/icons/icons-land/vista-map-markers/48/Map-Marker-Ball-Pink-icon.png', 'selected': 'http://icons.iconarchive.com/icons/icons-land/vista-map-markers/48/Map-Marker-Ball-Right-Pink-icon.png'}, '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'}}"
M1 <- gvisMap(df, "LatLong", "Tip",
options=list(showTip=TRUE, showLine=F, enableScrollWheel=TRUE, zoomLevel=2,
mapType='terrain', useMapTypeControl=TRUE,width="900px",height="600px",
icons=icons))
plot(M1)