我想用动态标记显示静态地图。 所以我正在使用带有Google Charts API图标的Google Maps Static API。
所有标记图标网址都以正确方式编码(%257C代替“|”等)。
我的代码:
https://maps.googleapis.com/maps/api/staticmap?center=Moscow&zoom=10&size=600x450&maptype=roadmap&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C9%257CFFFFFF|55.7959364,37.7052089&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C14%257CFFFFFF|55.8452904,37.3614846&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C15%257CFFFFFF|55.712056,37.732715&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C16%257CFFFFFF|55.689701,37.574149&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C21%257CFFFFFF|55.6491446,37.7421431&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C33%257CFFFFFF|55.748237,37.816418&markers=icon:|55.7781055,37.5472178
如您所见,有7个标记,但只有5个正确显示。
但是,如果我们只用1个标记分别得到7张地图 - 一切都还可以。 像这样:
https://maps.googleapis.com/maps/api/staticmap?center=Moscow&zoom=10&size=600x450&maptype=roadmap&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C9%257CFFFFFF|55.7959364,37.7052089
或者,如果我们将标记中的动态文本值替换为“012345”等标识符,那么一切都还可以。像这样:
https://maps.googleapis.com/maps/api/staticmap?center=Moscow&zoom=10&size=600x450&maptype=roadmap&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C012345%257CFFFFFF|55.7959364,37.7052089&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C012345%257CFFFFFF|55.8452904,37.3614846&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C012345%257CFFFFFF|55.712056,37.732715&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C012345%257CFFFFFF|55.689701,37.574149&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C012345%257CFFFFFF|55.6491446,37.7421431&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C012345%257CFFFFFF|55.748237,37.816418&markers=icon:http://chart.apis.google.com/chart%3Fchst%3Dd_bubble_text_small%26chld%3DbbT%257C012345%257CFFFFFF|55.7781055,37.5472178
网址最大大小为2048,我的examaple更短。 所以,我不知道如何在一个静态地图中显示我的所有标记。