Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Flight Path Option #140

Merged
merged 3 commits into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 27 additions & 10 deletions src/components/FlatmapVuer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,13 @@
</el-option>
</el-select>
</el-row>
<el-row class="backgroundSpacer"></el-row>
<el-row class="backgroundText" v-if="isFC">Dimension display</el-row>
<el-row class="backgroundControl" v-if="isFC">
<el-row class="backgroundSpacer" v-if="displayFlightPathOption"></el-row>
<el-row class="backgroundText" v-if="displayFlightPathOption">Flight path display</el-row>
<el-row class="backgroundControl" v-if="displayFlightPathOption">
<el-radio-group
v-model="dimensionRadio"
v-model="flightPath3DRadio"
class="flatmap-radio"
@change="setDimension"
@change="setFlightPath3D"
>
<el-radio :label="false">2D</el-radio>
<el-radio :label="true">3D</el-radio>
Expand Down Expand Up @@ -633,8 +633,8 @@ export default {
* Function to switch from 2D to 3D
* @arg flag
*/
setDimension: function (flag) {
this.dimensionRadio = flag
setFlightPath3D: function (flag) {
this.flightPath3DRadio = flag
if (this.mapImp) {
this.mapImp.enable3dPaths(flag)
}
Expand Down Expand Up @@ -1331,6 +1331,22 @@ export default {
if (state.searchTerm) this.searchAndShowResult(state.searchTerm, true)
}
},
/**
* @vuese
* Function to show flight path option
* (3D option)
* based on the map version (currently 1.6 and above).
* @arg mapVersion
*/
setFlightPathInfo: function (mapVersion) {
const mapVersionForFlightPath = 1.6
if (mapVersion === mapVersionForFlightPath || mapVersion > mapVersionForFlightPath) {
// Show flight path option UI
this.displayFlightPathOption = true
// Show 3D as default on FC type
this.setFlightPath3D(true)
}
},
/**
* @vuese
* Function to create Flatmap
Expand Down Expand Up @@ -1402,6 +1418,8 @@ export default {
promise1.then((returnedObject) => {
this.mapImp = returnedObject
this.serverUUID = this.mapImp.getIdentifier().uuid
let mapVersion = this.mapImp.details.version
this.setFlightPathInfo(mapVersion)
this.onFlatmapReady()
if (this._stateToBeSet) this.restoreMapState(this._stateToBeSet)
else {
Expand Down Expand Up @@ -1458,8 +1476,6 @@ export default {
this.sensor = new ResizeSensor(this.$refs.display, this.mapResize)
if (this.mapImp.options && this.mapImp.options.style === 'functional') {
this.isFC = true
// Show 3D as default on FC type
this.setDimension(true)
}
this.mapImp.setBackgroundOpacity(1)
this.backgroundChangeCallback(this.currentBackground)
Expand Down Expand Up @@ -1771,7 +1787,8 @@ export default {
connectivityTooltipVisible: false,
drawerOpen: false,
annotationRadio: false,
dimensionRadio: false,
flightPath3DRadio: false,
displayFlightPathOption: false,
colourRadio: true,
outlinesRadio: true,
minimapResizeShow: false,
Expand Down
Loading