To retrieve a map through the use of geolocation coordinates is one of the fundamental uses of the ActionScript Geolocation API. In this recipe, we will examine how to render a map on the Stage and generate a marker based on latitude and longitude coordinates reported by the device geolocation sensors using the Google Maps API for Flash.
There are a few steps we will need to take before getting into the recipe itself. These steps will prepare our project with the proper code libraries and allow us access to the Google Maps services:
1. First, we must download the Google Maps API for Flash from http://code.google.com/apis/maps/documentation/flash/
2. The package will include two separate
.swc
files. One for Flex, and the other for ActionScript projects. In this example, we will extract the pureAS3 .swc
to our local hard drive.3. From the same URL (in the first point) click on the link that reads Sign up for a Google Maps API...