简体   繁体   中英

Show statistical data (ex. population) of a country per state in Google Maps

The main goal is for me to display a US map in google maps, highlighting all states. States should be plain colored, no markers, no city names, etc.. just plain colored, only showing the borders of each state. Then when clicking any state, a popup window will appear containing various info about the state ( ex. population, etc..) The pop up window is the same as the pop up window you see when clicking a marker.

I know some basic google maps api stuff, but I could use some help. Code samples would be awesome! Thanks.

Do you actually need geo info? Google maps probably overcomplicates it if you don't. You might find it easier to use some simple javascript library that provides you with just the shapes.

Have a look at this for a start: newsignature.github.io/us-map/

stateSpecificStyles lets you customise the initial color of each state

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM