开发者

Clickable world map that returns the relivant 3166-1-alpha-2 country code

I want to make a click-able world map which when a user clicks on a country it directs the user to a url containing the corresponding country code.

e.g you cl开发者_JS百科ick on the UK and it directs you to .../country.php?c=GB

What would be the best way to go about it? html imagemaps? javascript? flash? Are there scripts already out there? Is there a way to use google maps?


http://davidlynch.org/js/maphilight/docs/demo_world.html#


You can construct such a clickable graphic using SVG.


It's very easy to implement what you want with jVectorMap mapping library. To define an action on country click use a onRegionClick parameter. The country code according to the ISO format is available as a second parameter in the callback.


I would, if I may, suggest to check out Highmaps, from the people behind Highcharts (myself included). It's free for non-commercial use, works great with mobile browsers (full touch support) and old IE down to IE6. It supports advanced dynamic features like drilldown and rich tooltips, and is very customizable.

We supply a map collection with over 350 maps, including several world map versions with ISO-3166-1-alpha-2 metadata embedded.

Clickable world map that returns the relivant 3166-1-alpha-2 country code

Clickable world map that returns the relivant 3166-1-alpha-2 country code

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜