|
25 | 25 | <script type="text/javascript" include="bootstrap" src="../js/include-web.js"></script> |
26 | 26 | <script |
27 | 27 | type="text/javascript" |
28 | | - include="mapbox-gl-enhance,proj4,turf,opencv" |
| 28 | + include="mapbox-gl-enhance,proj4,turf,videojs,opencv" |
29 | 29 | src="../../dist/mapboxgl/include-mapboxgl.js" |
30 | 30 | ></script> |
31 | 31 | <script type="text/javascript"> |
|
47 | 47 | version: 8, |
48 | 48 | sources: { |
49 | 49 | 'raster-tiles': { |
50 | | - attribution: attribution, |
51 | 50 | type: 'raster', |
52 | | - tiles: [url + '/zxyTileImage.png?z={z}&x={x}&y={y}'], |
53 | | - tileSize: 256 |
| 51 | + tileSize: 256, |
| 52 | + tiles: [ |
| 53 | + 'https://t4.tianditu.gov.cn/img_w/wmts?service=WMTS&request=GetTile&version=1.0.0&style=default&tilematrixSet=w&format=tiles&width=256&height=256&layer=img&tilematrix={z}&tilerow={y}&tilecol={x}&tk=1d109683f4d84198e37a38c442d68311' |
| 54 | + ] |
54 | 55 | } |
55 | 56 | }, |
56 | 57 | layers: [ |
|
59 | 60 | type: 'raster', |
60 | 61 | source: 'raster-tiles', |
61 | 62 | minzoom: 0, |
62 | | - maxzoom: 9 |
| 63 | + maxzoom: 22 |
63 | 64 | } |
64 | 65 | ] |
65 | 66 | }, |
|
71 | 72 | function query() { |
72 | 73 | var sqlParam = new mapboxgl.supermap.GetFeaturesBySQLParameters({ |
73 | 74 | queryParameter: { |
74 | | - name: datasetName + '@' + datasourceName, |
| 75 | + name: datasetName + '@' + datasourceName, |
75 | 76 | attributeFilter: 'SMID > 0' |
76 | 77 | }, |
77 | 78 | datasetNames: [datasourceName + ':' + datasetName] |
78 | 79 | }); |
79 | 80 |
|
80 | | - new mapboxgl.supermap.FeatureService(dataUrl).getFeaturesBySQL(boundsParam).then(function (serviceResult) { |
| 81 | + new mapboxgl.supermap.FeatureService(dataUrl).getFeaturesBySQL(sqlParam).then(function (serviceResult) { |
81 | 82 | let coordinates = []; |
82 | 83 | turf.featureEach(serviceResult.result.features, function (currentFeature, featureIndex) { |
83 | 84 | currentFeature.geometry.coordinates[0][0].forEach((coord) => { |
84 | 85 | const res = proj4('EPSG:3857', 'EPSG:4326', coord); |
85 | 86 | coordinates.push(res); |
86 | 87 | }); |
87 | 88 | }); |
| 89 | + map.setCenter(coordinates[0]); |
88 | 90 | let address = serviceResult.result.features.features[0].properties.address; |
89 | 91 | videoLayer = new mapboxgl.supermap.VideoLayer({ |
90 | 92 | url: address, |
|
0 commit comments