【问题标题】:Find Location on Google Maps using coordinates使用坐标在谷歌地图上查找位置
【发布时间】:2012-10-18 12:05:00
【问题描述】:

我想根据经纬度坐标在地图上显示一个位置。当我按下一个按钮时,我想将坐标发送到谷歌地图(或其他应用程序)并精确定位该位置。关于如何实现这一目标的任何想法?

【问题讨论】:

  • 查找位置是什么意思?你想动画到某个位置?
  • 在谷歌地图中搜索“32.297581,-64.775734”
  • 想知道位置名称或在该位置显示标记??
  • 这是一个好的开始:stackoverflow.com/a/8428414/469983

标签: android google-maps


【解决方案1】:
【解决方案2】:

如果您想为谷歌地图上的特定点设置动画,您需要定义一个 MapView。然后创建一个 MapController 并动画到一个特定的 GeoPoint:

MapController mapController = mapView.getController();

double lat = latitude * 1e6;
double lon = longitude * 1e6;

GeoPoint startpoint = new GeoPoint((int) lat, (int) lon);
mapController.animateTo(startpoint);

试试这个教程:MapView Tutorial

【讨论】:

    【解决方案3】:

    我找到了一个简单的解决方案。我通过意图启动谷歌地图应用程序

    Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
                            Uri.parse("http://maps.google.com/maps?q=" + serviceActivity.Latitude.toString() + "," + serviceActivity.Longitude.toString()));
                            startActivity(intent);
    

    【讨论】:

      猜你喜欢
      • 2013-11-21
      • 1970-01-01
      • 1970-01-01
      • 2015-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多