Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package exo.ham{
- import exo.ham.map.Map;
- public class MapLocation{
- private const MIN_LAT:int = -67;
- private const MAX_LAT:int = 180;
- private const MIN_LONG:int = -80;
- private const MAX_LONG:int = 84;
- private const GLOBE_WIDTH:Number = 347;
- private const GLOBE_HEIGHT:Number = 164;
- private var _map:Map;
- public function getLatitude(latitude:Number):Number{
- var currentX:Number = GLOBE_WIDTH - Math.abs(latitude - MAX_LAT);
- currentX = (currentX/GLOBE_WIDTH)*_map.width;
- return currentX;
- }
- public function getLongitude(longitude:Number):Number{
- var currentY:Number = MAX_LONG - longitude;
- currentY = (currentY/GLOBE_HEIGHT)*_map.height;
- return currentY;
- }
- public function MapLocation(map:Map){
- _map = map;
- }
- }
- }
Add Comment
Please, Sign In to add comment