Skip to content

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

@mryellow

Description

@mryellow

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions