Skip to content

Commit a43eeed

Browse files
【fix】修复官网iPortal SecurityManager使用示例,点击两次出图报错问题 reviewed by luoxiao
1 parent 9bbbcc1 commit a43eeed

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

examples/leaflet/iPortalSecurity.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ <h4 data-i18n="resources.title_iPortalSecurity"></h4>
229229
<tr>
230230
<td colspan="3">
231231
<div class="row">
232-
<div class="col-md-12 text-center">
232+
<div class="col-md-12 text-center" id="map_container">
233233
<div class="col-md-12" id="iportal_map" style=" height: 300px;"></div>
234234
</div>
235235
</div>
@@ -384,7 +384,8 @@ <h4 data-i18n="resources.title_iPortalSecurity"></h4>
384384
return;
385385
}
386386
L.supermap.SecurityManager.registerKey(mapUrl, key);
387-
387+
388+
$('#map_container')[0].innerHTML = `<div class="col-md-12" id="iportal_map" style=" height: 300px;"></div>`;
388389
var onlineMap = L.map('iportal_map', {
389390
crs: L.CRS.EPSG4326,
390391
center: [30, 104],

examples/openlayers/iPortalSecurity.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ <h4 data-i18n="resources.title_iPortalSecurity"></h4>
229229
<tr>
230230
<td colspan="3">
231231
<div class="row">
232-
<div class="col-md-12 text-center">
232+
<div class="col-md-12 text-center" id="map_container">
233233
<div class="col-md-12" id="iportal_map" style=" height: 300px;"></div>
234234
</div>
235235
</div>
@@ -382,6 +382,7 @@ <h4 data-i18n="resources.title_iPortalSecurity"></h4>
382382
}
383383
ol.supermap.SecurityManager.registerKey(mapUrl, key);
384384

385+
$('#map_container')[0].innerHTML = `<div class="col-md-12" id="iportal_map" style=" height: 300px;"></div>`;
385386
var map = new ol.Map({
386387
target: 'iportal_map',
387388
controls: ol.control.defaults({attributionOptions: {collapsed: false}})

0 commit comments

Comments
 (0)