Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use high resolution custom markers with the scale parameter in Google's Static Maps API?

Tags:

We're using Google's Static Maps API with the scale parameter to display lovely smooth maps for people using high resolution displays. However, we'd also like to use custom icons to show points on the map.

Unfortunately I can't find any way of doing this that doesn't give pixelated icons like in this example. Is there a way of doing this that doesn't scale the icons up?

like image 813
alnorth29 Avatar asked Apr 26 '12 15:04

alnorth29


People also ask

Is the largest image size allowed in Static maps API?

Static Maps images can be returned in any size up to 640 x 640 pixels.

What is the maximum number of markers or path vertices supported by the Google Static maps API?

There is no limit to the number of markers or path vertices supported by the Google Static Maps API.


1 Answers

The &markers parameter now has an (undocumented) scale descriptor. Set that to 2 and the icon descriptor to your @2x marker image URL while using the &scale=2 parameter. Something like:

&markers=scale:2|[email protected]&scale=2

Source: https://groups.google.com/d/msg/google-maps-api/_METlecmeO4/JNyfkguoO7QJ

like image 188
Hakan B. Avatar answered Sep 21 '22 08:09

Hakan B.