kopia lustrzana https://github.com/OpenDroneMap/WebODM
Added standby component for loading textured mesh
rodzic
b08b09f581
commit
cccc1d1935
|
@ -40,7 +40,7 @@ def get_tile_json(name, tiles, bounds):
|
||||||
'scheme': 'tms',
|
'scheme': 'tms',
|
||||||
'tiles': tiles,
|
'tiles': tiles,
|
||||||
'minzoom': 0,
|
'minzoom': 0,
|
||||||
'maxzoom': 22,
|
'maxzoom': 21,
|
||||||
'bounds': bounds
|
'bounds': bounds
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import './css/ModelView.scss';
|
import './css/ModelView.scss';
|
||||||
import ErrorMessage from './components/ErrorMessage';
|
import ErrorMessage from './components/ErrorMessage';
|
||||||
|
import Standby from './components/Standby';
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
|
|
||||||
const THREE = require('three'); // import does not work :/
|
const THREE = require('three'); // import does not work :/
|
||||||
|
@ -495,6 +496,8 @@ class ModelView extends React.Component {
|
||||||
if (modelReference === null && !initializingModel){
|
if (modelReference === null && !initializingModel){
|
||||||
|
|
||||||
initializingModel = true;
|
initializingModel = true;
|
||||||
|
this.texturedModelStandby.show();
|
||||||
|
|
||||||
const mtlLoader = new THREE.MTLLoader();
|
const mtlLoader = new THREE.MTLLoader();
|
||||||
mtlLoader.setTexturePath(this.texturedModelDirectoryPath());
|
mtlLoader.setTexturePath(this.texturedModelDirectoryPath());
|
||||||
mtlLoader.setPath(this.texturedModelDirectoryPath());
|
mtlLoader.setPath(this.texturedModelDirectoryPath());
|
||||||
|
@ -528,6 +531,7 @@ class ModelView extends React.Component {
|
||||||
|
|
||||||
modelReference = object;
|
modelReference = object;
|
||||||
initializingModel = false;
|
initializingModel = false;
|
||||||
|
this.texturedModelStandby.hide();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
|
@ -1052,8 +1056,13 @@ class ModelView extends React.Component {
|
||||||
<div
|
<div
|
||||||
className="container"
|
className="container"
|
||||||
ref={(domNode) => { this.container = domNode; }}
|
ref={(domNode) => { this.container = domNode; }}
|
||||||
style={{height: "100%", width: "100%"}}
|
style={{height: "100%", width: "100%", position: "relative"}}
|
||||||
onContextMenu={(e) => {e.preventDefault();}}></div>
|
onContextMenu={(e) => {e.preventDefault();}}>
|
||||||
|
<Standby
|
||||||
|
message="Loading textured model..."
|
||||||
|
ref={(domNode) => { this.texturedModelStandby = domNode; }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>);
|
</div>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,19 +56,19 @@ class Map extends React.Component {
|
||||||
"Google Maps Hybrid": L.tileLayer('//{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}', {
|
"Google Maps Hybrid": L.tileLayer('//{s}.google.com/vt/lyrs=s,h&x={x}&y={y}&z={z}', {
|
||||||
attribution: 'Map data: © Google Maps',
|
attribution: 'Map data: © Google Maps',
|
||||||
subdomains: ['mt0','mt1','mt2','mt3'],
|
subdomains: ['mt0','mt1','mt2','mt3'],
|
||||||
maxZoom: 22,
|
maxZoom: 21,
|
||||||
minZoom: 0,
|
minZoom: 0,
|
||||||
label: 'Google Maps Hybrid'
|
label: 'Google Maps Hybrid'
|
||||||
}).addTo(this.map),
|
}).addTo(this.map),
|
||||||
"ESRI Satellite": L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
|
"ESRI Satellite": L.tileLayer('//server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
|
||||||
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
|
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
|
||||||
maxZoom: 22,
|
maxZoom: 21,
|
||||||
minZoom: 0,
|
minZoom: 0,
|
||||||
label: 'ESRI Satellite' // optional label used for tooltip
|
label: 'ESRI Satellite' // optional label used for tooltip
|
||||||
}),
|
}),
|
||||||
"OSM Mapnik": L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
"OSM Mapnik": L.tileLayer('//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
||||||
maxZoom: 22,
|
maxZoom: 21,
|
||||||
minZoom: 0,
|
minZoom: 0,
|
||||||
label: 'OSM Mapnik' // optional label used for tooltip
|
label: 'OSM Mapnik' // optional label used for tooltip
|
||||||
})
|
})
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
import React from 'react';
|
||||||
|
import '../css/Standby.scss';
|
||||||
|
|
||||||
|
class Standby extends React.Component {
|
||||||
|
static defaultProps = {
|
||||||
|
message: ""
|
||||||
|
};
|
||||||
|
|
||||||
|
static propTypes = {
|
||||||
|
message: React.PropTypes.string
|
||||||
|
};
|
||||||
|
|
||||||
|
constructor(props){
|
||||||
|
super(props);
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
message: props.message,
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
show(message = null){
|
||||||
|
this.setState({show: true});
|
||||||
|
if (message){
|
||||||
|
this.setState({message: message});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hide(){
|
||||||
|
this.setState({show: false});
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div className="standby"
|
||||||
|
style={{display: this.state.show ? "block" : "none"}}>
|
||||||
|
<div className="cover"> </div>
|
||||||
|
<div className="content">
|
||||||
|
<i className="fa fa-spinner fa-spin fa-2x fa-fw"></i>
|
||||||
|
<p>{this.state.message}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Standby;
|
|
@ -0,0 +1,26 @@
|
||||||
|
.standby{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
.cover{
|
||||||
|
opacity: 0.5;
|
||||||
|
background-color: #111;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
.content{
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
top: 45%;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
padding: 0;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
Ładowanie…
Reference in New Issue