Developer Network Home  Help 

YDN Flash Developer Center Yahoo! Maps AS3 Component
Flash Developer Center

Yahoo! Maps AS3 Component

The all-new Yahoo! Maps component for Flex 3 enables you to add a map to a wide-range of web and desktop applications. Included in the API is support for other Yahoo! APIs including the geocoder, local search and traffic APIs along with an advanced marker and overlay manager to allow you to easily represent data on the map.

Using the YahooMap component in your Flash, Flex, Ajax or AIR projects gives you the ability to develop anything from a simple map mash-up to full application utilizing Yahoo! Maps.

Download

Installation Instructions

To use the Yahoo! Maps component for Adobe Flex in Flex Builder, you need to add the component SWC to your Library path.

  1. Find your project in the Flex Navigator.
  2. Right-click on the project and choose Properties or open the Project menu and choose Properties.
  3. In the project properties dialog, choose Flex Build Path.
  4. Select the Library path tab, and press the Add SWC... button.
  5. Enter the location of the component SWC. It should be in [download location]/Build/YahooMap.swc.
  6. Press OK in the Add SWC dialog.
  7. Press OK to close the project properties.
  8. The YahooMap component is now available in your project.

Getting Started: Yahoo! Maps for ActionScript 3.0

The new Yahoo! Maps API is now entirely built in ActionScript 3.0. The Maps API now gives you an incredibly powerful map engine and the ability to create custom components, overlays and markers while consuming different webservices provided by Yahoo!, or your own. The YahooMap component is distributed as a SWC, to get started you need to include it into your build path using Flex Builder.

The Maps API contains a core set of widgets, markers, overlays and web services to enable you to interact with the map in every way.

Get started by signing up for an API key. Then download the component and check out the examples and class reference documentation.

Screen capture of YahooMap ActionScript Example

To see a live example, please install Adobe Flash Player version 9 or higher.

Initializing a YahooMap with ActionScript

To instantiate a YahooMap object, import the YahooMap class first, then simply create an instance of it by passing your application ID, width and height, then add it to the display list using addChild().

This example uses the demonstration application ID "YD-xFXTJZE_JXxtEhlSnytgvQ--"; you cannot use this Application ID and must request one here.

At this point you can add event listeners, map controls and widgets and start interacting with the map.

For additional topics, please read Using YahooMap, or take a look at the Examples section for further functional demonstrations. The ActionScript 3.0 Class Reference contains full details on every property, method, and style available to the YahooMap component.

The Yahoo! Maps API is a free service for any application that is free or charge and does not exceed the rate limit of 50,000 requests a day. Please see the information on rate limiting and the maps API usage policy for more information about building your application with Yahoo! or requesting an exception to the rate limits.