Google 静态地图 - BlackBerry 模拟器和 PC 浏览器上的奇怪/对比行为
我遇到了一个奇怪的问题。我试图通过在应用程序中执行一个简单的 URL 来下载 Google 静态地图图像,但该图像似乎与我在 PC 浏览器上看到的图像非常不同。
问题是我试图使用概览折线点(使用 Google Maps Direction Api 获得)显示 2 个纬度/经度点之间的行车方向。正如预期的那样,overview_polyline点很大并且包含很多特殊字符..就像下面的
overview_polyline:{ 级别: “B@@@@@@@@@@@@@@@@@A@@@@@@@@A@@@@@@@@A@@@@A@@@A@@@ @@@@@@@@@@一个@@@@@@@@ @@@@@@A@@A@@@@@@@@@@@@@@@@@@A@@@@@@@@@@@@@@A@@A@@@ @@@A@@@@@@A@@@@@@@B" 点: "sfdnAunkxMAk[yKiKdbAhn@pPzZbMns@tr@tjAvKbb@ru@zq@rMl{@leAhsA
KpUhu@ps@bMzDdXheAzZzXd \|k@~ZnUdYzb@jmA|s@~UrYxe@lRj~@px@|qAzf@fb@d_@c@~QfrAjTh
BvhAtMc@nSdWpC~[|k@tp @j r@dd@bd@deAjV~SvKffBtI~[~u@zt@tMn^heAfh@h[fj@~XzVpWjnAxSlTeIro@tEvNzP|JvTgDbl@zBdfAdyAbe@baApg@hc @fJr]tb@vf@fPdElQ|Ulc@
YzLpUvtApq@f_@xGHnZwHpb@|Qde@tIdj@gAv\dYngAFn
AtOhp@|^jlD vf@pdAhKns@dv@|tApHn@xVj
@vBfxCnLpPlBjGtlA
}Ala@||Afo@nfB|Epi@faCftFtHlXtu@ byA|p@bz@
Z|n@xu@p_@xNnRfo@vc@bSzZhJjc@w@|m@ru@{@jCda@jInSpmApk@s@dp@{Hpl@pDnRhn@nO ~你A
C`_@zJ|hAoBpd@~L|WzRxeARmDva@hKxPv@lVj]pCvA~Cvg@~@z@nHxa@yAboAxKnUyFjh@w]nk@uMfXlErRuCuse" 在 BlackBerry 上使用它会出现问题吗?
使用 httpconnection 执行时是否有任何副作用。我怀疑用户代理问题,但不确定..
这是我尝试下载的网址 - 从纽约到新泽西的方向
I am stuck with a weird problem. I am trying to download a Google Static maps image by executing a simple URL in my application, but the image seems to be very different from what i see on my PC browser.
The catch is that I am trying to display the driving directions between 2 lat/long points using overview polyline points (obtained using Google Maps Direction Api). As expected the overview_polyline points are large and contain a lot of special characters..like below
overview_polyline: {
levels: "B@@@@@@@@@@@@@@@@@A@@@@@@@@A@@@@@@@@A@@@@A@@@A@@@@@@@@@@@@@A@@@@@@@@@@@@@@A@@A@@@@@@@@@@@@@@@@@@A@@@@@@@@@@@@@@A@@A@@@@@@A@@@@@@A@@@@@@@B"
points: "sfdnAunkxMAk[yKiKdbAhn@pPzZbMns@tr@tjAvKbb@ru@zq@rMl{@leAhsA
KpUhu@ps@bMzDdXheAzZzXd\|k@~ZnUdYzb@jmA|s@~UrYxe@lRj~@px@|qAzf@fb@d_@c@~QfrAjTh
BvhAtMc@nSdWpC~[|k@tp@jr@dd@bd@deAjV~SvKffBtI~[~u@zt@tMn^heAfh@h[fj@~XzVpWjnAxSlTeIro@tEvNzP|JvTgDbl@zBdfAdyAbe@baApg@hc@fJr]tb@vf@fPdElQ|Ulc@
YzLpUvtApq@f_@xGHnZwHpb@|Qde@tIdj@gAv\dYngAFn
AtOhp@|^jlDvf@pdAhKns@dv@|tApHn@xVj
@vBfxCnLpPlBjGtlA
}Ala@||Afo@nfB|Epi@faCftFtHl@q@vg@_In^jJ``BpHlUf_ApcA|c@dz@bKbfDjjAfkCv
@dzA~x@lrBpCx\jJlVpNhuBhHhYtQzc@|[Xtu@byA|p@bz@
Z|n@xu@p_@xNnRfo@vc@bSzZhJjc@w@|m@ru@{@jCda@jInSpmApk@s@dp@{Hpl@pDnRhn@nO~uA
C`_@zJ|hAoBpd@~L|WzRxeARmDva@hKxPv@lVj]pCvA~Cvg@~@z@nHxa@yAboAxKnUyFjh@w]nk@uMfXlErRuCUsE"
}
Will it be a problem to use this on BlackBerry, does it have any side-effect when excuted using httpconnection. I am suspecting a User-Agent issue, but not sure..
Here's the url i am trying to download - Direction from New York to New Jersey
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不认为这是黑莓的事情。我遇到了同样的问题,实际上是因为折线很可能有一些字符需要在创建 url 之前转义。您可以在 ruby 中使用
URI.escape(string)
来完成此操作,或者仅通过 google 查找您喜欢的实用程序。我看到上面的 Scott W. 已经发布了这个,所以我投票了,但也许你正在等待它作为答案弹出。I don't think this is a blackberry thing. I was having the same issue and it actually was because the polyline most likely has some characters that need to be escaped before creating a url. You can do it in ruby with
URI.escape(string)
or just google for a utility that you prefer to do it for you. I see that Scott W. above already posted this so I voted it up, but maybe you are waiting for it to pop up as an answer.我在 Google 地图和图表(均为静态图像)< a href="http://preferans.de/top20.php" rel="nofollow noreferrer">我的网站,在使用 BB 手机浏览时,我经常会看到显示的静态图像,结束后同一 IP 地址发出了 1000 个请求(可能是因为许多 BB 用户具有相同的公共 IP 地址)。也许你也有类似的问题?
或者您可能只是在 Blackberry 中传递了错误的 URL 参数,因为您没有转义某些字符(例如引号)或反斜杠...)
I use Google maps and charts (both static images) on my website and while browsing it with a BB phone I often see a static image which is shown, when over 1000 requests have been made from the same IP address (probably because many BB users have the same public IP address). Maybe you have a similar problem?
Or maybe you just pass wrong URL parameters in Blackberry, because you haven't escaped some character (like quote or backslash...)