feat: bundle example images
30
example/imagery/exampleImages.js
Normal file
@ -0,0 +1,30 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2024, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
* Import all *.jpg files from the images folder, add to an array
|
||||
* and export for use in the plugin.
|
||||
*/
|
||||
const imagesContext = require.context('@/../example/imagery/images', false, /\.jpg$/);
|
||||
const imageArray = imagesContext.keys().map((key) => imagesContext(key));
|
||||
|
||||
export default imageArray;
|
BIN
example/imagery/images/AS16-117-18731.jpg
Normal file
After Width: | Height: | Size: 94 KiB |
BIN
example/imagery/images/AS16-117-18732.jpg
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
example/imagery/images/AS16-117-18733.jpg
Normal file
After Width: | Height: | Size: 87 KiB |
BIN
example/imagery/images/AS16-117-18734.jpg
Normal file
After Width: | Height: | Size: 101 KiB |
BIN
example/imagery/images/AS16-117-18735.jpg
Normal file
After Width: | Height: | Size: 117 KiB |
BIN
example/imagery/images/AS16-117-18736.jpg
Normal file
After Width: | Height: | Size: 120 KiB |
BIN
example/imagery/images/AS16-117-18737.jpg
Normal file
After Width: | Height: | Size: 121 KiB |
BIN
example/imagery/images/AS16-117-18738.jpg
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
example/imagery/images/AS16-117-18739.jpg
Normal file
After Width: | Height: | Size: 108 KiB |
BIN
example/imagery/images/AS16-117-18740.jpg
Normal file
After Width: | Height: | Size: 93 KiB |
BIN
example/imagery/images/AS16-117-18741.jpg
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
example/imagery/images/AS16-117-18742.jpg
Normal file
After Width: | Height: | Size: 109 KiB |
BIN
example/imagery/images/AS16-117-18743.jpg
Normal file
After Width: | Height: | Size: 118 KiB |
BIN
example/imagery/images/AS16-117-18744.jpg
Normal file
After Width: | Height: | Size: 92 KiB |
BIN
example/imagery/images/AS16-117-18745.jpg
Normal file
After Width: | Height: | Size: 72 KiB |
@ -19,27 +19,11 @@
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
import DEFAULT_IMAGE_SAMPLES from '@/../example/imagery/exampleImages.js';
|
||||
import Layer16x9 from '@/plugins/imagery/layers/example-imagery-layer-16x9.png';
|
||||
import LayerSafe from '@/plugins/imagery/layers/example-imagery-layer-safe.png';
|
||||
import LayerScale from '@/plugins/imagery/layers/example-imagery-layer-scale.png';
|
||||
|
||||
const DEFAULT_IMAGE_SAMPLES = [
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18732.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18733.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18734.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18735.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18736.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18737.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18738.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18739.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18740.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18741.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18742.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18743.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18744.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18745.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18746.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18747.jpg',
|
||||
'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18748.jpg'
|
||||
];
|
||||
const DEFAULT_IMAGE_LOAD_DELAY_IN_MILLISECONDS = 20000;
|
||||
const MIN_IMAGE_LOAD_DELAY_IN_MILLISECONDS = 5000;
|
||||
|
||||
@ -94,15 +78,15 @@ export default function () {
|
||||
},
|
||||
layers: [
|
||||
{
|
||||
source: 'dist/imagery/example-imagery-layer-16x9.png',
|
||||
source: Layer16x9,
|
||||
name: '16:9'
|
||||
},
|
||||
{
|
||||
source: 'dist/imagery/example-imagery-layer-safe.png',
|
||||
source: LayerSafe,
|
||||
name: 'Safe'
|
||||
},
|
||||
{
|
||||
source: 'dist/imagery/example-imagery-layer-scale.png',
|
||||
source: LayerScale,
|
||||
name: 'Scale'
|
||||
}
|
||||
]
|
||||
@ -168,18 +152,15 @@ function getCompassValues(min, max) {
|
||||
|
||||
function getImageSamples(configuration) {
|
||||
let imageSamples = DEFAULT_IMAGE_SAMPLES;
|
||||
const { imageLocation } = configuration;
|
||||
|
||||
if (configuration.imageLocation && configuration.imageLocation.length) {
|
||||
imageSamples = getImageUrlListFromConfig(configuration);
|
||||
if (imageLocation && imageLocation.length) {
|
||||
imageSamples = imageLocation;
|
||||
}
|
||||
|
||||
return imageSamples;
|
||||
}
|
||||
|
||||
function getImageUrlListFromConfig(configuration) {
|
||||
return configuration.imageLocation.split(',');
|
||||
}
|
||||
|
||||
function getImageLoadDelay(domainObject) {
|
||||
const imageLoadDelay = Math.trunc(
|
||||
Number(domainObject.configuration.imageLoadDelayInMilliSeconds)
|
||||
|
@ -31,21 +31,21 @@
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
href="dist/assets/favicons/favicon-96x96.png"
|
||||
href="dist/favicons/favicon-96x96.png"
|
||||
sizes="96x96"
|
||||
type="image/x-icon"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
href="dist/assets/favicons/favicon-32x32.png"
|
||||
href="dist/favicons/favicon-32x32.png"
|
||||
sizes="32x32"
|
||||
type="image/x-icon"
|
||||
/>
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
href="dist/assets/favicons/favicon-16x16.png"
|
||||
href="dist/favicons/favicon-16x16.png"
|
||||
sizes="16x16"
|
||||
type="image/x-icon"
|
||||
/>
|
||||
|