Skip to content

Commit 332a0b5

Browse files
committed
修改图例示例按钮样式
1 parent f89c670 commit 332a0b5

File tree

4 files changed

+17
-33
lines changed

4 files changed

+17
-33
lines changed

examples/leaflet/01_layersLegend.html

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<style>
1010
#layersList,
1111
#mapLegend {
12-
max-height: 40vh;
12+
max-height: calc(40vh - 55px);
1313
overflow: auto;
1414
font-size: 12px;
1515
text-wrap: nowrap;
@@ -53,7 +53,9 @@ <h5 class='panel-title text-center'>
5353
</h5>
5454
</div>
5555
<div class="panel-body" id="layersList"></div>
56-
56+
<div class="panel-footer">
57+
<input class="btn btn-default" type="button" onclick="createLegend()" data-i18n="[value]resources.btn_getLegend"></input>
58+
</div>
5759
</div>
5860
<div class="panel panel-primary legend" style="width:250px;margin-top: 50vh;position: absolute;float:right;">
5961
<div class="panel-heading">
@@ -68,7 +70,7 @@ <h5 class='panel-title text-center'>
6870
<script type="text/javascript" include="bootstrap" src="../js/include-web.js"></script>
6971
<script type="text/javascript" src="../../dist/leaflet/include-leaflet.js"></script>
7072
<script type="text/javascript">
71-
var url = (window.isLocal ? window.server : "https://iserver.supermap.io") + "/iserver/services/map-jingjin/rest/maps/京津地区土地利用现状图";
73+
var url = (window.isLocal ? window.server : "https://iserver.supermap.io") + "/iserver/services/map-jingjin/rest/maps/京津地区地图";
7274
var map = L.map('map', {
7375
preferCanvas: true,
7476
crs: L.CRS.EPSG4326,
@@ -127,12 +129,6 @@ <h5 class='panel-title text-center'>
127129
var parentDom = document.getElementById('layersList');
128130
var layerName = '@@' + serviceResult.result.name;
129131
createLayersDom(layers, parentDom, layerName);
130-
var submitBtn = document.createElement('input');
131-
submitBtn.type = 'button';
132-
submitBtn.classList = 'btn btn-default';
133-
submitBtn.value = resources.btn_getLegend;
134-
submitBtn.addEventListener('click', createLegend);
135-
layersList.appendChild(submitBtn);
136132
});
137133
}
138134

examples/mapboxgl/01_layersLegend.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<style>
1010
#layersList,
1111
#mapLegend {
12-
max-height: 40vh;
12+
max-height: calc(40vh - 55px);
1313
overflow: auto;
1414
font-size: 12px;
1515
text-wrap: nowrap;
@@ -53,7 +53,9 @@ <h5 class='panel-title text-center'>
5353
</h5>
5454
</div>
5555
<div class="panel-body" id="layersList"></div>
56-
56+
<div class="panel-footer">
57+
<input class="btn btn-default" type="button" onclick="createLegend()" data-i18n="[value]resources.btn_getLegend"></input>
58+
</div>
5759
</div>
5860
<div class="panel panel-primary legend" style="width:250px;margin-top: 50vh;position: absolute;">
5961
<div class="panel-heading">
@@ -149,12 +151,6 @@ <h5 class='panel-title text-center'>
149151
var parentDom = document.getElementById('layersList');
150152
var layerName = '@@' + serviceResult.result.name;
151153
createLayersDom(layers, parentDom, layerName);
152-
var submitBtn = document.createElement('input');
153-
submitBtn.type = 'button';
154-
submitBtn.classList = 'btn btn-default';
155-
submitBtn.value = resources.btn_getLegend;
156-
submitBtn.addEventListener('click', createLegend);
157-
layersList.appendChild(submitBtn);
158154
});
159155
}
160156

examples/maplibregl/01_layersLegend.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<style>
1111
#layersList,
1212
#mapLegend {
13-
max-height: 40vh;
13+
max-height: calc(40vh - 55px);
1414
overflow: auto;
1515
font-size: 12px;
1616
text-wrap: nowrap;
@@ -54,7 +54,9 @@ <h5 class='panel-title text-center'>
5454
</h5>
5555
</div>
5656
<div class="panel-body" id="layersList"></div>
57-
57+
<div class="panel-footer">
58+
<input class="btn btn-default" type="button" onclick="createLegend()" data-i18n="[value]resources.btn_getLegend"></input>
59+
</div>
5860
</div>
5961
<div class="panel panel-primary legend" style="width:250px;margin-top: 50vh;position: absolute;">
6062
<div class="panel-heading">
@@ -150,12 +152,6 @@ <h5 class='panel-title text-center'>
150152
var parentDom = document.getElementById('layersList');
151153
var layerName = '@@' + serviceResult.result.name;
152154
createLayersDom(layers, parentDom, layerName);
153-
var submitBtn = document.createElement('input');
154-
submitBtn.type = 'button';
155-
submitBtn.classList = 'btn btn-default';
156-
submitBtn.value = resources.btn_getLegend;
157-
submitBtn.addEventListener('click', createLegend);
158-
layersList.appendChild(submitBtn);
159155
});
160156
}
161157

examples/openlayers/01_layersLegend.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<style>
1111
#layersList,
1212
#mapLegend {
13-
max-height: 40vh;
13+
max-height: calc(40vh - 55px);
1414
overflow: auto;
1515
font-size: 12px;
1616
text-wrap: nowrap;
@@ -54,7 +54,9 @@ <h5 class='panel-title text-center'>
5454
</h5>
5555
</div>
5656
<div class="panel-body" id="layersList"></div>
57-
57+
<div class="panel-footer">
58+
<input class="btn btn-default" type="button" onclick="createLegend()" data-i18n="[value]resources.btn_getLegend"></input>
59+
</div>
5860
</div>
5961
<div class="panel panel-primary legend" style="width:250px;margin-top: 50vh;position: absolute;">
6062
<div class="panel-heading">
@@ -154,12 +156,6 @@ <h5 class='panel-title text-center'>
154156
var parentDom = document.getElementById('layersList');
155157
var layerName = '@@' + serviceResult.result.name;
156158
createLayersDom(layers, parentDom, layerName);
157-
var submitBtn = document.createElement('input');
158-
submitBtn.type = 'button';
159-
submitBtn.classList = 'btn btn-default';
160-
submitBtn.value = resources.btn_getLegend;
161-
submitBtn.addEventListener('click', createLegend);
162-
layersList.appendChild(submitBtn);
163159
});
164160
}
165161

0 commit comments

Comments
 (0)