Show current location of user on an offline static image (jpeg) - Android

南笙酒味 提交于 2019-12-04 21:51:48

Lets say that user position is uLat and uLon, and the map have top left corner tlLat and tlLon, and bottom right corner brLat and brLon. Finally, map size is x and y pixels.

userX = x*(uLon-tlLon)/(brLon-tlLon);
userY = y-y*(uLat-brLat)/(tlLat-brLat);

This is an aproximation that only works for small distances (1 km should be fine) as it's not taking into consideration the earth curvature.

I'm not sure that's legal to use google map screenshot without authorization.

good luck.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!