Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

README.md

as3geolocation

as3geolocation is ActionScript wrapper utility that can easily use HTML5 Geolocation API with Flash/Flex.

Samples

How to use

HTML

<head>
  ...
  <script type="text/javascript" src="as3geolocation-0.1.0.js"></script>
  ...
</head>

Flash/Flex

import com.google.code.as3geolocation.Geolocation;

protected function getPositionButton_clickHandler(event:MouseEvent):void
{
  Geolocation.getCurrentPosition(setPosition);
}

private function setPosition(position:*):void
{
  var latitude:Number = position.coords.latitude;
  var longitude:Number = position.coords.longitude;
  var altitude:Number = position.coords.altitude;
  var accuracy:Number = position.coords.accuracy;
  var altitudeAccuracy:Number = position.coords.altitudeAccuracy;
  var heading:Number = position.coords.heading;
  var speed:Number = position.coords.speed;
  
  map.clearOverlays();
  map.setCenter(new LatLng(latitude, longitude), 14, MapType.NORMAL_MAP_TYPE);
  var markerA:Marker = new Marker(
    new LatLng(latitude, longitude),
    new MarkerOptions({
      radius: 12,
      hasShadow: true
    })
  );
  map.addOverlay(markerA);
  
  latLngText.text = "latitude: " + latitude + "\r"
    + "longitude: " + longitude + "\r"
    + "altitude: " + altitude + "\r"
    + "accuracy: " + accuracy + "\r"
    + "altitudeAccuracy: " + altitudeAccuracy + "\r"
    + "heading: " + heading + "\r"
    + "speed: " + speed;
}

About

as3geolocation is ActionScript wrapper utility that can easily use HTML5 Geolocation API with Flash/Flex.

Topics

Resources

License

Releases

No releases published
You can’t perform that action at this time.