(不使用投影库) 我知道我的地图的中心点(-37.500,175.500).zoom(13)大小。 400x400px,这是一个mercator投影(标准谷歌地图)。 它用作画布400x400px上的背景图像。 如何解决此地图的边界问题。覆盖lat/lng GPS静态谷歌地图上的坐标使用数学(mercator)
0
A
回答
0
假定您使用中心坐标订购一个地图,
变焦= 13 //谷歌地图缩放级别(1-18etc)
屏幕宽度= 400(像素)//地图的宽度
Latctr = -37.450 //地图的中间
Longctr = 170.250 //经度地图的中间
1/Lengthlat在1度纬度
2/Lengthlong = COS lengthlat * 111111 //长度的米= 111111 //长度的纬度1度经度
3/Ratiolengths == lengthlat/lengthlong
4/LongitudeValueAdjust =((lengthlat /(2^zoom)/(screenwidth * 2)* RatioLengths
5/LatitudeValueAdjust =(lengthlat /(2^zoom)/(screenwidth * 2)
6/Northwestlat = latctr + latitudeValueAdjust
7/Northwestlong = longctr -longValueAdjust
8/Southeastlat = latctr - LatValueAdjust
9/Southeastlong = longctr + longValueAdjust
现在你知道地图的角落的坐标
Plotting lat lng to canvas/screen x,y
//This is not a mercator projection, works fine for zooms > 9
Assumes 0,0 is the top left hand corner of the canvas
lattodraw // Latitude value of the coordinate we wish to convert
longtodraw // Longitude value of the coordinate we wish to convert
1/Latplot = canavsheight /(southeastlat-northwestlat) * lattodraw-northwestlat
2/Longplot = canvaswidth /(southeastlong-northwestlong) * longtodraw-northwestlong
3/Draw pixel at latplot,longplot
相关问题
- 1. 谷歌地图上的GPS坐标
- 2. 使用JavaScript在谷歌地图上的GPS坐标
- 3. Android谷歌地图坐标
- 4. 谷歌地图坐标圈
- 5. 谷歌地图上的GPS标记android
- 6. 使用谷歌地图使用坐标
- 7. 谷歌地图与覆盖
- 8. 谷歌地图覆盖
- 9. 谷歌地图覆盖
- 10. 谷歌地图覆盖层
- 11. 如何在静态谷歌地图中覆盖两次旅行?
- 12. 谷歌静态地图没有使用谷歌地图API
- 13. 谷歌分析地图覆盖数据
- 14. Android:谷歌地图坐标
- 15. Android谷歌地图坐标
- 16. 通过短信获取GPS坐标并在谷歌地图上显示
- 17. Android:谷歌地图停用覆盖
- 18. 谷歌地图JavaScript API v3的GPS坐标为中心
- 19. 在谷歌地图中使用gps移动标记android
- 20. 我如何获得谷歌地图上的多个坐标静态API?
- 21. 谷歌地图LatLng不是数字
- 22. 谷歌地图:更新图片覆盖
- 23. 谷歌地图透明图像覆盖
- 24. 预加载谷歌地图覆盖图
- 25. 谷歌地图视图教程 - 覆盖
- 26. 谷歌地图简单图案覆盖
- 27. 如何覆盖谷歌地图的onresume
- 28. 可缩放的谷歌地图覆盖
- 29. 谷歌地图的天气覆盖
- 30. android - eclipse:显示谷歌地图使用坐标获得使用gps