2

I am downloading and place the OSM tile image in my map application. I am downloading the OSM tiles based on the device center points (latitude and longitude) value and positioning accordingly. It is working fine.

When i am pinching in mobile, I got the delta value between the two fingers, center point in (pixel and latitude,longitude) and Scale value as you see in the screenshot. To download the image while pinching and zooming, i need to calculate the center point from the Pinching values. I couldn't find the logic for find the center Point (latitude, longitude). The red color value in the image denotes latitude and longitude value.

enter image description here

Anyone pleases give idea.

Thanks, Bharathi.

Bharathi
  • 1,288
  • 2
  • 14
  • 40
  • If you have the lat/lng of both finger points and treat those as the upper-left and lower-right of a rectangle, then why isn't is just the midpoints of the lat/lng - with a special case for 0 lng. –  Mar 23 '18 at 12:09

1 Answers1

0

You can also calculate the tile number based on lon/lat, then convert the tile number back to lon/lat. This will tell you the top left coordinate of the tile.

scai
  • 20,297
  • 4
  • 56
  • 72