【问题标题】:How can I get zoom levels to decode a polyline from Google Maps Directions API?如何获取缩放级别以从 Google Maps Directions API 解码折线?
【发布时间】:2012-03-28 18:33:49
【问题描述】:

@Kenny关注这个polyline decoder class

int[] decodedZoomLevels = PolylineDecoder.decodeZoomLevels(levels);
GeoPoint[] gPts = PolylineDecoder.decodePoints(points, decodedZoomLevels.length);

我正在尝试使用 Google Maps Directions API 从Barcelona to Madrid 绘制路线:

<DirectionsResponse>
  <status>OK</status>
  <route>
    <leg>
      ...
    </leg>
    <copyrights>Datos de mapa ©2012 Google, Tele Atlas</copyrights>
    <overview_polyline>
      <points>
        cjr{F_u(...)rw@bD~]ln@xo@fnB`M|iAxEvV
      </points>
    </overview_polyline>
  <route>
<DirectionsResponse>

我设法读取 XML 响应并获得 \DirectionsResponse\route\overview_polyline\points 折线字符串;但我找不到&lt;levels&gt; 标签。

我试图在用户放大时绘制更平滑的线(路线),但在缩小时释放智能手机的 CPU。

我是否使用了错误的 API?还是这个类已经过时了?

提前谢谢...

【问题讨论】:

    标签: android google-maps android-mapview polyline


    【解决方案1】:

    ZoomLevel 在折线“字符串”内进行。在 Kenny 的课程中​​,只需将折线字符串的大小作为“decodePoints”方法的第二个参数。

    看看下面这个1,不知你会明白多少。

    【讨论】:

      猜你喜欢
      • 2017-08-21
      • 1970-01-01
      • 1970-01-01
      • 2011-09-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-15
      相关资源
      最近更新 更多