Skip to content

Commit 8da0457

Browse files
anyanruhhyu1
authored andcommitted
修改demo中清空图层方法
1 parent 8b1efd0 commit 8da0457

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

examples/leaflet/plot_addfile.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ <h5 class='panel-title text-center'>态势图叠加</h5></div>
8282

8383
function clearLayers() {
8484
widgets.alert.clearAlert();
85-
map.getPlottingLayers()[0].removeAllFeatures();
85+
for (var i = 0; i < map.getPlottingLayers().length; i++) {
86+
map.getPlottingLayers()[i].removeAllFeatures();
87+
}
8688
}
8789

8890
</script>

examples/leaflet/plot_dynamicPlot.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#plottingMenu {
2727
position: absolute;
2828
top: 20%;
29-
z-index: 110;
29+
z-index: 888;
3030
border-radius: 4px;
3131
padding-top: 2px;
3232
left: 210px;

examples/leaflet/plot_plotGOAnimation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ <h5 class="panel-title text-center" style=" font-size: 16px;color: #ffffff;">态
388388
cancelDraw();
389389

390390
for (var i = 0; i < map.getPlottingLayers().length; i++) {
391-
map.getPlottingLayers().removeAllFeatures();
391+
map.getPlottingLayers()[i].removeAllFeatures();
392392
}
393393
}
394394
</script>

examples/leaflet/plot_saveload.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ <h5 class='panel-title text-center' style=" font-size: 16px;color: #ffffff;">
197197
function clearLayer() {
198198
cancelDraw();
199199

200-
for(var i = 0; i < map.getPlottingLayers().length; i++){
201-
map.getPlottingLayers().removeAllFeatures();
200+
for (var i = 0; i < map.getPlottingLayers().length; i++) {
201+
map.getPlottingLayers()[i].removeAllFeatures();
202202
}
203203
}
204204
window.onload = function(){

0 commit comments

Comments
 (0)