Search code examples
google-mapshttprequestgoogle-maps-static-api

Custom Marker Icon not showing Google Static Maps v2


I am using the Static Google Maps API v2 to download a static image of a map view with a singular marker just showing one image. However, the image added to the marker parameter of the url doesn't seem to be making any difference, and just a red marker is shown at the location.

Please can you tell me where I am going wrong?

http://maps.googleapis.com/maps/api/staticmap
?center=37.446754,-77.572746
&size=70x61
&maptype=roadmap
&sensor=true
&scale=2
&zoom=15
&key=some_key
&markers=icon:https://foursquare.com/img/categories_v2/shops/financial_bg_64.png|37.446754,-77.572746

Solution

  • your image URL must remove the letter S HTTPS secure site, so work, for example like this:

    http://foursquare.com/img/categories_v2/shops/financial_bg_64.png
    

    complete code:

    http://maps.googleapis.com/maps/api/staticmap?
    center=37.446754,-77.572746&size=70x61&maptype=roadmap&sensor=false
    &scale=2&zoom=15
    &markers=icon:http://foursquare.com/img/categories_v2/shops/financial_bg_64.png|37.446754,-77.572746