Sep 05 2008

Using Mapping Services with Flex

Published by at 9:13 am under AS 3.0,Flex

For a project i decided to try out the Flex libraries for both Yahoo maps and Google maps as well and they both seem to be pretty cool.

http://developer.yahoo.com/flash/maps/ and http://code.google.com/apis/maps/documentation/flash/

 

After working with examples of both the API’s it was not that difficult to find out which had better features.Lets consider the Visual Aspects first,

 

Speed

When you change the map types, Google emerges the clear winner. you can see it for yourself how fast the maps load. 

 

Zooming

When you zoom in and out, yahoo loads one tile at a time and its not pretty specially while zooming in. Google maps just scales the original image and then when the tiles load it fades out. It could have been better implemented by just waiting for all the tiles to load but they choose not to. Its not 100% clean but still better than yahoo.

 

Dragging

When you drag the map at any level, google maps keeps on repeating the images where as yahoo map just shows one image.It doesn’t matter much but i think its a nice feature to have. 

 

So visually Google is winner but for a Flash developer, Yahoo maps have a lot more to offer.

 

Geocoding

When you geocode something, both work well but the results returned by yahoo provide a lot more information. You can get the state and country information from the city name etc. It is awesome feature which google maps lack and hence for our application we are using yahoo maps.

 

Edit: If you look at the comments, I have been corrected that google does indeed have geocoding features, but i am sorry to say that as of 9th September 2008 the geocoding could use some work. See examples.

 

Search and Traffic

Yahoo maps allows you to get the traffic situation and also perform local search and then display the results on the map. Google map has no such features. 

 

Overlays

Google maps has polygon overlay which yahoo map lacks but then it seems easy to draw everything in yahoo maps using the Flash drawing API’s. 

 

I haven’t looked into changing the look and feel of the buttons etc but it seems to me that both the api’s allow the same. Samples and examples can be found for both, I will be putting one with yahoo maps soon.

 

Examples:

For our application I just wanted the map to move as the region were selected by the city, state and country data. you can check it out here, 

 

Yahoo Maps: Application Source

 

Google Maps: Application Source

 

Please Note: I am using amfphp to get the countries, states (US) and cities data. Also i have edited the keys in the source.

 

If you have both examples open, try to select the country yugoslavia and then see the results. At this point i stopped working on google maps example because it returned everything with yugoslavia. It can be a good thing or a bad thing depending on your application, for me it was bad thing. 

 

So Yahoo which returns me the country works for me, I am using standard city, state and country format to get the geocode results. Yahoo seems to be giving priority in that order.

 

2 responses so far

2 Responses to “Using Mapping Services with Flex”

  1. Pamela Foxon 05 Sep 2008 at 8:24 pm

    Re Geocoding: As of version 1.6, you can now get geocoding details. See this demo:
    http://gmaps-samples-flash.googlecode.com/svn/trunk/demos/GeocodingDetails/GeocodingDetails.html

    Re local search: You can use the local search API. See this demo:
    http://gmaps-samples-flash.googlecode.com/svn/trunk/demos/LocalSearcher/LocalSearcher.html

    Thanks for writing up the comparison!

  2. Nayanon 08 Sep 2008 at 8:38 am

    ok i stand corrected on the geocoding details, but for the search convenience with yahoo is that there is a Search class which is part of Map API, so that you don’t have to write your own http service to get local search results.

    thank you for those links pamela.

Trackback URI | Comments RSS

Leave a Reply