hichem hamdaoui
hichem hamdaoui

Reputation: 160

custom google map is not rendering correctly, bad resolution

I have set a size for a custom google map icon to use it .

var icon_custom = new google.maps.MarkerImage(
                                                "img/map/po_test.png" ,
                                                null,
                                                null,
                                                null,
                                                new google.maps.Size(50, 50)
                                                );
      marker_points = new google.maps.Marker({
                                            position: new google.maps.LatLng(5.318590,-4.027873),
                                            map: map,
                                            title: " test ",
                                            icon: icon_custom,

                                    });

this size is identical to pixel size of po_test.png which is 50x50 px. I'm having a very bad resolution displayed of those markers. and I don't know the reason of the problem . this is the style of my the div where the google map is rendered

#map_point {
    height: 300px;
    width: 100%;
}

I have added below to this question an example of the icon and the what I have as rendered in the google map . po_test.png example google map render

can you see the differences ? I have changed the size property and resized proportionally . the problem still remain .

Upvotes: 0

Views: 297

Answers (1)

kaho
kaho

Reputation: 4784

I tried to recreate this using your image https://i.sstatic.net/sEqhc.png on jsFiddle....

And tell me what are the difference between the following 2 pictures...

enter image description here

enter image description here

The answer is...
first pic is cap when the browser is in the retina monitor,
second pic is cap when the browser is in a dumb dell monitor.
(same computer, same browser, I just slice it over, and reload.)

clearly there are something going on with all the scaling thing.. and I guess.. it takes more than setting to fix this issue. May be you should report a bug, however, it would takes a long time for the Maps team to fix since it sounds like a very, very low priority bug to them.

Hope this help

Upvotes: 1

Related Questions