Skip to content

Commit 9c5c3f7

Browse files
committed
优化leaflet例子,避免重复加载
1 parent 6fd5288 commit 9c5c3f7

8 files changed

+8
-8
lines changed

examples/leaflet/04_bufferAnalystService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
maxZoom: 18,
2222
zoom: 6
2323
});
24-
L.supermap.tiledMapLayer(baseUrl, {noWrap: true}).addTo(map).on("load", function () {
24+
L.supermap.tiledMapLayer(baseUrl, {noWrap: true}).addTo(map).once("load", function () {
2525
bufferAnalystProcess();
2626
});
2727

examples/leaflet/04_surfaceAnalystService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
maxZoom: 18,
2222
zoom: 2
2323
});
24-
L.supermap.tiledMapLayer(baseUrl, {noWrap: true}).addTo(map).on("load", function () {
24+
L.supermap.tiledMapLayer(baseUrl, {noWrap: true}).addTo(map).once("load", function () {
2525
surfaceAnalystProcess();
2626
});
2727

examples/leaflet/04_terrainCurvatureCalculationService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
maxZoom: 18,
2020
zoom: 6
2121
});
22-
L.supermap.tiledMapLayer(baseUrl, {noWrap: true}).addTo(map).on("load", function () {
22+
L.supermap.tiledMapLayer(baseUrl, {noWrap: true}).addTo(map).once("load", function () {
2323
terrainCurvatureCalculationProcess();
2424
});
2525

examples/leaflet/04_thiessenAnalystService_geometry.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
});
2424
L.supermap.tiledMapLayer(baseUrl, {noWrap: true})
2525
.addTo(map)
26-
.on("load", function () {
26+
.once("load", function () {
2727
thiessenAnalystProcess();
2828
});
2929

examples/leaflet/05_findLocationService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
});
2424
L.supermap.tiledMapLayer(baseUrl, {noWrap: true})
2525
.addTo(map)
26-
.on("load", function () {
26+
.once("load", function () {
2727
findLocationProcess();
2828
});
2929

examples/leaflet/05_findMTSPPathsService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
});
2424
L.supermap.tiledMapLayer(baseUrl, {noWrap: true})
2525
.addTo(map)
26-
.on("load", function () {
26+
.once("load", function () {
2727
findMTSPPathsProcess();
2828
});
2929

examples/leaflet/05_findPathService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
});
2525
L.supermap.tiledMapLayer(baseUrl, {noWrap: true})
2626
.addTo(map)
27-
.on("load", function () {
27+
.once("load", function () {
2828
findPathProcess();
2929
});
3030

examples/leaflet/05_findTSPPathsService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
});
2424
L.supermap.tiledMapLayer(baseUrl, {noWrap: true})
2525
.addTo(map)
26-
.on("load", function () {
26+
.once("load", function () {
2727
findTSPPathsProcess();
2828
});
2929

0 commit comments

Comments
 (0)