mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-12 06:12:18 +00:00
feat(voice): add reusable geometry actions
- turn named places and mapped landmarks into reusable bounded areas - count loaded records inside resolved, drawn and annotated geometry - find recent imagery for an area, the view or the pointer snapshot - keep osm place search behind an operator-configured overpass endpoint - preserve cancellation, ownership and follow-up memory across every action - cover geometry, provider lifecycle, cache isolation and voice routing
This commit is contained in:
1 parent
01979bba1e
commit
b234d7b427
84 files changed
+14262
-1681
No files matched your search
@@ -9,6 +9,7 @@
|
||||
* get_entity_context {scope:'pointer'} | {referent:n}
|
||||
* analyst_query {scope:{kind:'pointer', km?}}
|
||||
* annotate_map annotations[].target / toTarget / points[].target = 'pointer'
|
||||
* find_imagery {area:'pointer'}
|
||||
*
|
||||
* The pointer is the current turn's snapshot (see pointerContext.js); the
|
||||
* referents are the latest result's numbered list (see referents.js).
|
||||
@@ -259,6 +260,20 @@ function resolveAnnotate(args, { pointer }) {
|
||||
};
|
||||
}
|
||||
|
||||
function resolveImagery(args, { pointer }) {
|
||||
if (!isPointer(args.area)) return null;
|
||||
const target = pointerTarget(pointer);
|
||||
if (!target || !hasPosition(target)) return { error: NO_POINTER };
|
||||
return {
|
||||
args: {
|
||||
...withoutKeys(args, ['area']),
|
||||
center: { lat: target.lat, lon: target.lon },
|
||||
...(target.label ? { centerLabel: target.label } : {}),
|
||||
},
|
||||
used: { source: 'pointer', label: target.label || null },
|
||||
};
|
||||
}
|
||||
|
||||
const SCREEN_PAIRS = [
|
||||
['screenX', 'screenY'],
|
||||
['toScreenX', 'toScreenY'],
|
||||
@@ -326,6 +341,7 @@ const RESOLVERS = Object.freeze({
|
||||
get_entity_context: resolveContext,
|
||||
analyst_query: resolveAnalyst,
|
||||
annotate_map: resolveAnnotate,
|
||||
find_imagery: resolveImagery,
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user