地址中断地图显示,为什么? [英] Address breaks map display, why?

查看:77
本文介绍了地址中断地图显示,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我通过像这样通过PHP插入来插入地址来生成Google静态地图:

Currently I am generating a Google static map by inserting an address through PHP insertion like this:

<img src="http://maps.googleapis.com/maps/api/staticmap?center=<?=$gmapadd?>&zoom=14&size=300x200&markers=color:blue|label:A|<?=$gmapadd?>&sensor=false">

现在这是该脚本的示例输出,可以正确显示:

Now here is an example output from this same script that displays properly:

<img src="http://maps.googleapis.com/maps/api/staticmap?center=11555+Central+Parkway+Jacksonville+FL+32224&amp;zoom=14&amp;size=300x200&amp;markers=color:blue|label:A|11555+Central+Parkway+Jacksonville+FL+32224&amp;sensor=false">

但是,这里的输出/地址破坏了API(不报告错误,只是不显示地图),但是我看不到格式问题或为什么它会破坏地图显示.另外,如果我在Google地图5000-18 Hwy 17 #82 Orange Park, FL 32003中输入此地址,它可以识别并正确显示吗?

Here however, the output/address breaks the API (doesn't report an error, it just doesn't show the map), but I don't see the formatting problem or why it would break the map display. Also, if I enter this address into Google maps 5000-18 Hwy 17 #82 Orange Park, FL 32003 it does recognize it and display properly?

<img src="http://maps.googleapis.com/maps/api/staticmap?center=5000-18+Hwy+17+#82+Orange+Park+FL+32003&amp;zoom=14&amp;size=300x200&amp;markers=color:blue|label:A|5000-18+Hwy+17+#82+Orange+Park+FL+32003&amp;sensor=false">

推荐答案

URL中的#"不合法.它需要进行编码:

The "#" is not legal in a URL. It needs to be encoded:

查看全文

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