Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Is it possible to pinpoint my GPS location in my own image of a map instead of using newmapview?
Started by sirmania Mar 14 2016 04:38 AM

2 replies to this topic
newmapview image zoom pinch rotate map gps location longitude latitude
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

sirmania

[GLOBAL: userInfoPane.html]
sirmania
  • Contributor

  • 154 posts
  • Corona SDK

Hi!

 

Ok, I´m done googling  <_<

I got a question about making an app where the clients image of a map is used instead of newmapview.

My client asked for an app where his map was displayed and he could pinch zoom in and out and rotate the map. I found this amazing tutorial that had all the codes I needed: https://coronalabs.com/blog/2013/01/22/implementing-pinch-zoom-rotate/

Now the client wonders IF it is possible to get the current GPS-location on the custom map.

 

I can track the x and y coordinates so it should be possible to translate and calculate them into longitude and latitude and add a pin on the current location...or am I wrong?  :unsure:

 

It could get messy if the user is able to zoom and rotate the map...I´m not sure.

I can´t wrap my head around this right now  :wacko:

 

Thanx!

-Tom

 



[TOPIC: post.html]
#2

nmichaud

[GLOBAL: userInfoPane.html]
nmichaud
  • Contributor

  • 492 posts
  • Corona SDK

Yes its possible and not that complicated, you must make sure that your image is scale properly and know top/left and bottom/right GPS coordinate of your image. If you are trying to show a map with short distance, then you should not worry too much about accuracy.

 

Even if you are zooming, you can take into account the scaling factor when you compute your X and Y position. 



[TOPIC: post.html]
#3

sirmania

[GLOBAL: userInfoPane.html]
sirmania
  • Contributor

  • 154 posts
  • Corona SDK

Good to know and thank you for great tips!

 

The map image is over a "smallish" area of about 20 kilometers by 20 kilometers. The size of the image has to be big to be able to zoom and still se details. The current image is 11000px times 11000px. I will have to make a tiled version of the image for it to work.

I got the client to understand that the ability to rotate the map is not needed. So now there is just the zooming part  :)

 

Thanks again  :D




[topic_controls]
[/topic_controls]