Skip to content

Commit

Permalink
fix 优化创建临时图层html
Browse files Browse the repository at this point in the history
  • Loading branch information
xilanhuaweidapao committed Nov 20, 2024
1 parent 7ab3917 commit 42e53da
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 84 deletions.
40 changes: 20 additions & 20 deletions examples/leaflet/createTempLayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<meta charset="UTF-8" />
<title data-i18n="resources.title_createTempLayer"></title>
<script type="text/javascript" include="bootstrap" src="../js/include-web.js"></script>
<style>
#toolbar {
position: absolute;
top: 50px;
right: 10px;
width: 300px;
text-align: center;
z-index: 500;
border-radius: 4px;
}
</style>
</head>
<style>
#toolbar {
position: absolute;
top: 50px;
right: 10px;
width: 300px;
text-align: center;
z-index: 500;
border-radius: 4px;
}
</style>
<body style="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0">
<div id="toolbar" class="panel panel-primary">
<div class="panel-heading">
Expand All @@ -31,7 +31,7 @@ <h5 class="panel-title text-center" data-i18n="resources.title_createTempLayer">
<div class="panel">
<div class="input-group">
<span class="input-group-addon" data-i18n="resources.text_gamma"></span>
<input id="gammaParam" value="1" class="form-control"></input>
<input id="gammaParam" value="1" class="form-control" />
</div>
</div>
<input
Expand Down Expand Up @@ -93,14 +93,14 @@ <h5 class="panel-title text-center" data-i18n="resources.title_createTempLayer">
var layer = result.subLayers.layers[0];
layer.gamma = document.getElementById("gammaParam").value || 1;
layerInfoService.setLayersInfo(
new L.supermap.SetLayersInfoParameters({
layersInfo: result,
resourceID: newResourceID,
isTempLayers: true
})
).then((res) => {
tempLayer.updateParams();
});
new L.supermap.SetLayersInfoParameters({
layersInfo: result,
resourceID: newResourceID,
isTempLayers: true
})
).then((res) => {
tempLayer.updateParams();
});
}
</script>
</body>
Expand Down
44 changes: 22 additions & 22 deletions examples/mapboxgl/createTempLayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<meta charset="UTF-8" />
<title data-i18n="resources.title_createTempLayer"></title>
<script type="text/javascript" include="bootstrap" src="../js/include-web.js"></script>
<style>
#toolbar {
position: absolute;
top: 50px;
right: 10px;
width: 300px;
text-align: center;
z-index: 500;
border-radius: 4px;
}
</style>
</head>
<style>
#toolbar {
position: absolute;
top: 50px;
right: 10px;
width: 300px;
text-align: center;
z-index: 500;
border-radius: 4px;
}
</style>
<body style="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0">
<div id="toolbar" class="panel panel-primary">
<div class="panel-heading">
Expand All @@ -31,7 +31,7 @@ <h5 class="panel-title text-center" data-i18n="resources.title_createTempLayer">
<div class="panel">
<div class="input-group">
<span class="input-group-addon" data-i18n="resources.text_gamma"></span>
<input id="gammaParam" value="1" class="form-control"></input>
<input id="gammaParam" value="1" class="form-control" />
</div>
</div>
<input
Expand Down Expand Up @@ -106,16 +106,16 @@ <h5 class="panel-title text-center" data-i18n="resources.title_createTempLayer">
var layer = result.subLayers.layers[0];
layer.gamma = document.getElementById("gammaParam").value || 1;
layerInfoService.setLayersInfo(
new mapboxgl.supermap.SetLayersInfoParameters({
layersInfo: result,
resourceID: newResourceID,
isTempLayers: true
})
).then((res) => {
map.style.sourceCaches['layer'].clearTiles();
map.style.sourceCaches['layer'].update(map.transform);
map.triggerRepaint();
});
new mapboxgl.supermap.SetLayersInfoParameters({
layersInfo: result,
resourceID: newResourceID,
isTempLayers: true
})
).then((res) => {
map.style.sourceCaches['layer'].clearTiles();
map.style.sourceCaches['layer'].update(map.transform);
map.triggerRepaint();
});
}
</script>
</body>
Expand Down
44 changes: 22 additions & 22 deletions examples/maplibregl/createTempLayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<meta charset="UTF-8" />
<title data-i18n="resources.title_createTempLayer"></title>
<script type="text/javascript" include="bootstrap" src="../js/include-web.js"></script>
<style>
#toolbar {
position: absolute;
top: 50px;
right: 10px;
width: 300px;
text-align: center;
z-index: 500;
border-radius: 4px;
}
</style>
</head>
<style>
#toolbar {
position: absolute;
top: 50px;
right: 10px;
width: 300px;
text-align: center;
z-index: 500;
border-radius: 4px;
}
</style>
<body style="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0">
<div id="toolbar" class="panel panel-primary">
<div class="panel-heading">
Expand All @@ -31,7 +31,7 @@ <h5 class="panel-title text-center" data-i18n="resources.title_createTempLayer">
<div class="panel">
<div class="input-group">
<span class="input-group-addon" data-i18n="resources.text_gamma"></span>
<input id="gammaParam" value="1" class="form-control"></input>
<input id="gammaParam" value="1" class="form-control" />
</div>
</div>
<input
Expand Down Expand Up @@ -105,16 +105,16 @@ <h5 class="panel-title text-center" data-i18n="resources.title_createTempLayer">
var layer = result.subLayers.layers[0];
layer.gamma = document.getElementById("gammaParam").value || 1;
layerInfoService.setLayersInfo(
new maplibregl.supermap.SetLayersInfoParameters({
layersInfo: result,
resourceID: newResourceID,
isTempLayers: true
})
).then((res) => {
map.style.sourceCaches['layer'].clearTiles();
map.style.sourceCaches['layer'].update(map.transform);
map.triggerRepaint();
});
new maplibregl.supermap.SetLayersInfoParameters({
layersInfo: result,
resourceID: newResourceID,
isTempLayers: true
})
).then((res) => {
map.style.sourceCaches['layer'].clearTiles();
map.style.sourceCaches['layer'].update(map.transform);
map.triggerRepaint();
});
}
</script>
</body>
Expand Down
41 changes: 21 additions & 20 deletions examples/openlayers/createTempLayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
<meta charset="UTF-8" />
<title data-i18n="resources.title_createTempLayer"></title>
<script type="text/javascript" src="../../dist/ol/include-ol.js"></script>
<style>
#toolbar {
position: absolute;
top: 50px;
right: 10px;
width: 300px;
text-align: center;
z-index: 500;
border-radius: 4px;
}
</style>
</head>
<style>
#toolbar {
position: absolute;
top: 50px;
right: 10px;
width: 300px;
text-align: center;
z-index: 500;
border-radius: 4px;
}
</style>

<body style="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0">
<div id="toolbar" class="panel panel-primary">
<div class="panel-heading">
Expand All @@ -31,7 +32,7 @@ <h5 class="panel-title text-center" data-i18n="resources.title_createTempLayer">
<div class="panel">
<div class="input-group">
<span class="input-group-addon" data-i18n="resources.text_gamma"></span>
<input id="gammaParam" value="1" class="form-control"></input>
<input id="gammaParam" value="1" class="form-control" />
</div>
</div>
<input
Expand Down Expand Up @@ -106,14 +107,14 @@ <h5 class="panel-title text-center" data-i18n="resources.title_createTempLayer">
var layer = result.subLayers.layers[0];
layer.gamma = document.getElementById("gammaParam").value || 1;
layerInfoService.setLayersInfo(
new ol.supermap.SetLayersInfoParameters({
layersInfo: result,
resourceID: newResourceID,
isTempLayers: true
})
).then((res) => {
tempLayer.getSource().updateParams();
});
new ol.supermap.SetLayersInfoParameters({
layersInfo: result,
resourceID: newResourceID,
isTempLayers: true
})
).then((res) => {
tempLayer.getSource().updateParams();
});
}
</script>
</body>
Expand Down

0 comments on commit 42e53da

Please sign in to comment.