1

I want to delete a polygon on a layer. It works on my localhost, but not on the production server. In production, after calling removeParcel the source gets clear and the feature on this source also been removed. But the polygon boundary is still visible on the map. And an unexpected side effect occurs on zooming in and out, the polygon boundary is not bound to latitude and longitude, instead it has the same height and width as the map viewport.

removeParcel() {
    const parcelLayer = map.getParcelLayer(true);
    if (parcelLayer) {
        parcelLayer.getSource().clear();
    }
}

This is before delete occur [zoom out1

zoom in

This is after delete occur zoom out

zoom in

Abdul Malik
  • 541
  • 4
  • 16
  • There is no `getParcelLayer` method on the standard OpenLayer map. Which add-on are you using? – Mike Oct 01 '21 at 18:42
  • Yes, getParcelLayer is a custom function. The issue is resolved. Issue caused by the files not getting refreshed from build process, required a hard reset, done by server guy. After which it works as expected. But this is an unexpected behaviour, that I could not generate on jsfiddle. – Abdul Malik Oct 06 '21 at 05:58

0 Answers0