Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps v3: large size for markers

Tags:

google-maps

I need to display markers on my map and it's working well. The only problem is that they appear to be too small. How can I make sure that the markers used are large in size and can be visible from almost any zoom state?

like image 965
Churchill Avatar asked Apr 14 '11 11:04

Churchill


1 Answers

For making the icons bigger I would definitely recommend to make your icon images larger. To for example fix pixely icons on high-dpi mobile device using downscaled hi-res icons use following code:

var marker = new google.maps.Marker({
    position: new google.maps.LatLng(position.coords.latitude, position.coords.longitude),
    map: map,
    icon: {
        url: "img/img.png",
        scaledSize: new google.maps.Size(32, 32) // pixels
    }
});

Tested with Google Maps API JavaScript v3.13

like image 174
Jonas Äppelgran Avatar answered Sep 26 '22 01:09

Jonas Äppelgran