Geo Charts - Display Country-State-City Map

1,718 views
Skip to first unread message

ravi prakash

unread,
Oct 8, 2015, 8:53:13 AM10/8/15
to Google Visualization API
Hi All,

I recently started using Geo Charts and it looks really great. I want to develop some thing like this,

First load the world map 
Click on a country in world map to load the particular country map - Now map must change to clicked country showing all states in clicked country
Click on a state in country map to load all cities/counties/regions in that state. - Now map must change to state showing all cities in the clicked state.

Please let me know how to achieve this using Geo Charts. 

Thanks,
Ravi

Sergey Grabkovsky

unread,
Oct 8, 2015, 9:43:17 AM10/8/15
to Google Visualization API
Hi Ravi,

The GeoChart doesn't have any city or county region maps. What you'd have to do is to switch the GeoChart to 'markers' mode when you want to display cities, and trust the geocoding to work correctly.

Effectively, you'll have to listen for the 'regionClick' event from the GeoChart, which will tell you which region was clicked. At that point, you would have to detect whether you need to display cities, and if so, switch to 'markers' mode and render your cities dataset.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/59b90c2c-3bd9-4829-90cf-c120b3e2ef4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages