miguelcobain / ember-leaflet

:fire: :leaves: Easy and declarative mapping for ember

Home Page:https://miguelcobain.github.io/ember-leaflet/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GeoJson Custom Marker not always cleaned up

knownasilya opened this issue · comments

Example code:

 <layers.geoJSON
          @geoJSON={{depotFeature}}
          @pointToLayer={{this.createDepotMarker}}
          @onClick={{this.removeDepot}}
        />
@action
  createDepotMarker(_feature: Feature, latlng: LatLng) {
    return new Marker(latlng, {
      zIndexOffset: 1000,
      icon: new Icon({
        iconUrl: '/assets/images/depot-icon.png',
        iconRetinaUrl: '/assets/images/depot-icon-2x.png',
        shadowUrl: '/assets/images/marker-shadow.png',
        iconSize: [25, 41],
        iconAnchor: [12, 41],
        popupAnchor: [1, -34],
        tooltipAnchor: [16, -28],
        shadowSize: [41, 41],
      }),
    });
  }

Steps to reproduce:

  1. Render markers as geojson (features)
  2. Remove existing marker
  3. Add back previously removed marker
  4. Remove again, this time it will not remove form the UI