【发布时间】:2014-11-24 04:10:18
【问题描述】:
我想将点转换为经度和纬度,如下代码所示:
mMapView.setOnSingleTapListener(new OnSingleTapListener() {
@Override
public void onSingleTap(float x, float y) {
callout.hide();
int[] graphicIDs = graphicsLayer.getGraphicIDs(x, y, 25);
if (graphicIDs != null && graphicIDs.length > 0) {
Graphic gr = graphicsLayer.getGraphic(graphicIDs[0]);
updateContent((String) gr.getAttributeValue("Rating"),
(String) gr.getAttributeValue("Title"));
Point location = (Point) gr.getGeometry();
callout.setOffset(0, -15);
callout.show(location, content);
}
}
我有这个变量location如何找出经度和纬度,我已经将经度和纬度更改为如下所示:
double mercatorX = longtitude* 0.017453292519943295 * 6378137.0;
double a = latitude * 0.017453292519943295;
double mercatorY = 3189068.5 * Math.log((1.0 + Math.sin(a))
/ (1.0 - Math.sin(a)));
我需要你的评论...
【问题讨论】:
-
然后做相反的事情。当你是一名程序员时,数学并不难;)
-
我的脑子现在不行了 ;) ,如果可以的话,请帮帮我吧?