Guest User

Untitled

a guest
Jul 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. package exo.ham{
  2.  
  3. import exo.ham.map.Map;
  4.  
  5. public class MapLocation{
  6.  
  7. private const MIN_LAT:int = -67;
  8. private const MAX_LAT:int = 180;
  9. private const MIN_LONG:int = -80;
  10. private const MAX_LONG:int = 84;
  11.  
  12. private const GLOBE_WIDTH:Number = 347;
  13. private const GLOBE_HEIGHT:Number = 164;
  14.  
  15.  
  16. private var _map:Map;
  17.  
  18. public function getLatitude(latitude:Number):Number{
  19. var currentX:Number = GLOBE_WIDTH - Math.abs(latitude - MAX_LAT);
  20. currentX = (currentX/GLOBE_WIDTH)*_map.width;
  21. return currentX;
  22. }
  23. public function getLongitude(longitude:Number):Number{
  24. var currentY:Number = MAX_LONG - longitude;
  25. currentY = (currentY/GLOBE_HEIGHT)*_map.height;
  26. return currentY;
  27. }
  28.  
  29. public function MapLocation(map:Map){
  30. _map = map;
  31. }
  32. }
  33. }
Add Comment
Please, Sign In to add comment