Skip to content

Commit 250aff1

Browse files
committed
修改dataflow离线地址
1 parent ff34544 commit 250aff1

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

examples/leaflet/dataFlowService.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
<script type="text/javascript" src="../../dist/include-leaflet.js"></script>
1010
<script type="text/javascript">
1111
var host = window.isLocal ? document.location.protocol + "//" + document.location.host : "http://117.122.248.69:8090";
12-
var wsHost = "ws:\//" + (window.isLocal ? document.location.host: "117.122.248.69:8800");
12+
var wsHost = "ws:\//" + (window.isLocal ? document.location.hostname + "8800" : "117.122.248.69:8800");
1313
var token = "jDTu8vHZoo9ABgE_IW48UcyYbwBhlOmfIub7gscWjzmiszd0vKC7xtcp8pIcK0eAAzANtETZdaFiE9d1l9Ojtg..";
1414
var map,
15-
urlMap = host + "/iserver/services/map-china400/rest/maps/China",
16-
urlQuery = host + "/iserver/services/map-china400/rest/maps/China_4326",
17-
urlDataFlow = wsHost + "/iserver/services/dataflow/dataflow";
15+
urlMap = host + "/iserver/services/map-china400/rest/maps/China",
16+
urlQuery = host + "/iserver/services/map-china400/rest/maps/China_4326",
17+
urlDataFlow = wsHost + "/iserver/services/dataflow/dataflow";
1818
map = L.map('map', {
1919
preferCanvas: true,
2020
crs: L.CRS.EPSG3857,
@@ -23,7 +23,7 @@
2323
zoom: 12
2424
});
2525
L.supermap.tiledMapLayer(urlMap).addTo(map);
26-
if(!window.isLocal){
26+
if (!window.isLocal) {
2727
SuperMap.SecurityManager.registerToken(urlDataFlow, token);
2828
}
2929

@@ -39,9 +39,9 @@
3939
},
4040
onEachFeature: function (feature, layer) {
4141
L.popup({offset: L.point(0, 0)})
42-
.setLatLng(L.GeoJSON.coordsToLatLng(feature.geometry.coordinates))
43-
.setContent(feature.properties.time)
44-
.openOn(map);
42+
.setLatLng(L.GeoJSON.coordsToLatLng(feature.geometry.coordinates))
43+
.setContent(feature.properties.time)
44+
.openOn(map);
4545
},
4646
//geometry:{coordinates:[[[116.381741960923,39.8765100055449],[116.414681699817,39.8765100055449],[116.414681699817,39.8415115329708],[116.381741960923, 39.8415115329708],[116.381741960923,39.8765100055449]]],type:"Polygon"},
4747
// excludeField:["id"]
@@ -61,14 +61,14 @@
6161
}
6262
});
6363
L.supermap
64-
.queryService(urlQuery)
65-
.queryBySQL(param, function (serviceResult) {
66-
featureResult = serviceResult;
67-
dataFlowService = L.supermap.dataFlowService(urlDataFlow).initBroadcast();
68-
dataFlowService.on('broadcastSocketConnected', function (e) {
69-
timer = window.setInterval("broadcast()", 2000);
70-
})
71-
});
64+
.queryService(urlQuery)
65+
.queryBySQL(param, function (serviceResult) {
66+
featureResult = serviceResult;
67+
dataFlowService = L.supermap.dataFlowService(urlDataFlow).initBroadcast();
68+
dataFlowService.on('broadcastSocketConnected', function (e) {
69+
timer = window.setInterval("broadcast()", 2000);
70+
})
71+
});
7272
}
7373

7474
var count = 200;

examples/openlayers/dataFlowService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
}));
6161
var resultLayer,
6262
urlQuery = (window.isLocal ? document.location.protocol + "//" + document.location.host : "http://support.supermap.com.cn:8090") + "/iserver/services/map-china400/rest/maps/China_4326",
63-
wsHost = "ws:\//" + (window.isLocal ? document.location.host : "117.122.248.69:8800");
63+
wsHost = "ws:\//" + (window.isLocal ? document.location.hostname + "8800" : "117.122.248.69:8800");
6464
var token = "jDTu8vHZoo9ABgE_IW48UcyYbwBhlOmfIub7gscWjzmiszd0vKC7xtcp8pIcK0eAAzANtETZdaFiE9d1l9Ojtg..";
6565
var urlDataFlow = wsHost + "/iserver/services/dataflow/dataflow";
6666
var timer, featureResult, dataFlowService, source;

0 commit comments

Comments
 (0)