Skip to content

Google Location Services & Weather Conditions for Mission Control - #2592

Open
GenCodeInc wants to merge 11 commits into
iNavFlight:maintenance-9.xfrom
GenCodeInc:feature/geolocation-button
Open

Google Location Services & Weather Conditions for Mission Control#2592
GenCodeInc wants to merge 11 commits into
iNavFlight:maintenance-9.xfrom
GenCodeInc:feature/geolocation-button

Conversation

@GenCodeInc

Copy link
Copy Markdown

Adds Google API integration to Mission Control for map centering and weather conditions when no drone is connected.

Auto-center on load — Probes Google Geolocation API on tab open, centers map on approximate location with info banner
Dual-purpose center button — Centers on drone GPS when connected, falls back to Google API position when not
Conditions panel — New sidebar panel showing wind, gusts, temperature, humidity, UV, precipitation, visibility, cloud cover from Google Weather API. Color-coded wind/UV values.
Unit-aware — Respects app unit preference (imperial/metric) for all weather data
Auto-refresh on GPS lock — Weather re-fetches with precise drone coords when GPS fix acquired
Address lookup fix — Now asks "Move to this location?" with OK/Cancel instead of moving immediately
Options UI — API key input, Test button (validates both Geolocation + Weather APIs), Help popup with setup instructions

Add Google API Key Option
image

Get help and info on what it does
image

See info in mission control, moves to googles rough location and you can see the weather info on the left
image

Fix to address search, currently it will move to location even if you press the "x" this is now fixed and added a yes/no
image

GenCodeInc added 4 commits March 14, 2026 21:37
- Add geolocate control (crosshair button) to bottom-right of OL map
- Calls Google Geolocation API directly using user-provided API key
- Add Google API Key field to Application Options under GPS Options
- Key stored locally via electron-store (never committed)
- Auto-adjusts zoom based on accuracy (14/12/10)
- Available in both connected and offline modes
@GenCodeInc

Copy link
Copy Markdown
Author

@b14ckyy can you see if this helps using wifi, I'm using the Google API, it should at least get to the same city.

@b14ckyy b14ckyy added the Enhancement Enhancement of existing functions label Mar 15, 2026
@b14ckyy

b14ckyy commented Mar 15, 2026

Copy link
Copy Markdown
Collaborator

Cool, I will give it a shot when I have time.

@GenCodeInc

Copy link
Copy Markdown
Author

Cool, I will give it a shot when I have time.

No rush, if they add the api key they get weather too, wind speed and all for helping mission planning before heading to the field. If drone is attached and locked gps, it will use that over any of the api keys. Let me know if you have any issues with adding the api key.

@sonarqubecloud

Copy link
Copy Markdown

@GenCodeInc

Copy link
Copy Markdown
Author

Cool, I will give it a shot when I have time.

The part is actually a bug fix, if you want me to make it a separate PR let me know "to address search, currently it will move to location even if you press the "x" this is now fixed and added a yes/no"

@sensei-hacker

Copy link
Copy Markdown
Member

@sensei-hacker sensei-hacker added this to the Future milestone May 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

@GenCodeInc

Copy link
Copy Markdown
Author

Quality Gate Passed Quality Gate passed

Issues 0 New issues 0 Accepted issues

Measures 0 Security Hotspots 0.0% Coverage on New Code 1.5% Duplication on New Code

See analysis details on SonarQube Cloud

@sensei-hacker The sonar has been resolved, also this fixes a small bug in the address search

@GenCodeInc

Copy link
Copy Markdown
Author

@sensei-hacker

Don't forget, this one has a fix "to address search, currently it will move to location even if you press the "x" this is now fixed and added a yes/no" to this one #2593

I think this one is also ready to merge

@sensei-hacker

Copy link
Copy Markdown
Member

A couple potential issues to check on:

  1. showApiLocationBanner() called with zero args on the map-auto-load path (mission_control.js:2824) — the function immediately no-ops since it requires args. Does this silently kill the privacy/accuracy disclosure banner?

  2. Wind-direction arrow table has a duplicate entry (mission_control.js:180) . SE and SW wind both render the same arrow glyph (↗ used twice; index 3 should be ↖).

  3. Duplicated reloadActiveTab() instead of reusing GUI.updateActivatedTab(). Should this just call the existing function at both new call sites?

  4. Pre-existing document-delegated click-handler leak in mission_control.js (search-address / center-on-drone) never gets .off()'d on reinit — not this PR's fault, but the PR's new Google API calls make each leaked handler firing burn real quota now.

Minor: missing ?? '—' fallback on humidity, unused getGoogleLocationZoom() helper duplicated inline, two dead locale keys, inline styles, unencoded API key in query string (low risk), inconsistent var/let/const.

Positives: renderConditionsInfo() correctly uses .text() everywhere else, decent error handling throughout, API key input is type="password" and never logged, geolocation
probe properly gated to avoid wasting API calls when GPS fix already exists, address-search refactor is a genuine improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Enhancement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants