地址中断地图显示,为什么? [英] Address breaks map display, why?
问题描述
当前,我通过像这样通过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&zoom=14&size=300x200&markers=color:blue|label:A|11555+Central+Parkway+Jacksonville+FL+32224&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&zoom=14&size=300x200&markers=color:blue|label:A|5000-18+Hwy+17+#82+Orange+Park+FL+32003&sensor=false">
推荐答案
URL中的#"不合法.它需要进行编码:
The "#" is not legal in a URL. It needs to be encoded: