开发者

Google static maps - Weird/contrasting behavior on BlackBerry simulator and PC Browser

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.

T开发者_如何学运维he 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{@leAhsAKpUhu@ps@bMzDdXheAzZzXd\|k@~ZnUdYzb@jmA|s@~UrYxe@lRj~@px@|qAzf@fb@d_@c@~QfrAjThBvhAtMc@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\dYngAFnAtOhp@|^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~uAC`_@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

http://maps.googleapis.com/maps/api/staticmap...


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.


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?

Google static maps - Weird/contrasting behavior on BlackBerry simulator and PC Browser

Or maybe you just pass wrong URL parameters in Blackberry, because you haven't escaped some character (like quote or backslash...)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜