Skip to content

Commit

Permalink
【fix】include中增加opencv flv
Browse files Browse the repository at this point in the history
  • Loading branch information
songyumeng committed Apr 29, 2024
1 parent 809dd90 commit 5c47f58
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
7 changes: 7 additions & 0 deletions dist/mapboxgl/include-mapboxgl.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@
inputCSS(libsurl + '/video-js/7.10.2/video-js.min.css');
inputScript(libsurl + '/video-js/7.10.2/video.min.js');
}
if (inArray(includes, 'flvjs')) {
inputScript(libsurl + '/flvjs/1.6.2/flv.js');
inputScript(libsurl + '/videojs-flvjs-es6/1.0.1/videojs-flvjs-es6.js');
}
if (inArray(includes, 'opencv')) {
inputScript(libsurl + '/opencv/3.4/opencv.js');
}
// dist
if (!inArray(excludes, 'iclient-mapboxgl')) {
if (supportES6()) {
Expand Down
16 changes: 9 additions & 7 deletions examples/mapboxgl/videoLayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<script type="text/javascript" include="bootstrap" src="../js/include-web.js"></script>
<script
type="text/javascript"
include="mapbox-gl-enhance,proj4,turf,opencv"
include="mapbox-gl-enhance,proj4,turf,videojs,opencv"
src="../../dist/mapboxgl/include-mapboxgl.js"
></script>
<script type="text/javascript">
Expand All @@ -47,10 +47,11 @@
version: 8,
sources: {
'raster-tiles': {
attribution: attribution,
type: 'raster',
tiles: [url + '/zxyTileImage.png?z={z}&x={x}&y={y}'],
tileSize: 256
tileSize: 256,
tiles: [
'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'
]
}
},
layers: [
Expand All @@ -59,7 +60,7 @@
type: 'raster',
source: 'raster-tiles',
minzoom: 0,
maxzoom: 9
maxzoom: 22
}
]
},
Expand All @@ -71,20 +72,21 @@
function query() {
var sqlParam = new mapboxgl.supermap.GetFeaturesBySQLParameters({
queryParameter: {
name: datasetName + '@' + datasourceName,
name: datasetName + '@' + datasourceName,
attributeFilter: 'SMID > 0'
},
datasetNames: [datasourceName + ':' + datasetName]
});

new mapboxgl.supermap.FeatureService(dataUrl).getFeaturesBySQL(boundsParam).then(function (serviceResult) {
new mapboxgl.supermap.FeatureService(dataUrl).getFeaturesBySQL(sqlParam).then(function (serviceResult) {
let coordinates = [];
turf.featureEach(serviceResult.result.features, function (currentFeature, featureIndex) {
currentFeature.geometry.coordinates[0][0].forEach((coord) => {
const res = proj4('EPSG:3857', 'EPSG:4326', coord);
coordinates.push(res);
});
});
map.setCenter(coordinates[0]);
let address = serviceResult.result.features.features[0].properties.address;
videoLayer = new mapboxgl.supermap.VideoLayer({
url: address,
Expand Down

0 comments on commit 5c47f58

Please sign in to comment.