×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:How to implement a Relative Map using GPS in Flash Lite 3.0

From Nokia Developer Wiki
Jump to: navigation, search
cristovaodoj (Talk | contribs)
cristovaodoj (Talk | contribs)
Line 11: Line 11:
 
1.2 - Insert 4 (four) KeyFrames as in the order shown below:
 
1.2 - Insert 4 (four) KeyFrames as in the order shown below:
  
Frame 1:
+
[[File:Frames.PNG | center]]
[[File:Screen_1.PNG | 150 px | left]]
+
  
Frame 2:
+
{{ Tip | To make easy the application's screens creation set the first frame as the same shown above (Frame 1) the add the next ones; Thereby you won't need repeating code for the repeated components on the diferents frames which have the same functionalities.
[[File:Screen_2.PNG | 150 px | left]]
+
}}
  
Frame 3:
 
[[File:Screen_3.PNG | 150 px | left]]
 
  
Frame 4:
+
===Relative Map Scheme===
[[File:Screen_4.PNG | 150 px | left]]
+
 
 +
Let's understand what 'area_limit' is; It is the maximum value in meters which you can move vertically or horizontally.
 +
As the name says 'scale' represents the scale between the drawn rectangle height on the frame and the 'area_limit' double. This value means that every walked meter M in the real world there are P 'walked' pixels on the mobile screen.
 +
So, we had found the 'd_x' and 'd_y' meters distances multiply each one of them for the 'scale' to acquire the horizontal and vertical disntances in pixels. For more details see the scheme shown below:
 +
 
 +
[[File:Scheme_relative_map.PNG | center]]

Revision as of 04:40, 5 March 2010


A Relative Map is known as a in-scale map according with the distance in the real world. For example: You retrieve your current coordinates by GPS and, after that, move 100 meters ahead and then you want to know the pixel distance on the mobile phone's screen regarding with the scale you chose. Would be better show where you are in the Relative Map in agreement with your moviments. Well, I'll explain step-by-step how to do it from, implement the geometric functions to calculate the relation between the real world distance and the relative distance to retrieve asynchronously GPS location informations.

Frames Design

1.1 - For starts you must create a new mobile project and select Flash Lite 3.0 and ActionScript 2.0 as player version and ActionScript version, respectively.

1.2 - Insert 4 (four) KeyFrames as in the order shown below:

Frames.PNG

Tip.pngTip: To make easy the application's screens creation set the first frame as the same shown above (Frame 1) the add the next ones; Thereby you won't need repeating code for the repeated components on the diferents frames which have the same functionalities.


Relative Map Scheme

Let's understand what 'area_limit' is; It is the maximum value in meters which you can move vertically or horizontally. As the name says 'scale' represents the scale between the drawn rectangle height on the frame and the 'area_limit' double. This value means that every walked meter M in the real world there are P 'walked' pixels on the mobile screen. So, we had found the 'd_x' and 'd_y' meters distances multiply each one of them for the 'scale' to acquire the horizontal and vertical disntances in pixels. For more details see the scheme shown below:

Scheme relative map.PNG
75 page views in the last 30 days.
×