【问题标题】:How to center Google maps driving directions between destination and source如何在目的地和来源之间将谷歌地图的行车路线居中
【发布时间】:2013-04-13 16:55:34
【问题描述】:

我正在使用 google maps URL 命令绘制从源到目的地的行车路线,使用以下命令:

    String geoUriString = "http://maps.google.com/maps?" + 
           "saddr=" + latitude + "," +  longitude + "&daddr=" + destLAT+ "," + destLONG;

然后

Intent mapCall = new Intent(Intent.ACTION_VIEW, Uri.parse(geoUriString));
startActivity(mapCall);

这会打开一个选项列表,当我选择谷歌地图时,它会显示从源头到目的地的行车路线。

我有这个问题:

  • 如何缩小地图以适应从源到目的地的绘制路径? (因为现在放大太多,所以没有一次显示完整路径)

【问题讨论】:

  • 您使用的是哪个 Google Maps API? V1 或 V2(带有 Google Play 服务)

标签: android google-maps android-activity driving-directions


【解决方案1】:
var mapOptions = {
        zoom: 4,
        center: new google.maps.LatLng(18.49866955, 73.8957357166667),
        mapTypeId: google.maps.MapTypeId.ROADMAP
      };
      var map = new google.maps.Map(document.getElementById('map_canvas'),
          mapOptions);

【讨论】:

    猜你喜欢
    • 2015-03-29
    • 2012-05-17
    • 2015-07-04
    • 1970-01-01
    • 1970-01-01
    • 2015-04-18
    • 1970-01-01
    • 1970-01-01
    • 2011-04-23
    相关资源
    最近更新 更多