I can't find a way to target the custom marker image with CSS to make it display smaller than it is (i.e. 2x, for high pixel density displays).

Is it possible without patching the module?

Thank you

Comments

kopeboy created an issue. See original summary.

a.dmitriiev’s picture

I think we should try to use this option with scaledSize for Icon :
https://developers.google.com/maps/documentation/javascript/examples/ico...

abaier’s picture

I would also be interested in placing an additional image for retina displays. Are there already plans on integrating this feature?

una_maria’s picture

Also interested, it would be very nice to have an option to set a scaledSize value via UI.
Meanwhile, something similar to this works:

var icon = {
   url: map_locations[0].pin,
   scaledSize: new google.maps.Size(42, 64)
}
for (j in map_locations) {
  var marker = new google.maps.Marker({
       position: new google.maps.LatLng(map_locations[j].lat , map_locations[j].lon),
       map: map,
       html: map_locations[j].popup,
       icon: icon,
       original_icon: map_locations[j].pin,
       active_icon: map_locations[j].pin,
       category: map_locations[j].category
  });
  // more code
iampuma’s picture

Assigned: Unassigned » iampuma
Category: Support request » Feature request

Changed to feature request.

iampuma’s picture

Title: How to resize marker icon for retina displays » Support retina icon marker with scaledSize property
Version: 7.x-1.0 » 8.x-2.x-dev

Adjusted title and changed to a feature request on 8.x, as 7.x will just be maintenance only from now on.

I suggest the default implementation to support the scaledSize and Size property automatically to be 2x.
As we would need it to be compatible with a map consisting of multiple pins (with different markers). Allowing different sizes would complex the UX, so in case this would be really necessary later on request. We can think of a more advanced implementation.

iampuma’s picture

Assigned: iampuma » a.dmitriiev

  • a.dmitriiev committed a47a507 on 8.x-2.x
    Issue #2682095: Support retina icon marker with scaledSize property
    
a.dmitriiev’s picture

Added to the latest dev release for field formatter and view style.

a.dmitriiev’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.