views:

554

answers:

4

Hi.

I'm looking to create a "Countries You've Visited" map - just like the ones you've probably seen on Facebook, TravelAdvisor and whatnot.

I've tried different flash kits, but they're not quite as advanced as I'd like them to be. The main problem I've encountered with all the different kits is changing the background color on a country when you click on it and have it keep that color when you "deselect" it. This is obviously necessary to give the user some visual feedback.

The only way I've managed to do this so far is to initialize the flash through javascript with a huge XML string, have a click callback that interacts with Javascript, and with javascript alter the XML string using regular expressions, then send back the XML to the flash. It's pretty obvious that this method is FAR from optimal, and also very, very slow.

I've tried FusionMaps, amMap, AnyMaps and diyMap and so far I've not found any way of doing this with either of them. If anyone has done anything similar with either of these, I'd really to know how :-)

Does anyone have any pointers or suggestions on what I should look at? I'm starting to think that it would be a simpler (though less flexible) to just use the free SVG continent maps on Wikipedia, convert them to PNG and create an image map of all the countries - then use Canvas and VML to draw an element on top of the countries - but this just seems like a huge pain and very error-prone compared to a flash solution.

Thanks for reading, and I hope someone has some pointers for me :-)

  • Mr. Doom
A: 

If it will work for what you're building, Virtual Earth is in 6.1 these days and has a lot of excellent and easy-to-use javascript calls in the API to load polygons. If you have the point data that defines the countries (which should be freely available), you can easily define a VEShape polygon with an array of VELatLong objects, and toss an event handler on it to color them on click. The nice thing about VE is that the javascript API is really flexible and easy to use, and exposes a lot of nice mapping features.

Grank
A: 

In case you are interested, there is an ASP.NET Virtual Earth Mapping Server Control here:

http://simplovation.com/page/webmapsve.aspx

This is essentially a "wrapper" around Virtual Earth that abstracts out most (if not all) of the JavaScript that you would traditionally need to write. It allows you to handle map events and manipulate map events completely from server-side .NET code.

Chris Pietschmann
+1  A: 

Try starting with Google Maps. If you want a good example of a website that uses Google Maps and put colored areas on it, visit Wikimapia.org.

thenonhacker
A: 

I was looking for the same thing, and then I found Google's Virtualization Intensity Map. You can find more information here:

http://code.google.com/apis/visualization/documentation/gallery/geomap.html