vue-leaflet/Vue2Leaflet

LIcon with null size within LMarker slot fails to nullify default size

mryellow opened this issue · 14 comments

When providing an icon without a size within the default slot the icon property defaults to new Icon.Default() which has an iconSize of [12,12].

Steps to Reproduce

  <l-marker :lat-lng = "[-10, 10]">
    <l-icon :icon-size="null" :class-name="`leaflet-marker-icon`">
      <div :style="`width: 50px; height: 50px; background-color: #03f;`">Icon</div>
    </l-icon>
  </l-marker>

Expected Results

No forced sizing on marker.

Actual Results

The internal div will have the correct size, however...

Using DOM inspection tools, observe .leaflet-marker-icon wrapping this to have a size of 12x12

Browsers Affected

  • Chrome
  • Firefox
  • Edge
  • Safari 9
  • Safari 8
  • IE 11

Versions

  • Leaflet: v1.7.1
  • Vue: v2.6.14
  • Vue2Leaflet: v2.7.1
stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Bump. I'll cycle back someday.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

It's not stale until it's fixed and long since forgotten.

mikeu commented

Hi @mryellow , thank you for reporting this issue, and sorry for the lengthy delay in getting to it. Unfortunately, I don't think this is the right place to be trying to get it fixed. The behaviour you describe appears to be that of Leaflet itself.

Here are two identical maps, one made with Vue2Leaflet and the other with vanilla Leaflet.

As you can see, the rendered maps and map elements appear functionally identical, down to the 12x12 .leaflet-marker-icon div wrapping the larger div icon.

You're probably right. I remember it being buried deep and very interconnected.

Looking back seems the null gets passed all the way through, yes resulting in a default icon but also ending up with an iconSize which is falsy all the way to Leaflet itself.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Please go away stalebot.

Hang-ong wontfix on a "stale" issue, entirely inappropriate.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@Stale Please just go away.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Someone may wish to know about it stalebot.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

I still hate you stalebot.

undefined !== null