我怎样才能得到缩放级别脱code从谷歌地图API路线的折线? [英] How can I get zoom levels to decode a polyline from Google Maps Directions API?

查看:205
本文介绍了我怎样才能得到缩放级别脱code从谷歌地图API路线的折线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此之后<一个href=\"http://stackoverflow.com/questions/6708408/map-view-draw-directions-using-google-directions-api-decoding-polylines\">polyline从德codeR类 @Kenny

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

我想借鉴的路线<一个href=\"http://maps.googleapis.com/maps/api/directions/xml?origin=41.386998,2.170036&destination=40.417063,-3.701863&mode=driving&units=metric&region=es&sensor=false\"相对=nofollow>巴塞罗那马德里的与谷歌地图API路线:

I'm trying to draw the route from Barcelona to Madrid with Google Maps Directions API:

<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 \\路径\\ overview_polyline \\点折线串;但我无法找到&LT;各级方式&gt; 标签

I manage to read the XML response and get \DirectionsResponse\route\overview_polyline\points polyline string; but I cannot find the <levels> tag.

我想绘制平滑的线(路线),当用户释放,但智能手机的CPU放大时,变焦出来。

我使用错误的API?或者这个类是过时?

Am I using wrong API? Or this class is outdated?

在此先感谢...

推荐答案

缩放级别的折线字符串内econded。在肯尼的类只是给作为第二个参数去codePoints的方法折线字符串的大小。

ZoomLevel is econded inside the polyline "string". In the Kenny's class just give as 2nd parameter to "decodePoints" method the size of the polyline string.

看这个底部的<一个href=\"http://$c$c.google.com/p/bus-stop-alarm/source/browse/trunk/src/com/busstopalarm/Polyline.java?r=181\"相对=nofollow> 1 ,我不知道你会明白更多。

Look at the bottom of this 1 and I wonder you will understand more.

这篇关于我怎样才能得到缩放级别脱code从谷歌地图API路线的折线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆