Drawings not visible after removeLayer method : leaflet

المشرف العام

Administrator
طاقم الإدارة
Introduction

As i am working on application which uses leaflet api. Live HereWhere first user enter '1' as input to load the image on map.

Then user can draw different shapes(fences) using bottom-left buttons.The 'eraser' button is suppose to remove all layers from map regarding CurrentFeatureGroup.

Problem

When we click on 'eraser' button, all shapes will be removed from map having currentfeaturegroup.But after removing when we draw some other shapes, these shapes are invisible, although i have checked the function working properly.I don't have idea how these shapes are now invisible.

Script(which responsible to remove layers)

L.easyButton('
', function () { map.removeLayer(currentFeatureGroup); $('.leaflet-container').css('cursor', ''); }).addTo(map);
Please consider removeLayer, not clearLayer.If someone have any idea about this problem please do help.Any kind of help or reference will be appreciated, thanks for your time


أكثر...
 
أعلى