I use leaflet with the Angular package ngx-leaflet and just trying to get my layer for ImageOverlays in my LayersControl, so I can show or hide this layer in the map based on a checkbox. Somehow it does not work as described in the documentation.
Can someone help me with this?
..here is my html template:
<div leaflet
[leafletOptions]="options"
[leafletLayersControl]="layersControl"
[leafletMarkerCluster]="_markerCluster"
">
</div
..and here is the component:
...
this.overlay = L.imageOverlay(props.ref, props.bounds, this.options);
map.addLayer(this.overlay);
layersControl = {
baseLayers: {
'Open Street Map': this.openStreetMap,
},
overlays: {
'GeoJSONs': this.featureGroup,
'Image Overlay': this.overlay
}
};
...