Skip to content

Commit

Permalink
fix(leaflet): add undefined check
Browse files Browse the repository at this point in the history
check if marker was found
  • Loading branch information
mpfeil committed Jun 4, 2018
1 parent 423194e commit 7b4e6ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/components/leaflet.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@
break;
}
}
mapLayers['markerCluster'].removeLayer(marker);
mapLayers['selectedBoxMarker'].addLayer(marker);
if (marker) {
mapLayers['markerCluster'].removeLayer(marker);
mapLayers['selectedBoxMarker'].addLayer(marker);
}
});

scope.$on('boxDeselected', function (event, box) {
Expand Down

0 comments on commit 7b4e6ac

Please sign in to comment.