Skip to content

Commit 4b65fec

Browse files
author
caoxinke@supermap.com
committed
修改OpenLayers相关例子中url的写法兼容离线情况。
1 parent 024ae1c commit 4b65fec

File tree

96 files changed

+174
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+174
-171
lines changed

examples/img/end_trans.png

3.97 KB
Loading

examples/img/marker-gold.png

4.98 KB
Loading

examples/img/markerbig.png

4.06 KB
Loading

examples/img/markerbig_select.png

1.39 KB
Loading

examples/img/start_trans.png

3.88 KB
Loading

examples/openlayers/01_layerService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
duration: 250
6161
}
6262
}));
63-
var map, url = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
63+
var url = (window.isLocal ? document.location.host : "http://support.supermap.com.cn:8090")+"/iserver/services/map-world/rest/maps/World";
6464
map = new ol.Map({
6565
target: 'map',
6666
controls: ol.control.defaults({attributionOptions: {collapsed: false}})

examples/openlayers/01_mapQueryByBounds.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div id="map" style="width: 100%;height:100%"></div>
1010
<script type="text/javascript">
1111
var map, polygon, vectorLayer, resultLayer,
12-
url = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
12+
url = (window.isLocal ? document.location.host : "http://support.supermap.com.cn:8090")+"/iserver/services/map-world/rest/maps/World";
1313
map = new ol.Map({
1414
target: 'map',
1515
controls: ol.control.defaults({attributionOptions: {collapsed: false}})

examples/openlayers/01_mapQueryByDistance.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div id="map" style="width: 100%;height:100%"></div>
1010
<script type="text/javascript">
1111
var map, point, vectorLayer, resultLayer,
12-
url = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
12+
url = (window.isLocal ? document.location.host : "http://support.supermap.com.cn:8090")+"/iserver/services/map-world/rest/maps/World";
1313
map = new ol.Map({
1414
target: 'map',
1515
controls: ol.control.defaults({attributionOptions: {collapsed: false}})
@@ -35,7 +35,7 @@
3535
point = new ol.geom.Point([104, 30]);
3636
var iconStyle = new ol.style.Style({
3737
image: new ol.style.Icon(({
38-
src: 'http://support.supermap.com.cn:8090/iserver/iClient/forJavaScript/examples/images/markerbig_select.png'
38+
src: '../img/markerbig_select.png'
3939
}))
4040
});
4141
var feature = new ol.Feature(point);

examples/openlayers/01_mapQueryByGeometry.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div id="map" style="width: 100%;height:100%"></div>
1010
<script type="text/javascript">
1111
var map, vectorLayer, resultLayer,
12-
url = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
12+
url = (window.isLocal ? document.location.host : "http://support.supermap.com.cn:8090")+"/iserver/services/map-world/rest/maps/World";
1313
map = new ol.Map({
1414
target: 'map',
1515
controls: ol.control.defaults({attributionOptions: {collapsed: false}})

examples/openlayers/01_mapQueryBySQL.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%">
99
<div id="map" style="width: 100%;height:100%"></div>
1010
<script type="text/javascript">
11-
var map, resultLayer, url = "http://support.supermap.com.cn:8090/iserver/services/map-world/rest/maps/World";
11+
var map, resultLayer, url = (window.isLocal ? document.location.host : "http://support.supermap.com.cn:8090")+"/iserver/services/map-world/rest/maps/World";
1212
map = new ol.Map({
1313
target: 'map',
1414
controls: ol.control.defaults({attributionOptions: {collapsed: false}})

0 commit comments

Comments
 (0)