|
9 | 9 | <script type="text/javascript" src="../js/include-web.js"></script> |
10 | 10 | </head> |
11 | 11 | <body style="margin: 0; overflow: hidden; background: #fff; width: 100%; height: 100%; position: absolute; top: 0"> |
12 | | - <div id="fgb-map" style="margin: 0 auto; width: 100%; height: 100%; position: absolute; top: 0; left: 0"> |
| 12 | + <div id="map" style="margin: 0 auto; width: 100%; height: 100%; position: absolute; top: 0; left: 0"> |
13 | 13 | </div> |
14 | 14 | <script type="text/javascript" include="FGB" src="../../dist/leaflet/include-leaflet.js"></script> |
15 | 15 | <script type="text/javascript"> |
16 | | - var allowMaxFeatures = 20000; |
| 16 | + var allowMaxFeatures = 120000; |
17 | 17 | var host = window.isLocal ? window.server : 'https://iserver.supermap.io'; |
18 | 18 | var map, |
19 | | - FGBMap, |
20 | 19 | resultLayer, |
21 | 20 | baseUrl = host + '/iserver/services/map-china400/rest/maps/China_4326', |
22 | 21 | url = 'http://localhost:8090/iserver/services/data-osm-line/rest/data'; |
23 | | - FGBMap = L.map('fgb-map', { |
| 22 | + map = L.map('map', { |
24 | 23 | preferCanvas: true, |
25 | 24 | crs: L.CRS.EPSG4326, |
26 | | - center: { lon: 113, lat: 39 }, |
| 25 | + center: [40.05, 116.3], |
27 | 26 | maxZoom: 18, |
28 | | - zoom: 3 |
| 27 | + zoom: 8 |
29 | 28 | }); |
30 | | - new L.supermap.TiledMapLayer(baseUrl).addTo(FGBMap); |
| 29 | + new L.supermap.TiledMapLayer(baseUrl).addTo(map); |
31 | 30 | var sqlParam = new L.supermap.GetFeaturesBySQLParameters({ |
32 | 31 | queryParameter: { |
33 | 32 | name: 'waterways@osm-line', |
|
38 | 37 | datasetNames: ['osm-line:waterways'] |
39 | 38 | }); |
40 | 39 | fgbQuery(); |
41 | | - |
| 40 | + window.map = map; |
42 | 41 | function fgbQuery() { |
43 | 42 | new L.supermap.FeatureService(url).getFeaturesBySQL( |
44 | 43 | sqlParam, |
45 | 44 | function (serviceResult) { |
46 | 45 | new L.supermap.FGBLayer(serviceResult.result.newResourceLocation, { |
47 | | - style: { |
48 | | - color: 'blue', |
49 | | - weight: 5 |
50 | | - }, |
51 | 46 | strategy: 'bbox' |
52 | | - }).addTo(FGBMap); |
| 47 | + }).addTo(map); |
53 | 48 | }, |
54 | 49 | 'FGB' |
55 | 50 | ); |
|
0 commit comments