Skip to content

Commit

Permalink
Change 3D option (flight path option) based on map version 1.6 instea…
Browse files Browse the repository at this point in the history
…d of checking FC map
  • Loading branch information
akhuoa committed Mar 18, 2024
1 parent c1d6285 commit b72b254
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions src/components/FlatmapVuer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,9 @@
</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">Dimension display</el-row>
<el-row class="backgroundControl" v-if="displayFlightPathOption">
<el-radio-group
v-model="dimensionRadio"
class="flatmap-radio"
Expand Down Expand Up @@ -1331,6 +1331,27 @@ 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.setDimension(true)
} else {
// Hide flight path option UI
this.displayFlightPathOption = false
// Show 2D as default on FC type
this.setDimension(false)
}
},
/**
* @vuese
* Function to create Flatmap
Expand Down Expand Up @@ -1402,6 +1423,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 +1481,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 @@ -1772,6 +1793,7 @@ export default {
drawerOpen: false,
annotationRadio: false,
dimensionRadio: false,
displayFlightPathOption: false,
colourRadio: true,
outlinesRadio: true,
minimapResizeShow: false,
Expand Down

0 comments on commit b72b254

Please sign in to comment.