User Orux map db with Google map api for android

Started by cojalvo, December 17, 2016, 08:40:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cojalvo

Hi, Everyone.



I'm trying to use an Orux map database (sqlite) on google map api for android using Tile Overlay.

But somehow i'm having problem with calibrating the map.

The way i'm try to calibrating the map is by  map every layer in the map (zoom) to the top left corner by reading that info  from the otrk2.xml file.

After reading that data for every layer i'm calculating the offset of the tile by converting the coordinate (lat, long) to the tile x,y.

And than use the tile offset to fetch the correct tile from the database.

 for example:

Layer 7 (zoom 7) the TL corner start from x=150,y=150

when the google map api ask from the tile provider to bring the the tile of y=160,x=160,z=7

Im selecting from the database the tiles:



x= 160-150, y=160-150.

and than the query will be:



select image from tiles where x=10,y=10z=7

But somehow the calibration is not correct.

The tiles are not locate on the map correctly.



What am i doing wrong, can anyone assist?



Thanks