Skip to content

Add live location sharing#1745

Open
alisa911 wants to merge 41 commits into
mainfrom
270526_1
Open

Add live location sharing#1745
alisa911 wants to merge 41 commits into
mainfrom
270526_1

Conversation

@alisa911

Copy link
Copy Markdown
Contributor

No description provided.

@alisa911

Copy link
Copy Markdown
Contributor Author

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces “Live Tracks” (live location sharing) to the OsmAnd Web map UI, including encrypted location payloads, STOMP/WebSocket connectivity, and new menu/map-layer integrations for viewing participants in real time.

Changes:

  • Added live-track encryption + share-link utilities (key-in-fragment flow with sessionStorage handoff).
  • Implemented STOMP client hook for subscribing/broadcasting live locations, plus menu UI for creating/bookmarking live tracks.
  • Added a Leaflet map layer to render live participant tracks/markers and basic live-track analytics in the context menu.

Reviewed changes

Copilot reviewed 28 out of 30 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
map/yarn.lock Locks new STOMP dependency.
map/package.json Adds @stomp/stompjs + sets WS URL for start:local.
map/.env.development Adds REACT_APP_WS_URL for dev.
map/.env.staging Adds REACT_APP_WS_URL for staging.
map/.env.production Adds REACT_APP_WS_URL for production.
map/src/manager/GlobalManager.js Adds LIVE_TRACKS_URL route constant.
map/src/App.js Registers /map/live/ route.
map/src/menu/MainMenu.js Treats /map/live/ as part of Tracks menu selection.
map/src/context/AppContext.js Adds live-tracks state (translations/participants/viewers/etc.).
map/src/util/livetracks/liveTrackUtils.js Builds share URL + extracts fragment key into sessionStorage.
map/src/util/livetracks/liveTrackCrypto.js AES-GCM encrypt/decrypt helpers + key/id derivation.
map/src/util/hooks/live/useLiveTrackUrl.js Reads live-track URL params + restores fragment key from sessionStorage.
map/src/util/hooks/live/useLiveTracking.js STOMP connection, subscriptions, geo broadcasting, state updates.
map/src/menu/tracks/TracksMenu.jsx Integrates Live Tracks folder/context menu into Tracks panel.
map/src/menu/tracks/liveTrack/LiveTrackGroup.jsx Adds Live Tracks entry in Tracks root list.
map/src/menu/tracks/liveTrack/LiveTrackFolder.jsx Live Tracks list UI + create dialog entry point.
map/src/menu/tracks/liveTrack/LiveTrackItem.jsx Live track list item UI + actions menu integration.
map/src/menu/tracks/liveTrack/CreateLiveTrackDialog.jsx Creates a live translation, shows/copies share link.
map/src/menu/tracks/liveTrack/LiveTrackContextMenu.jsx Shows participant cards + intervals/elevation analytics + follow action.
map/src/menu/actions/LiveTrackItemActions.jsx Actions menu for live-track item (start/pause/copy/delete/etc.).
map/src/map/OsmAndMap.jsx Loads LiveTrackLayer + extracts live-track key from URL hash.
map/src/map/layers/LiveTrackLayer.js Renders polylines/markers for participants + panning/follow logic.
map/src/menu/analyzer/util/SegmentColorizer.js Exports getColorByIndex for live-tracks coloring.
map/src/frame/components/titles/SubTitleMenu.jsx Adds rightContent slot (used by live-track participant cards).
map/src/menu/trackfavmenu.module.css Adds styles for live-track UI and tweaks menu button container layout.
map/src/resources/translations/en/web-translation.json Adds Live Tracks strings.
map/src/assets/icons/ic_action_folder_location.svg Adds Live Tracks folder icon asset.
map/src/setupProxy.js Adds WS proxy routing for /osmand-websocket.
map/src/index.js Exposes live-track simulator in dev builds.
map/src/test/liveTrackSimulator.js Adds dev-only simulator tool for generating live points.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread map/src/util/hooks/live/useLiveTracking.js Outdated
Comment thread map/src/util/hooks/live/useLiveTracking.js Outdated
Comment thread map/src/util/livetracks/liveTrackCrypto.js Outdated
Comment thread map/src/menu/tracks/liveTrack/CreateLiveTrackDialog.jsx
Comment thread map/src/menu/tracks/liveTrack/CreateLiveTrackDialog.jsx Outdated
Comment thread map/src/menu/tracks/liveTrack/LiveTrackContextMenu.jsx Outdated
Comment thread map/src/util/hooks/live/useLiveTracking.js
Comment thread map/src/util/hooks/live/useLiveTracking.js Outdated
Comment thread map/src/util/hooks/live/useLiveTracking.js Outdated
Comment thread map/src/menu/actions/LiveTrackItemActions.jsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 30 changed files in this pull request and generated 9 comments.

Comment thread map/src/map/layers/LiveTrackLayer.js Outdated
Comment thread map/src/menu/tracks/liveTrack/CreateLiveTrackDialog.jsx
Comment thread map/src/menu/tracks/liveTrack/CreateLiveTrackDialog.jsx Outdated
Comment thread map/src/menu/tracks/TracksMenu.jsx Outdated
Comment thread map/.env.development
Comment thread map/package.json
Comment thread map/src/test/liveTrackSimulator.js Outdated
Comment thread map/src/menu/tracks/liveTrack/LiveTrackContextMenu.jsx Outdated
Comment thread map/src/menu/tracks/liveTrack/LiveTrackGroup.jsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 31 out of 33 changed files in this pull request and generated 5 comments.

Comment thread map/src/util/livetracks/liveTrackUtils.js Outdated
Comment thread map/src/menu/tracks/liveTrack/LiveTrackContextMenu.jsx Outdated
Comment thread map/src/menu/actions/LiveTrackItemActions.jsx
Comment thread map/src/menu/tracks/TracksMenu.jsx Outdated
Comment thread map/src/menu/tracks/liveTrack/LiveTrackContextMenu.jsx Outdated
Comment on lines +40 to +41
// Sync the selected translation from the URL (?tid=...#<key>), restoring the AES key the map
// stashed in sessionStorage before leaflet-hash cleared the fragment.

@RZR-UA RZR-UA Jun 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think about implementing a URL scheme with a hash saved in the query string. For example, /map/live/?hash=17/50/40&tid=xxx#key may store/clear the key and finally restore the leaflet hash to keep saved map zoom/lat/lon.

@alisa911 alisa911 requested a review from RZR-UA June 11, 2026 04:44
Comment on lines +117 to +128
const key = keysRef.current[tid];
if (!key) continue;
encryptLocation(key, locationData)
.then((encData) => {
apiPost(
'/mapapi/translation/msg',
`translationId=${encodeURIComponent(tid)}&encryptedData=${encodeURIComponent(encData)}`,
{ headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }
).catch(() => {});
})
.catch(() => {});
}

@RZR-UA RZR-UA Jun 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Add throttling (limit not to send POST queries too often, at least 1 per second)
  2. Add reaction on HTTP errors (at least, console.info, at most increase throttling on errors)
  3. The same points should be considered in Android code (which is even more important to avoid server overloads).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants