开发者

Google Maps Static, can't insert custom icon

Im using google maps static. I want to have a custom icon in the center of the map.

This is how my request looks like:

http://maps.googleapis.com/maps/api/staticmap?center=43.7000931135661900,7.2607183456420900&scale=2&size=300x200&sensor=false&maptype=roadmap&zoom=15&markers=icon:http://i.imgur.com/DOXAD.png

The image is fine, but开发者_如何学JAVA no custom icon is displayed. Not even if I encode the url of the icon as such: http%3A2F%2Fi.imgur.com%2FDOXAD.png|shadow:false

Any ideas? Thanks in advance


http://maps.googleapis.com/maps/api/staticmap?center=43.7000931135661900,7.2607183456420900&scale=2&size=300x200&sensor=false&maptype=roadmap&zoom=15&markers=icon:http://i.imgur.com/DOXAD.png|43.7000931135661900,7.2607183456420900

If you read the google blog and check how the image is done there, you can see, that each marker should have its center point and icon, which should be divided by | In your case center point of map and center point of marker are the same, so you should copy LAT and LNG.


Please remember to center your marker by providing LAN & LNG information with |.

Here is the sample.

https://maps.googleapis.com/maps/api/staticmap?center=43.7000931135661900,7.2607183456420900&scale=2&size=300x200&sensor=false&maptype=roadmap&zoom=15&markers=icon:http://i.imgur.com/DOXAD.png|43.7000931135661900,7.2607183456420900

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜