|
9 | 9 | <script type="text/javascript" src="../../dist/include-leaflet.js"></script> |
10 | 10 | <script type="text/javascript"> |
11 | 11 | 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"); |
13 | 13 | var token = "jDTu8vHZoo9ABgE_IW48UcyYbwBhlOmfIub7gscWjzmiszd0vKC7xtcp8pIcK0eAAzANtETZdaFiE9d1l9Ojtg.."; |
14 | 14 | 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"; |
18 | 18 | map = L.map('map', { |
19 | 19 | preferCanvas: true, |
20 | 20 | crs: L.CRS.EPSG3857, |
|
23 | 23 | zoom: 12 |
24 | 24 | }); |
25 | 25 | L.supermap.tiledMapLayer(urlMap).addTo(map); |
26 | | - if(!window.isLocal){ |
| 26 | + if (!window.isLocal) { |
27 | 27 | SuperMap.SecurityManager.registerToken(urlDataFlow, token); |
28 | 28 | } |
29 | 29 |
|
|
39 | 39 | }, |
40 | 40 | onEachFeature: function (feature, layer) { |
41 | 41 | 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); |
45 | 45 | }, |
46 | 46 | //geometry:{coordinates:[[[116.381741960923,39.8765100055449],[116.414681699817,39.8765100055449],[116.414681699817,39.8415115329708],[116.381741960923, 39.8415115329708],[116.381741960923,39.8765100055449]]],type:"Polygon"}, |
47 | 47 | // excludeField:["id"] |
|
61 | 61 | } |
62 | 62 | }); |
63 | 63 | 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 | + }); |
72 | 72 | } |
73 | 73 |
|
74 | 74 | var count = 200; |
|
0 commit comments