leonardoamx / air-maps-ane

Automatically exported from code.google.com/p/air-maps-ane
0 stars 0 forks source link

can I get LatLong after touching the map? #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
right now I'm able to get center LatLong, but can I get Latlong wherever I 
touch the Map.

Original issue reported on code.google.com by achieveg...@gmail.com on 17 Jun 2013 at 11:21

GoogleCodeExporter commented 9 years ago
Did you ever figure out how to get the LatLong for where the user touches?  How 
do you get LatLong for the center?

Original comment by jim.orla...@gmail.com on 7 Jul 2013 at 9:27

GoogleCodeExporter commented 9 years ago
for center, you can just call map.getCenter() and it returns the LatLng for 
center. 
I think I didnt added the method to get the LatLng or cartesian coordinates for 
the map center. But it should be pretty simple to add that method. Let me know 
if you need any help.
A pointer : 
http://stackoverflow.com/questions/3959994/how-to-add-a-push-pin-to-a-mkmapviewi
os-when-touching

Original comment by shahme...@gmail.com on 7 Jul 2013 at 10:27

GoogleCodeExporter commented 9 years ago
Hello and thank you for the quick response.  The ANE that you wrote is 
fantastic. I realized after I wrote this how easy it was to 'getCenter()'.

I am a Flash programmer and do not have access to a Mac / XCode very easily, 
but I read the link that you added to your response.  What I am looking for is 
the following: Within the ANE, MapKit appears to zoom in when you double-tap.  
Would it be possible to trigger an event on a single tap (along with the 
lat/lng of where the tap is) ... so that we can programmatically drop a Pin 
from AS3 on where the user has single-tapped?

Original comment by jim.orla...@gmail.com on 7 Jul 2013 at 4:18

GoogleCodeExporter commented 9 years ago
Ok I understand. It is a very valid use case. I will add this feature in the 
next release. By when do you want this to be added ? I am busy for few days 
working on other project.

Original comment by shahme...@gmail.com on 7 Jul 2013 at 6:44

GoogleCodeExporter commented 9 years ago
Wow - thank you so much; in a few days is completely ok with me! If I know it 
is coming I can simply work on the AS3 and then integrate the ANE when ready. I 
have done a bit more research and found another links that might come in handy 
for when you do get to this:
http://stackoverflow.com/questions/4317810/how-to-capture-tap-gesture-on-mkmapvi
ew
- describes how to intercept a double-tap AND a "long hold" (your link 
described only the long hold); after thinking about it a bit, and ideal ANE 
would work on a long-hold but allow the AS3 coder to set the duration of the 
hold. That way if the AS3 coder wanted it to simply be a single tap then he/she 
could set the hold-time to 100 ms or something like that.

Also (to push my luck) another 'handy' feature would be to be able to get the 
latlng coordinates of the top-left of the map (ie similar to getCenter() but 
instead being getTopLeft() ).  Thus, when a user taps the map (or long-holds, 
whichever you implement) AS3 will know the latlng (from the tap event info) AND 
be able to triangulate to where in the Rectangle (in pixel coordinates) the 
user has tapped.  eg say you are using a display Rectangle of 0,0,600,600 and 
if topleft latlng is 40,40 and center latlng is 50,50 then bottomRight latlng 
is 60,60.  If the tap latlng is 55,55 then AS3 knows that the person has tapped 
within the Rectangle at about 450,450.  This may come in handy when you convert 
to a bitmap to know where to overlay diagrams, etc.  Right now I have a 
work-around that simply calculates the edge latLng by using the getZoom factor 
but it is a difficult and inaccurate work-around.

Thanks again for publishing this out to the community.

Original comment by jim.orla...@gmail.com on 7 Jul 2013 at 8:37

GoogleCodeExporter commented 9 years ago
Hi - I was just wondering whether you have had a look at updating the MapKit 
ANE?  Jim

Original comment by jim.orla...@gmail.com on 15 Jul 2013 at 9:26