Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
22a6a15
Rename UserInterface_ files
ac-61 Sep 25, 2025
58872b7
Reorganize UserInterface_ into mobile and desktop versions
ac-61 Sep 25, 2025
04d18e4
Attach tools to the bottom of the screen
ac-61 Sep 30, 2025
bdbbfc7
Try to get TimeUI working in mobile version
ac-61 Oct 6, 2025
1f0b152
Rearrange TimeUI tool elements
ac-61 Oct 12, 2025
cefe569
Get LegendTool working in mobile
ac-61 Oct 13, 2025
c0757dc
Add hamburger menu bar
ac-61 Oct 13, 2025
6bb364f
Clear LegendTool when switching tools on mobile mode
ac-61 Oct 13, 2025
6c3cc61
Do not initialize TimeUI as a plugin
ac-61 Nov 4, 2025
a15782f
Get Legend tool to display in mobile mode
ac-61 Nov 4, 2025
39b66e1
Add mobile version of Coordinates
ac-61 Nov 5, 2025
b4ce575
Initialize UserInterface properly
ac-61 Nov 5, 2025
d6cf57b
Make sure compass and scale bar are in the correct position
ac-61 Nov 5, 2025
3d39dce
Clean up
ac-61 Nov 5, 2025
c02a287
Hide Time tool and unused toolbar tools
ac-61 Nov 6, 2025
b64b02f
Clean up
ac-61 Nov 6, 2025
7b5c862
Move compass to correct position
ac-61 Nov 6, 2025
a5af782
Set coordinates tool to center of map during init
ac-61 Nov 6, 2025
30da296
chore: bump version to 4.1.5-20251106 [version bump]
github-actions[bot] Nov 6, 2025
5466c68
Shrink the size of the coordinate tool in mobile mode
ac-61 Nov 7, 2025
02322a3
Make scale bar only one unit in mobile mode
ac-61 Nov 7, 2025
a42cb00
Keep the scale bar a consistent color in mobile mode
ac-61 Nov 7, 2025
8bc003a
chore: bump version to 4.1.6-20251107 [version bump]
github-actions[bot] Nov 7, 2025
5c3487e
Add mission switcher
ac-61 Nov 7, 2025
273ef2b
Merge remote-tracking branch 'origin/development' into ac-mobile
ac-61 Nov 7, 2025
fb2429c
chore: bump version to 4.1.6-20251107 [version bump]
github-actions[bot] Nov 7, 2025
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
2 changes: 1 addition & 1 deletion configure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "configure",
"version": "4.1.4-20251105",
"version": "4.1.6-20251107",
"homepage": "./configure/build",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mmgis",
"version": "4.1.4-20251105",
"version": "4.1.6-20251107",
"description": "A web-based mapping and localization solution for science operation on planetary missions.",
"homepage": "build",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/essence/Ancillary/Attributions.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var Attributions = {
$('#mapToolBar').css('height', '40px')
}
// Set compass to base position when no attributions
$('#mmgis-map-compass').css('bottom', '38px')
$('#mmgis-map-compass').css('bottom', L_.UserInterface_?.isMobile === true ? '78px' : '38px')
return
}

Expand Down
130 changes: 107 additions & 23 deletions src/essence/Ancillary/Coordinates.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ import * as d3 from 'd3'
import F_ from '../Basics/Formulae_/Formulae_'
import Map_ from '../Basics/Map_/Map_'
import L_ from '../Basics/Layers_/Layers_'
import TimeUI from './TimeUI'
import Dropy from '../../external/Dropy/dropy'
import UserInterface from '../Basics/UserInterface_/UserInterface_'
import * as _UserInterface_ from '../Basics/UserInterface_/UserInterface_'
import calls from '../../pre/calls'

import tippy from 'tippy.js'

import './Coordinates.css'

const UserInterface = await _UserInterface_.default()

// prettier-ignore
const markup = [
"<div class='mouseLngLat'>",
Expand Down Expand Up @@ -101,24 +104,57 @@ const Coordinates = {
coordENMultiplier: [1, 1],
},
},
initialize: function () {
if (UserInterface.isMobile === true) {
this.width = 'full'
this.height = 100
}
},
make: function () {
this.MMWebGISInterface = new interfaceWithMMWebGIS()
},
destroy: function () {
this.MMWebGISInterface.separateFromMMWebGIS()
},
init: function () {
d3.select('#CoordinatesDiv').remove()
d3.select('body')
.append('div')
.attr('id', 'CoordinatesDiv')
.html(markup)

tippy('#pickLngLat', {
content: 'Pick Coordinates',
placement: 'top',
theme: 'blue',
})
tippy('#toggleTimeUI', {
content: 'Time',
placement: 'top',
theme: 'blue',
offset: [0, 20],
})

if (!UserInterface.isMobile) {
d3.select('body')
.append('div')
.attr('id', 'CoordinatesDiv')
.html(markup)
} else {
var additionalDiv = [
"<div class='left'>",
"<div id='coordUITitle'>Coordinates</div>",
"</div>",
].join('\n');

d3.select('#tools')
.append('div')
.attr('id', 'coordUIHeader')
.html(additionalDiv)

d3.select('#tools')
.append('div')
.attr('id', 'CoordinatesDiv')
.html(markup)
}

if (!UserInterface.isMobile) {
tippy('#pickLngLat', {
content: 'Pick Coordinates',
placement: 'top',
theme: 'blue',
})
tippy('#toggleTimeUI', {
content: 'Time',
placement: 'top',
theme: 'blue',
offset: [0, 20],
})
}

if (
!(
Expand Down Expand Up @@ -245,11 +281,15 @@ const Coordinates = {
if (L_.configData.coordinates.coordsite)
Coordinates.states.site.available = true
}
// Remove all unavailable state
Object.keys(Coordinates.states).forEach((s) => {
if (!Coordinates.states[s].available) delete Coordinates.states[s]
else delete Coordinates.states[s].available
})

// If the available key does not exist, it means they were already deleted
if (Object.keys(Coordinates.states).length === Object.values(Coordinates.states).filter(i => i.available != undefined).length) {
// Remove all unavailable state
Object.keys(Coordinates.states).forEach((s) => {
if (!Coordinates.states[s].available) delete Coordinates.states[s]
else delete Coordinates.states[s].available
})
}
Coordinates.stateIndices = Object.keys(Coordinates.states)

// Set main type and, if invalid main type, default back to ll
Expand Down Expand Up @@ -280,7 +320,8 @@ const Coordinates = {
(L_.FUTURES.live === true ||
(L_.FUTURES.live == null &&
(L_.configData.time.initiallyOpen === true ||
L_.configData.time.liveByDefault === true)))
L_.configData.time.liveByDefault === true))) &&
!UserInterface.isMobile
) {
toggleTimeUI()
}
Expand Down Expand Up @@ -824,4 +865,47 @@ function toggleTimeUI() {
})
}


function interfaceWithMMWebGIS() {
this.separateFromMMWebGIS = function () {
separateFromMMWebGIS()
}

//MMWebGIS should always have a div with id 'tools'
var tools = d3.select('#tools')
//Clear it
tools.selectAll('*').remove()

//Add the markup to tools or do it manually
//tools.html(markup)

Coordinates.init()

if (UserInterface.isMobile) {
d3.select('#CoordinatesDiv > #toggleTimeUI').remove()

const mapRect = document.getElementById('map').getBoundingClientRect()

// Find center of map
const wOffset = mapRect.width / 2
const hOffset = mapRect.height / 2

//Find coordinates at map center and at another point one pixel below the center
const centerlatlong = Map_.map.containerPointToLatLng([
wOffset,
hOffset,
])

// Set the coordinates to the center of the map
$('#mouseLngLat').text(`${centerlatlong.lng}, ${centerlatlong.lat}`)
}

function separateFromMMWebGIS() {
let tools = d3.select('#tools')

//Clear it
tools.selectAll('*').remove()
}
}

export default Coordinates
Loading