@aceshooting/lyra-ui 30.4.0 → 30.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -2
- package/dist/components/media/map/map-control-options.d.ts +12 -2
- package/dist/components/media/map/map-control-options.js +1 -1
- package/dist/components/media/map/map-controls-lifecycle.js +1 -1
- package/dist/components/media/map/map.class.d.ts +47 -8
- package/dist/components/media/map/map.class.js +13 -13
- package/dist/components/media/map/map.styles.js +1 -1
- package/dist/events.d.ts +6 -1
- package/dist/framework-types.d.ts +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/lyra.d.ts +1 -1
- package/llms/components/lr-map.md +50 -6
- package/llms/peers.md +1 -1
- package/package.json +5 -5
- package/skills/lyra-ui/lyra-gen.md +16 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 30.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 13b4c5d: Add `controls.attribution.initialExpanded` to `lr-map`, an initial-only seed for the compact credits disclosure, and the non-cancelable `lr-map-attribution-toggle` event (`detail.expanded`), which reports later changes of the owned attribution control without firing on installation, seeding, replacement or reconnect. Requested control outlines now stay in place, decorative and non-interactive, after the map is constructed until those controls finish loading, and paint with the installed controls' glass or solid surface material.
|
|
8
|
+
|
|
9
|
+
Add the opt-in `keyboardActivation` property (attribute `keyboard-activation`): while the map canvas has focus, an unmodified Enter or Space activates the interactive feature at the view centre through the click hit query and emits `lr-map-click` with `trigger: 'keyboard'`. Add `getVisibleBounds({ padded? })`, a synchronous read of the padded or full visible box that returns `null` before the engine exists.
|
|
10
|
+
|
|
11
|
+
The attribution state tracking, pending control outlines, keyboard centre activation and visible-bounds reader add runtime code, and their guides and generated editor data increase archive sizes. Only the exceeded media and viewers bundle ceilings, the unpacked UI archive ceiling and the generated IDE archive ceilings advance to the next 64-byte boundary; passing limits and measurement inputs remain unchanged.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- @aceshooting/lyra-translations@30.5.0
|
|
16
|
+
|
|
3
17
|
## 30.4.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
[](https://aceshooting.github.io/lyra-ui/)
|
|
9
9
|
[](https://www.lyra-ui.com/)
|
|
10
10
|
[](https://www.npmjs.com/package/@aceshooting/lyra-ui)
|
|
11
|
-
[](https://www.npmjs.com/package/@aceshooting/lyra-ui)
|
|
11
|
+
[](https://www.npmjs.com/package/@aceshooting/lyra-ui)
|
|
13
12
|
[](https://www.npmjs.com/package/@aceshooting/lyra-ui)
|
|
14
13
|
[](https://lit.dev/)
|
|
15
14
|
[](https://www.webcomponents.org/)
|
|
@@ -30,9 +30,19 @@ export interface LyraMapAttributionControlOptions extends LyraMapNavigationContr
|
|
|
30
30
|
/** Omission retains the peer's automatic compact layout.*/
|
|
31
31
|
readonly compact?:boolean;
|
|
32
32
|
/** Text or guarded links; at most 32 items and 16 KiB of labels and URLs. Caller HTML is never interpreted.*/
|
|
33
|
-
readonly customAttribution?:string|LyraMapAttributionLink|readonly(string|LyraMapAttributionLink)[];
|
|
33
|
+
readonly customAttribution?:string|LyraMapAttributionLink|readonly(string|LyraMapAttributionLink)[];
|
|
34
|
+
/**
|
|
35
|
+
* Initial state of the compact credits disclosure, applied once when the control is installed
|
|
36
|
+
* and only while the native control is compact; omission keeps the peer's initial state. It never
|
|
37
|
+
* hides noncompact credits, and later resizing, dragging or user activation stay native. Changing
|
|
38
|
+
* it replaces the control; reconnecting reapplies it. Observe `lr-map-attribution-toggle` to
|
|
39
|
+
* persist the user's choice for a later installation.
|
|
40
|
+
*/
|
|
41
|
+
readonly initialExpanded?:boolean;}export interface NormalizedMapControlOptions{readonly kind:MapOwnedControlKind;readonly position:LyraMapControlPosition;readonly order:number;readonly unit:LyraMapScaleUnit|undefined;readonly options:Readonly<Record<string,unknown>>;readonly key:string;
|
|
34
42
|
/** Escaped labels only, for text export without URLs or link markup.*/
|
|
35
|
-
readonly attributionText?:readonly string[];
|
|
43
|
+
readonly attributionText?:readonly string[];
|
|
44
|
+
/** Attribution wrapper metadata: the compact disclosure seed, never a native constructor option.*/
|
|
45
|
+
readonly initialExpanded?:boolean;}export interface MapControlOptionsResult{readonly controls:ReadonlyMap<MapOwnedControlKind,NormalizedMapControlOptions>;readonly diagnostics:readonly{readonly kind:MapOwnedControlKind;readonly code:'invalid-options';}[];}
|
|
36
46
|
/**
|
|
37
47
|
* Detached constructor options only. No permission requests, geolocation calls, DOM work or
|
|
38
48
|
* activation occur here. Navigation/scale preserve their existing malformed-field defaults;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveGuardedRel}from"../../../internal/link-rel.js";import{getOwnDataDescriptor,isPlainDataRecord,MISSING_OWN_DATA_DESCRIPTOR,UNSAFE_OWN_DATA_DESCRIPTOR}from"../../../internal/data-descriptors.js";const positions=new Set(["top-left","top-right","bottom-left","bottom-right"]);function runtimeRecord(input){try{return input!==null&&typeof input=="object"&&!Array.isArray(input)}catch{return!1}}function own(input,key){const descriptor=getOwnDataDescriptor(input,key);if(descriptor===UNSAFE_OWN_DATA_DESCRIPTOR)throw new TypeError("Unsafe control option");return descriptor===MISSING_OWN_DATA_DESCRIPTOR?void 0:descriptor.value}function optionalLegacy(input,key){try{return own(input,key)}catch{return}}function plain(input){if(!isPlainDataRecord(input))throw new TypeError("Expected plain control options");return input}function bool(input,key,fallback){const value=own(input,key);if(value===void 0)return fallback;if(typeof value!="boolean")throw new TypeError("Invalid boolean control option");return value}function number(input,key,fallback,maximum){const value=own(input,key);if(value===void 0)return fallback;if(typeof value!="number"||!Number.isFinite(value)||value<0||value>maximum)throw new RangeError("Invalid numeric control option");return value}function controlOrder(input){const value=own(input,"order");if(value===void 0)return 0;if(typeof value!="number"||!Number.isFinite(value))throw new TypeError("Invalid control order");return value}function position(input,fallback){const value=own(input,"position");if(value===void 0)return fallback;if(!positions.has(value))throw new TypeError("Invalid control position");return value}const escapeText=value=>value.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'");function attributionText(input){let total=0;const labels=[],text=value=>{if(typeof value!="string"||value.length>4096||(total+=value.length)>16384)throw new RangeError("Attribution text limit");return escapeText(value)},item=value=>{if(typeof value=="string"){const label2=text(value);return labels.push(label2),label2}const record=plain(value),label=text(own(record,"label")),raw=own(record,"url");if(typeof raw!="string"||raw.length>2048||/[\u0000-\u0020\u007f-\u009f]/.test(raw))throw new TypeError("Invalid attribution URL");const url=new URL(raw);if(url.protocol!=="http:"&&url.protocol!=="https:"||url.username||url.password||url.href.length>2048||(total+=url.href.length)>16384)throw new TypeError("Invalid attribution URL");const snapshot=Object.freeze({label,url:url.href});return labels.push(snapshot.label),`<a href="${escapeText(snapshot.url)}" target="_blank" rel="${resolveGuardedRel(void 0,"_blank")}">${snapshot.label}</a>`};let html;if(!Array.isArray(input))html=item(input);else{const length=own(input,"length");if(typeof length!="number"||!Number.isSafeInteger(length)||length<0||length>32)throw new RangeError("Attribution count limit");const result=[];for(let index=0;index<length;index++)result.push(item(own(input,String(index))));html=Object.freeze(result)}return Object.freeze({html,text:Object.freeze(labels)})}function normalizeMapControlOptions(input){const controls=new Map,diagnostics=[],done=()=>Object.freeze({controls,diagnostics:Object.freeze(diagnostics.map(item=>Object.freeze(item)))});if(!runtimeRecord(input))return done();for(const kind of["navigation","scale","geolocate","attribution"])try{const value=kind==="navigation"||kind==="scale"?optionalLegacy(input,kind):own(input,kind);if(value===void 0||value===!1)continue;if(kind==="navigation"||kind==="scale"){if(value!==!0&&!runtimeRecord(value))continue;const entry2=value===!0?{}:value,order2=controlOrder(entry2),fallback=kind==="navigation"?"top-right":"bottom-left",requested=optionalLegacy(entry2,"position"),corner2=positions.has(requested)?requested:fallback,unit=kind==="scale"?optionalLegacy(entry2,"unit")==="imperial"?"imperial":"metric":void 0;controls.set(kind,Object.freeze({kind,position:corner2,order:order2,unit,options:Object.freeze(kind==="scale"?{unit}:{}),key:`${corner2}:${order2}:${unit??""}`}));continue}const entry=value===!0?{}:plain(value),order=controlOrder(entry),corner=position(entry,kind==="geolocate"?"top-right":"bottom-right");let options,attributionLabels;if(kind==="geolocate"){const rawPosition=own(entry,"positionOptions"),rawFit=own(entry,"fitBoundsOptions"),positionOptions=rawPosition===void 0?{}:plain(rawPosition),fit=rawFit===void 0?{}:plain(rawFit),showUserLocation=bool(entry,"showUserLocation",!0),showAccuracyCircle=bool(entry,"showAccuracyCircle",!0),zoomToUserAccuracy=own(entry,"zoomToUserAccuracy");if(zoomToUserAccuracy!==void 0&&typeof zoomToUserAccuracy!="boolean")throw new TypeError("Invalid zoom option");options=Object.freeze({trackUserLocation:bool(entry,"trackUserLocation",!1),showUserLocation,showAccuracyCircle:showUserLocation&&showAccuracyCircle,positionOptions:Object.freeze({enableHighAccuracy:bool(positionOptions,"enableHighAccuracy",!1),timeout:number(positionOptions,"timeout",6e3,864e5),maximumAge:number(positionOptions,"maximumAge",0,864e5)}),fitBoundsOptions:Object.freeze({maxZoom:number(fit,"maxZoom",15,24)}),...zoomToUserAccuracy===void 0?{}:{zoomToUserAccuracy}})}else{const compact=own(entry,"compact"),custom=own(entry,"customAttribution");if(compact!==void 0&&typeof compact!="boolean")throw new TypeError("Invalid attribution mode");const credits=custom===void 0?void 0:attributionText(custom);attributionLabels=credits?.text,options=Object.freeze({...compact===void 0?{}:{compact},...credits===void 0?{}:{customAttribution:credits.html}})}controls.set(kind,Object.freeze({kind,position:corner,order,unit:void 0,options,...attributionLabels?{attributionText:attributionLabels}:{},key:`${corner}:${order}:${JSON.stringify(options)}`}))}catch{diagnostics.push({kind,code:"invalid-options"})}return done()}function mapGeolocationErrorCode(code){return code===1?"permission-denied":code===2?"position-unavailable":code===3?"timeout":"unknown"}export{mapGeolocationErrorCode,normalizeMapControlOptions};
|
|
1
|
+
import{resolveGuardedRel}from"../../../internal/link-rel.js";import{getOwnDataDescriptor,isPlainDataRecord,MISSING_OWN_DATA_DESCRIPTOR,UNSAFE_OWN_DATA_DESCRIPTOR}from"../../../internal/data-descriptors.js";const positions=new Set(["top-left","top-right","bottom-left","bottom-right"]);function runtimeRecord(input){try{return input!==null&&typeof input=="object"&&!Array.isArray(input)}catch{return!1}}function own(input,key){const descriptor=getOwnDataDescriptor(input,key);if(descriptor===UNSAFE_OWN_DATA_DESCRIPTOR)throw new TypeError("Unsafe control option");return descriptor===MISSING_OWN_DATA_DESCRIPTOR?void 0:descriptor.value}function optionalLegacy(input,key){try{return own(input,key)}catch{return}}function plain(input){if(!isPlainDataRecord(input))throw new TypeError("Expected plain control options");return input}function bool(input,key,fallback){const value=own(input,key);if(value===void 0)return fallback;if(typeof value!="boolean")throw new TypeError("Invalid boolean control option");return value}function number(input,key,fallback,maximum){const value=own(input,key);if(value===void 0)return fallback;if(typeof value!="number"||!Number.isFinite(value)||value<0||value>maximum)throw new RangeError("Invalid numeric control option");return value}function controlOrder(input){const value=own(input,"order");if(value===void 0)return 0;if(typeof value!="number"||!Number.isFinite(value))throw new TypeError("Invalid control order");return value}function position(input,fallback){const value=own(input,"position");if(value===void 0)return fallback;if(!positions.has(value))throw new TypeError("Invalid control position");return value}const escapeText=value=>value.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'");function attributionText(input){let total=0;const labels=[],text=value=>{if(typeof value!="string"||value.length>4096||(total+=value.length)>16384)throw new RangeError("Attribution text limit");return escapeText(value)},item=value=>{if(typeof value=="string"){const label2=text(value);return labels.push(label2),label2}const record=plain(value),label=text(own(record,"label")),raw=own(record,"url");if(typeof raw!="string"||raw.length>2048||/[\u0000-\u0020\u007f-\u009f]/.test(raw))throw new TypeError("Invalid attribution URL");const url=new URL(raw);if(url.protocol!=="http:"&&url.protocol!=="https:"||url.username||url.password||url.href.length>2048||(total+=url.href.length)>16384)throw new TypeError("Invalid attribution URL");const snapshot=Object.freeze({label,url:url.href});return labels.push(snapshot.label),`<a href="${escapeText(snapshot.url)}" target="_blank" rel="${resolveGuardedRel(void 0,"_blank")}">${snapshot.label}</a>`};let html;if(!Array.isArray(input))html=item(input);else{const length=own(input,"length");if(typeof length!="number"||!Number.isSafeInteger(length)||length<0||length>32)throw new RangeError("Attribution count limit");const result=[];for(let index=0;index<length;index++)result.push(item(own(input,String(index))));html=Object.freeze(result)}return Object.freeze({html,text:Object.freeze(labels)})}function normalizeMapControlOptions(input){const controls=new Map,diagnostics=[],done=()=>Object.freeze({controls,diagnostics:Object.freeze(diagnostics.map(item=>Object.freeze(item)))});if(!runtimeRecord(input))return done();for(const kind of["navigation","scale","geolocate","attribution"])try{const value=kind==="navigation"||kind==="scale"?optionalLegacy(input,kind):own(input,kind);if(value===void 0||value===!1)continue;if(kind==="navigation"||kind==="scale"){if(value!==!0&&!runtimeRecord(value))continue;const entry2=value===!0?{}:value,order2=controlOrder(entry2),fallback=kind==="navigation"?"top-right":"bottom-left",requested=optionalLegacy(entry2,"position"),corner2=positions.has(requested)?requested:fallback,unit=kind==="scale"?optionalLegacy(entry2,"unit")==="imperial"?"imperial":"metric":void 0;controls.set(kind,Object.freeze({kind,position:corner2,order:order2,unit,options:Object.freeze(kind==="scale"?{unit}:{}),key:`${corner2}:${order2}:${unit??""}`}));continue}const entry=value===!0?{}:plain(value),order=controlOrder(entry),corner=position(entry,kind==="geolocate"?"top-right":"bottom-right");let options,attributionLabels,initialExpanded;if(kind==="geolocate"){const rawPosition=own(entry,"positionOptions"),rawFit=own(entry,"fitBoundsOptions"),positionOptions=rawPosition===void 0?{}:plain(rawPosition),fit=rawFit===void 0?{}:plain(rawFit),showUserLocation=bool(entry,"showUserLocation",!0),showAccuracyCircle=bool(entry,"showAccuracyCircle",!0),zoomToUserAccuracy=own(entry,"zoomToUserAccuracy");if(zoomToUserAccuracy!==void 0&&typeof zoomToUserAccuracy!="boolean")throw new TypeError("Invalid zoom option");options=Object.freeze({trackUserLocation:bool(entry,"trackUserLocation",!1),showUserLocation,showAccuracyCircle:showUserLocation&&showAccuracyCircle,positionOptions:Object.freeze({enableHighAccuracy:bool(positionOptions,"enableHighAccuracy",!1),timeout:number(positionOptions,"timeout",6e3,864e5),maximumAge:number(positionOptions,"maximumAge",0,864e5)}),fitBoundsOptions:Object.freeze({maxZoom:number(fit,"maxZoom",15,24)}),...zoomToUserAccuracy===void 0?{}:{zoomToUserAccuracy}})}else{const compact=own(entry,"compact"),custom=own(entry,"customAttribution"),seed=own(entry,"initialExpanded");if(compact!==void 0&&typeof compact!="boolean")throw new TypeError("Invalid attribution mode");if(seed!==void 0&&typeof seed!="boolean")throw new TypeError("Invalid attribution expansion");initialExpanded=seed;const credits=custom===void 0?void 0:attributionText(custom);attributionLabels=credits?.text,options=Object.freeze({...compact===void 0?{}:{compact},...credits===void 0?{}:{customAttribution:credits.html}})}controls.set(kind,Object.freeze({kind,position:corner,order,unit:void 0,options,...attributionLabels?{attributionText:attributionLabels}:{},...initialExpanded===void 0?{}:{initialExpanded},key:`${corner}:${order}:${JSON.stringify(options)}${initialExpanded===void 0?"":`:${initialExpanded}`}`}))}catch{diagnostics.push({kind,code:"invalid-options"})}return done()}function mapGeolocationErrorCode(code){return code===1?"permission-denied":code===2?"position-unavailable":code===3?"timeout":"unknown"}export{mapGeolocationErrorCode,normalizeMapControlOptions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{deepActiveElementIn}from"../../../internal/active-element.js";import{mapGeolocationErrorCode}from"./map-control-options.js";function geolocatedPosition(event){try{if(event===null||typeof event!="object")return{};const coords=event.coords;if(coords===null||typeof coords!="object")return{};const{longitude,latitude,accuracy}=coords;return typeof longitude!="number"||typeof latitude!="number"||typeof accuracy!="number"||!Number.isFinite(longitude)||!Number.isFinite(latitude)||!Number.isFinite(accuracy)||Math.abs(longitude)>180||Math.abs(latitude)>90||accuracy<0?{}:{lngLat:Object.freeze([longitude,latitude]),accuracy}}catch{return{}}}class MapControlsLifecycle{constructor(load){this.load=load,this.generation=0,this.entries=new Map}async sync(map,desired,context){const generation=++this.generation,retired=[];for(const[kind,entry]of this.entries){const next=desired.get(kind);entry.map===map&&entry.installed&&next&&(next.key===entry.options.key||entry.root&&map.controlContainer&&JSON.stringify(next.options)===JSON.stringify(entry.options.options))?(entry.context=context,entry.options=next):(this.entries.delete(kind),retired.push(entry))}for(const entry of retired)this.retire(entry);if(generation!==this.generation||!this.validContext(context)||generation!==this.generation)return;const pending=[];for(const[kind,options]of desired){if(generation!==this.generation)break;if(this.entries.has(kind))continue;const entry={map,options,context,installed:!1,attempted:!1,adding:!1,subscribing:!1,removed:!1,retired:!1,subscriptions:[]};this.entries.set(kind,entry),pending.push(entry)}const loaded=await Promise.all(pending.map(async entry=>{try{return await this.load(entry.options.kind)}catch{return}}));if(generation!==this.generation||!this.validContext(context))return;const constructors=new Map(pending.map((entry,index)=>[entry,loaded[index]])),priority=["navigation","scale","geolocate","attribution"];for(const corner of["top-left","top-right","bottom-left","bottom-right"]){const ordered=priority.map(kind=>this.entries.get(kind)).filter(entry=>entry!==void 0&&entry.options.position===corner).sort((a,b)=>a.options.order-b.options.order),order=corner.startsWith("bottom")?ordered.reverse():ordered;for(const entry of order){if(generation!==this.generation||!this.validContext(context))return;constructors.has(entry)&&this.install(entry,constructors.get(entry))}}for(const corner of["top-left","top-right","bottom-left","bottom-right"]){if(generation!==this.generation||!this.validContext(context))return;const entries=priority.map(kind=>this.entries.get(kind)).filter(entry=>entry!==void 0&&entry.installed&&entry.options.position===corner).sort((a,b)=>a.options.order-b.options.order);for(let index=entries.length-1;index>=0;index--){const entry=entries[index];if(generation!==this.generation||!this.current(entry))return;try{const parent=map.controlContainer?.(corner);if(generation!==this.generation||!this.current(entry))return;if(!parent||!entry.root)continue;const before=entries.slice(index+1).find(next=>next.root?.parentNode===parent)?.root??null,root=entry.root;if(root.parentNode===parent&&(before?root.nextSibling===before:root.nextSibling===null))continue;const active=root.getRootNode().activeElement,focus=active instanceof HTMLElement&&root.contains(active)?active:void 0;if(generation!==this.generation||!this.current(entry))return;const document=root.ownerDocument;let focusTransferred=!1;const trackFocus=()=>{focusTransferred=!0};focus&&document.addEventListener("focus",trackFocus,!0);try{parent.insertBefore(root,before)}finally{focus&&document.removeEventListener("focus",trackFocus,!0)}if(generation!==this.generation||!this.current(entry))return;const remaining=deepActiveElementIn(document),lostFocus=remaining===null||remaining===document.body||remaining===document.documentElement;if(focus?.isConnected&&root.contains(focus)&&focus.ownerDocument===document&&!focusTransferred&&lostFocus&&focus.focus({preventScroll:!0}),generation!==this.generation||!this.current(entry))return}catch{if(generation===this.generation&&this.current(entry))try{entry.context.onFailure({kind:entry.options.kind,code:"control-failed"})}catch{}}}}}dispose(){this.generation+=1;const retired=[...this.entries.values()];this.entries.clear();for(const entry of retired)this.retire(entry)}validContext(context){try{return context.isCurrent()}catch{return!1}}current(entry){const owned=()=>!entry.retired&&this.entries.get(entry.options.kind)===entry;return owned()&&this.validContext(entry.context)&&owned()}install(entry,Constructor){try{if(!this.current(entry)){this.release(entry);return}if(typeof Constructor!="function")throw new Error("Map control is unavailable.");const control=new Constructor(entry.options.options);if(control===null||typeof control!="object"&&typeof control!="function")throw new Error("Map control is unavailable.");if(entry.control=control,!this.current(entry)){this.release(entry);return}if(entry.options.kind==="geolocate"){if(typeof entry.control.on!="function"||typeof entry.control.off!="function")throw new Error("Map control events are unavailable.");if(this.subscribe(entry,"error",event=>{if(!this.current(entry))return;let code;try{event!==null&&typeof event=="object"&&(code=event.code)}catch{}this.current(entry)&&entry.context.onEvent({kind:"geolocate-error",code:mapGeolocationErrorCode(code)})}),!this.current(entry)){this.release(entry);return}if(this.subscribe(entry,"outofmaxbounds",()=>{this.current(entry)&&entry.context.onEvent({kind:"geolocate-out-of-bounds",code:"out-of-bounds"})}),!this.current(entry)){this.release(entry);return}if(this.subscribe(entry,"geolocate",event=>{if(!this.current(entry))return;const position=geolocatedPosition(event);this.current(entry)&&entry.context.onEvent(Object.freeze({kind:"geolocate-success",...position}))}),!this.current(entry)){this.release(entry);return}}const onAdd=entry.control.onAdd;if(!this.current(entry)){this.release(entry);return}const descriptor=Object.getOwnPropertyDescriptor(entry.control,"onAdd");if(!this.current(entry)){this.release(entry);return}try{if(onAdd&&(entry.control.onAdd=function(...args){const root=onAdd.apply(this,args);return entry.root=root,root}),!this.current(entry)){this.release(entry);return}entry.attempted=!0,entry.adding=!0,entry.map.addControl(entry.control,entry.options.position)}finally{try{onAdd&&(descriptor?Object.defineProperty(entry.control,"onAdd",descriptor):delete entry.control.onAdd)}finally{entry.adding=!1,entry.retired&&this.retire(entry)}}if(!this.current(entry)){this.release(entry);return}entry.installed=!0}catch{const report=this.current(entry),generation=this.generation;if(this.release(entry),report&&generation===this.generation&&this.validContext(entry.context)&&generation===this.generation)try{entry.context.onFailure({kind:entry.options.kind,code:"control-failed"})}catch{}}}subscribe(entry,type,callback){entry.subscriptions.push({type,callback}),entry.subscribing=!0;try{entry.control.on(type,callback)}finally{entry.subscribing=!1,entry.retired&&this.retire(entry)}}release(entry){this.entries.get(entry.options.kind)===entry&&this.entries.delete(entry.options.kind),this.retire(entry)}retire(entry){if(entry.retired=!0,entry.subscribing)return;const subscriptions=entry.subscriptions.splice(0);for(const{type,callback}of subscriptions)try{entry.control?.off?.(type,callback)}catch{}if(!(!entry.attempted||entry.adding||entry.removed||!entry.control)){entry.removed=!0;try{entry.map.removeControl(entry.control)}catch{}}}}export{MapControlsLifecycle};
|
|
1
|
+
import{deepActiveElementIn}from"../../../internal/active-element.js";import{mapGeolocationErrorCode}from"./map-control-options.js";function geolocatedPosition(event){try{if(event===null||typeof event!="object")return{};const coords=event.coords;if(coords===null||typeof coords!="object")return{};const{longitude,latitude,accuracy}=coords;return typeof longitude!="number"||typeof latitude!="number"||typeof accuracy!="number"||!Number.isFinite(longitude)||!Number.isFinite(latitude)||!Number.isFinite(accuracy)||Math.abs(longitude)>180||Math.abs(latitude)>90||accuracy<0?{}:{lngLat:Object.freeze([longitude,latitude]),accuracy}}catch{return{}}}class MapControlsLifecycle{constructor(load){this.load=load,this.generation=0,this.entries=new Map}async sync(map,desired,context){const generation=++this.generation,retired=[];for(const[kind,entry]of this.entries){const next=desired.get(kind);entry.map===map&&entry.installed&&next&&(next.key===entry.options.key||entry.root&&map.controlContainer&&next.initialExpanded===entry.options.initialExpanded&&JSON.stringify(next.options)===JSON.stringify(entry.options.options))?(entry.context=context,entry.options=next):(this.entries.delete(kind),retired.push(entry))}for(const entry of retired)this.retire(entry);if(generation!==this.generation||!this.validContext(context)||generation!==this.generation)return;const pending=[];for(const[kind,options]of desired){if(generation!==this.generation)break;if(this.entries.has(kind))continue;const entry={map,options,context,installed:!1,attempted:!1,adding:!1,subscribing:!1,removed:!1,retired:!1,subscriptions:[]};this.entries.set(kind,entry),pending.push(entry)}const loaded=await Promise.all(pending.map(async entry=>{try{return await this.load(entry.options.kind)}catch{return}}));if(generation!==this.generation||!this.validContext(context))return;const constructors=new Map(pending.map((entry,index)=>[entry,loaded[index]])),priority=["navigation","scale","geolocate","attribution"];for(const corner of["top-left","top-right","bottom-left","bottom-right"]){const ordered=priority.map(kind=>this.entries.get(kind)).filter(entry=>entry!==void 0&&entry.options.position===corner).sort((a,b)=>a.options.order-b.options.order),order=corner.startsWith("bottom")?ordered.reverse():ordered;for(const entry of order){if(generation!==this.generation||!this.validContext(context))return;constructors.has(entry)&&this.install(entry,constructors.get(entry))}}for(const corner of["top-left","top-right","bottom-left","bottom-right"]){if(generation!==this.generation||!this.validContext(context))return;const entries=priority.map(kind=>this.entries.get(kind)).filter(entry=>entry!==void 0&&entry.installed&&entry.options.position===corner).sort((a,b)=>a.options.order-b.options.order);for(let index=entries.length-1;index>=0;index--){const entry=entries[index];if(generation!==this.generation||!this.current(entry))return;try{const parent=map.controlContainer?.(corner);if(generation!==this.generation||!this.current(entry))return;if(!parent||!entry.root)continue;const before=entries.slice(index+1).find(next=>next.root?.parentNode===parent)?.root??null,root=entry.root;if(root.parentNode===parent&&(before?root.nextSibling===before:root.nextSibling===null))continue;const active=root.getRootNode().activeElement,focus=active instanceof HTMLElement&&root.contains(active)?active:void 0;if(generation!==this.generation||!this.current(entry))return;const document=root.ownerDocument;let focusTransferred=!1;const trackFocus=()=>{focusTransferred=!0};focus&&document.addEventListener("focus",trackFocus,!0);try{parent.insertBefore(root,before)}finally{focus&&document.removeEventListener("focus",trackFocus,!0)}if(generation!==this.generation||!this.current(entry))return;const remaining=deepActiveElementIn(document),lostFocus=remaining===null||remaining===document.body||remaining===document.documentElement;if(focus?.isConnected&&root.contains(focus)&&focus.ownerDocument===document&&!focusTransferred&&lostFocus&&focus.focus({preventScroll:!0}),generation!==this.generation||!this.current(entry))return}catch{if(generation===this.generation&&this.current(entry))try{entry.context.onFailure({kind:entry.options.kind,code:"control-failed"})}catch{}}}}}pendingKinds(){return new Set([...this.entries].filter(([,entry])=>!entry.installed&&!entry.retired).map(([kind])=>kind))}ownedRoot(kind){const entry=this.entries.get(kind);return entry?.installed&&!entry.retired?entry.root:void 0}dispose(){this.generation+=1;const retired=[...this.entries.values()];this.entries.clear();for(const entry of retired)this.retire(entry)}validContext(context){try{return context.isCurrent()}catch{return!1}}current(entry){const owned=()=>!entry.retired&&this.entries.get(entry.options.kind)===entry;return owned()&&this.validContext(entry.context)&&owned()}install(entry,Constructor){try{if(!this.current(entry)){this.release(entry);return}if(typeof Constructor!="function")throw new Error("Map control is unavailable.");const control=new Constructor(entry.options.options);if(control===null||typeof control!="object"&&typeof control!="function")throw new Error("Map control is unavailable.");if(entry.control=control,!this.current(entry)){this.release(entry);return}if(entry.options.kind==="geolocate"){if(typeof entry.control.on!="function"||typeof entry.control.off!="function")throw new Error("Map control events are unavailable.");if(this.subscribe(entry,"error",event=>{if(!this.current(entry))return;let code;try{event!==null&&typeof event=="object"&&(code=event.code)}catch{}this.current(entry)&&entry.context.onEvent({kind:"geolocate-error",code:mapGeolocationErrorCode(code)})}),!this.current(entry)){this.release(entry);return}if(this.subscribe(entry,"outofmaxbounds",()=>{this.current(entry)&&entry.context.onEvent({kind:"geolocate-out-of-bounds",code:"out-of-bounds"})}),!this.current(entry)){this.release(entry);return}if(this.subscribe(entry,"geolocate",event=>{if(!this.current(entry))return;const position=geolocatedPosition(event);this.current(entry)&&entry.context.onEvent(Object.freeze({kind:"geolocate-success",...position}))}),!this.current(entry)){this.release(entry);return}}const onAdd=entry.control.onAdd;if(!this.current(entry)){this.release(entry);return}const descriptor=Object.getOwnPropertyDescriptor(entry.control,"onAdd");if(!this.current(entry)){this.release(entry);return}try{if(onAdd&&(entry.control.onAdd=function(...args){const root=onAdd.apply(this,args);return entry.root=root,root}),!this.current(entry)){this.release(entry);return}entry.attempted=!0,entry.adding=!0,entry.map.addControl(entry.control,entry.options.position)}finally{try{onAdd&&(descriptor?Object.defineProperty(entry.control,"onAdd",descriptor):delete entry.control.onAdd)}finally{entry.adding=!1,entry.retired&&this.retire(entry)}}if(!this.current(entry)){this.release(entry);return}const seed=entry.options.initialExpanded;if(entry.options.kind==="attribution"&&seed!==void 0&&entry.root?.classList.contains("maplibregl-compact")&&(entry.root.classList.toggle("maplibregl-compact-show",seed),entry.root.toggleAttribute("open",seed)),!this.current(entry)){this.release(entry);return}entry.installed=!0}catch{const report=this.current(entry),generation=this.generation;if(this.release(entry),report&&generation===this.generation&&this.validContext(entry.context)&&generation===this.generation)try{entry.context.onFailure({kind:entry.options.kind,code:"control-failed"})}catch{}}}subscribe(entry,type,callback){entry.subscriptions.push({type,callback}),entry.subscribing=!0;try{entry.control.on(type,callback)}finally{entry.subscribing=!1,entry.retired&&this.retire(entry)}}release(entry){this.entries.get(entry.options.kind)===entry&&this.entries.delete(entry.options.kind),this.retire(entry)}retire(entry){if(entry.retired=!0,entry.subscribing)return;const subscriptions=entry.subscriptions.splice(0);for(const{type,callback}of subscriptions)try{entry.control?.off?.(type,callback)}catch{}if(!(!entry.attempted||entry.adding||entry.removed||!entry.control)){entry.removed=!0;try{entry.map.removeControl(entry.control)}catch{}}}}export{MapControlsLifecycle};
|
|
@@ -409,6 +409,10 @@ readonly source:LyraMapMarkerActivationSource;}
|
|
|
409
409
|
* controls are disabled. The selected engine's control code loads only for enabled controls.
|
|
410
410
|
*/
|
|
411
411
|
export interface LyraMapGeolocateErrorDetail{readonly code:LyraMapGeolocationErrorCode;}export interface LyraMapGeolocateOutOfBoundsDetail{readonly code:'out-of-bounds';}
|
|
412
|
+
/** Detail of `lr-map-attribution-toggle`: the owned attribution control's settled credit visibility.*/
|
|
413
|
+
export interface LyraMapAttributionToggleDetail{
|
|
414
|
+
/** Whether the native credits are now shown.*/
|
|
415
|
+
readonly expanded:boolean;}
|
|
412
416
|
/** Detail of `lr-map-geolocate`: the position the user-activated geolocate control located.*/
|
|
413
417
|
export interface LyraMapGeolocateDetail{
|
|
414
418
|
/** `[longitude, latitude]` reported by the browser.*/
|
|
@@ -440,6 +444,10 @@ prepareFeatures?(requirements:LyraMapFeatureRequirements,options?:{signal?:Abort
|
|
|
440
444
|
setMaxBounds?(bounds?:unknown):unknown;}
|
|
441
445
|
/** A pan-constraining box, `[[west, south], [east, north]]`, in the order maplibre-gl takes.*/
|
|
442
446
|
export type LyraMapBounds=readonly[readonly[number,number],readonly[number,number]];
|
|
447
|
+
/** Options of `getVisibleBounds()`.*/
|
|
448
|
+
export interface LyraMapVisibleBoundsOptions{
|
|
449
|
+
/** `false` reads the whole viewport instead of the box inside `cameraPadding`. Defaults to `true`.*/
|
|
450
|
+
readonly padded?:boolean;}
|
|
443
451
|
/**
|
|
444
452
|
* Screen pixels kept clear on each side of a fitted box. The sides are the viewport's physical
|
|
445
453
|
* sides, because the map's projected space is physical in both text directions. An omitted side is
|
|
@@ -524,7 +532,9 @@ export interface LyraMapPointerDetail{
|
|
|
524
532
|
/** `[longitude, latitude]` under the pointer, longitude wrapped into `[-180, 180]`.*/
|
|
525
533
|
readonly lngLat:readonly[number,number];
|
|
526
534
|
/** The pointer position in the map's container, `[x, y]` CSS pixels (see `project()`).*/
|
|
527
|
-
readonly point:LyraMapPoint;}export interface LyraMapPickDetail extends LyraMapInteractionDetail{readonly trigger:'pointer'|'keyboard';}export interface LyraMapEventMap{'lr-map-anchor-close':CustomEvent<LyraMapAnchorCloseDetail>;'lr-map-draw-start':CustomEvent<LyraMapDrawingSnapshot>;'lr-map-draw-change':CustomEvent<LyraMapDrawingSnapshot>;'lr-map-draw-complete':CustomEvent<LyraMapDrawingSnapshot>;'lr-map-draw-cancel':CustomEvent<LyraMapDrawingCancelDetail>;'lr-map-draw-vertex-end':CustomEvent<LyraMapDrawingVertexEndDetail>;'lr-map-feature-enter':CustomEvent<LyraMapInteractionDetail>;'lr-map-feature-leave':CustomEvent<LyraMapInteractionDetail>;'lr-map-pointer-move':CustomEvent<LyraMapPointerDetail>;'lr-map-pointer-leave':CustomEvent<null>;'lr-map-contextmenu':CustomEvent<LyraMapInteractionDetail>;'lr-map-pick':CustomEvent<LyraMapPickDetail>;'lr-map-load':CustomEvent<null>;'lr-map-geolocate':CustomEvent<LyraMapGeolocateDetail>;'lr-map-geolocate-error':CustomEvent<LyraMapGeolocateErrorDetail>;'lr-map-geolocate-out-of-bounds':CustomEvent<LyraMapGeolocateOutOfBoundsDetail>;
|
|
535
|
+
readonly point:LyraMapPoint;}export interface LyraMapPickDetail extends LyraMapInteractionDetail{readonly trigger:'pointer'|'keyboard';}export interface LyraMapEventMap{'lr-map-anchor-close':CustomEvent<LyraMapAnchorCloseDetail>;'lr-map-draw-start':CustomEvent<LyraMapDrawingSnapshot>;'lr-map-draw-change':CustomEvent<LyraMapDrawingSnapshot>;'lr-map-draw-complete':CustomEvent<LyraMapDrawingSnapshot>;'lr-map-draw-cancel':CustomEvent<LyraMapDrawingCancelDetail>;'lr-map-draw-vertex-end':CustomEvent<LyraMapDrawingVertexEndDetail>;'lr-map-feature-enter':CustomEvent<LyraMapInteractionDetail>;'lr-map-feature-leave':CustomEvent<LyraMapInteractionDetail>;'lr-map-pointer-move':CustomEvent<LyraMapPointerDetail>;'lr-map-pointer-leave':CustomEvent<null>;'lr-map-contextmenu':CustomEvent<LyraMapInteractionDetail>;'lr-map-pick':CustomEvent<LyraMapPickDetail>;'lr-map-load':CustomEvent<null>;'lr-map-geolocate':CustomEvent<LyraMapGeolocateDetail>;'lr-map-geolocate-error':CustomEvent<LyraMapGeolocateErrorDetail>;'lr-map-geolocate-out-of-bounds':CustomEvent<LyraMapGeolocateOutOfBoundsDetail>;
|
|
536
|
+
/** Non-cancelable notification that the owned attribution disclosure changed after installation.*/
|
|
537
|
+
'lr-map-attribution-toggle':CustomEvent<LyraMapAttributionToggleDetail>;'lr-map-export-error':CustomEvent<LyraMapImageExportErrorDetail>;'lr-map-style-load':CustomEvent<LyraMapReadinessDetail>;'lr-map-idle':CustomEvent<LyraMapReadinessDetail>;'lr-map-marker-activate':CustomEvent<LyraMapMarkerActivationDetail>;
|
|
528
538
|
/** Cancelable proposal to change one legend category's visibility.*/
|
|
529
539
|
'lr-map-legend-toggle-request':CustomEvent<LyraMapLegendToggleDetail>;
|
|
530
540
|
/** Cancelable proposal to open or collapse the legend panel.*/
|
|
@@ -541,7 +551,9 @@ readonly sourceId:string|undefined;
|
|
|
541
551
|
readonly sourceLayer?:string;
|
|
542
552
|
/** `true` when the hit is a choropleth feature without a usable value and `choropleth.noData`
|
|
543
553
|
* is configured; absent otherwise. */
|
|
544
|
-
readonly noData?:true;
|
|
554
|
+
readonly noData?:true;
|
|
555
|
+
/** `'keyboard'` for a `keyboardActivation` at the view centre; absent for pointer clicks.*/
|
|
556
|
+
readonly trigger?:'keyboard';}>;}
|
|
545
557
|
/**
|
|
546
558
|
* `<lr-map>` — a modular MapLibre-compatible wrapper with a declarative legend, choropleth
|
|
547
559
|
* GeoJSON layer, markers, and additive `dataLayers` GeoJSON overlays
|
|
@@ -590,18 +602,28 @@ readonly noData?:true;}>;}
|
|
|
590
602
|
* @event lr-map-geolocate-out-of-bounds - `detail: { code: 'out-of-bounds' }`. A user-activated
|
|
591
603
|
* location lies outside maxBounds; no coordinates are exposed.
|
|
592
604
|
* @event lr-map-export-error - `detail: { code }` (`LyraMapImageExportErrorDetail`). Frozen sanitized export failure.
|
|
605
|
+
* @event lr-map-attribution-toggle - `detail: { expanded }` (`LyraMapAttributionToggleDetail`). Non-cancelable
|
|
606
|
+
* notification after the library-owned attribution control (including the default one) actually shows or
|
|
607
|
+
* hides its credits through native activation, resizing or dragging. Synchronous native changes are
|
|
608
|
+
* coalesced to their result and repeats are not reported. Installation, the `initialExpanded` seed,
|
|
609
|
+
* replacement and reconnect establish a silent baseline. Imperatively added controls are not reported.
|
|
593
610
|
* @csspart initialization-placeholder - Stable surface before native construction. It is
|
|
594
611
|
* noninteractive except for `initialization-activate`.
|
|
595
612
|
* @csspart initialization-activate - Localized button covering an `initialization="interaction"`
|
|
596
613
|
* placeholder until the first input builds the map.
|
|
597
|
-
* @csspart initialization-control - Decorative outline of a requested native control before construction
|
|
614
|
+
* @csspart initialization-control - Decorative outline of a requested native control before construction, kept
|
|
615
|
+
* after construction while that control's lazy code installs. Pending controls install in one pass, so their
|
|
616
|
+
* outlines clear together when it settles (installed or failed), on replacement or on disconnect. Outlines use
|
|
617
|
+
* the installed controls' glass or solid surface material.
|
|
618
|
+
* Unset controls, including the implicit attribution, and already installed retained controls have none.
|
|
598
619
|
* @csspart initialization-navigation - Decorative navigation control placeholder.
|
|
599
620
|
* @csspart initialization-scale - Decorative scale control placeholder.
|
|
600
621
|
* @csspart initialization-geolocate - Decorative geolocation control placeholder.
|
|
601
622
|
* @csspart initialization-attribution - Decorative attribution control placeholder.
|
|
602
623
|
* @csspart initialization-skeleton - Decorative map skeleton before construction.
|
|
603
624
|
* @csspart initialization-activate-label - Visible activation prompt; hiding it preserves the button's localized accessible name.
|
|
604
|
-
* @csspart initialization-controls - Decorative requested controls, also exposing controls.
|
|
625
|
+
* @csspart initialization-controls - Decorative requested controls, also exposing controls. After construction it
|
|
626
|
+
* remains only while requested controls are pending, `aria-hidden`, inert and without pointer events.
|
|
605
627
|
* @csspart initialization-corner - Decorative control corner, also exposing its controls-top-left, controls-top-right, controls-bottom-left or controls-bottom-right token.
|
|
606
628
|
* @event lr-map-style-load - `detail: { generation }` (`LyraMapReadinessDetail`). Fired once per
|
|
607
629
|
* connection/style after generated and registered overlays, images, style overrides and their
|
|
@@ -666,7 +688,8 @@ readonly noData?:true;}>;}
|
|
|
666
688
|
* properties; a `kind: 'heatmap'` layer is never hit-tested, because MapLibre returns no features
|
|
667
689
|
* for a density surface. A hit on a choropleth feature without a numeric `field` value reports
|
|
668
690
|
* `noData: true` when `choropleth.noData` is configured; the key is absent otherwise. A cluster
|
|
669
|
-
* hit also eases the camera into the cluster when its entry sets `cluster.zoomOnClick`.
|
|
691
|
+
* hit also eases the camera into the cluster when its entry sets `cluster.zoomOnClick`. A
|
|
692
|
+
* `keyboardActivation` at the view centre adds `trigger: 'keyboard'`; pointer clicks carry no `trigger`.
|
|
670
693
|
* @event lr-map-view-change - Fired once each time the camera settles after a user gesture (drag,
|
|
671
694
|
* wheel, touch, keyboard, box zoom or a standard peer navigation button), a `fitBounds()` or
|
|
672
695
|
* `fitToData()` call, or a `flyTo()`/`easeTo()`/`jumpTo()` call, carrying the immutable
|
|
@@ -915,7 +938,7 @@ hash:boolean|string;
|
|
|
915
938
|
* are preserved, and a fragment made only of named fields gets the camera prepended. `'unnamed'`
|
|
916
939
|
* takes `hash = true`; a string `hash` is invalid and shows the localized hash feedback. Two
|
|
917
940
|
* maps cannot own the unnamed token of one window, but one may own it beside named owners. */
|
|
918
|
-
hashFormat:LyraMapHashFormat;private get hashOption();private hashOwner?;private hashRuntimePending;private hashRuntimeFailed;private applyingHash;private hashIssue?;private controlIssue?;private pendingHashIssue?;private pendingControlIssue;private setControlIssue;private hashRequested;private hashRuntime;private featureLoads;private trackFeatureLoad;private syncHash;private applyHash;private writeHash;
|
|
941
|
+
hashFormat:LyraMapHashFormat;private get hashOption();private hashOwner?;private hashRuntimePending;private hashRuntimeFailed;private applyingHash;private hashIssue?;private controlIssue?;private pendingHashIssue?;private pendingControlIssue;private controlOutlines;private pendingControlOutlines;private setControlOutlines;private setControlIssue;private hashRequested;private hashRuntime;private featureLoads;private trackFeatureLoad;private syncHash;private applyHash;private writeHash;
|
|
919
942
|
/**
|
|
920
943
|
* Where the content slotted into `anchor` sits, `[longitude, latitude]`, or `null`/`undefined`
|
|
921
944
|
* for none. The slotted content (a feature's details, say) is placed above the point, flipped
|
|
@@ -1186,6 +1209,14 @@ engine:LyraMapEngine;private loading;private failure?;private readonly announcem
|
|
|
1186
1209
|
interactiveBasemapLayers:readonly LyraMapBasemapInteraction[];
|
|
1187
1210
|
/** Pick coordinates by clicking the map or using the localized center-pick button.*/
|
|
1188
1211
|
pickMode:boolean;
|
|
1212
|
+
/**
|
|
1213
|
+
* Opt-in keyboard activation: while the map canvas has focus, an unmodified Enter or Space
|
|
1214
|
+
* activates the interactive feature at the view centre (the camera centre, inside any
|
|
1215
|
+
* `cameraPadding`) exactly as a click there would, emitting `lr-map-click` with
|
|
1216
|
+
* `trigger: 'keyboard'`. Feature priority is the click's. Not active in pick mode, while drawing
|
|
1217
|
+
* is armed, or while the map is disabled or inert. Default `false` leaves both keys untouched.
|
|
1218
|
+
*/
|
|
1219
|
+
keyboardActivation:boolean;
|
|
1189
1220
|
/** Arms bounded line or polygon drawing. The first accepted vertex starts the session.
|
|
1190
1221
|
* Pick mode cancels drawing without automatic resumption. Completion/cancellation reset to none.
|
|
1191
1222
|
* Drawing preserves pan/zoom and temporarily owns double-click zoom. Maximum 512 vertices.
|
|
@@ -1337,7 +1368,15 @@ exportImage(options?:LyraMapImageExportOptions):Promise<Blob>;private imageExpor
|
|
|
1337
1368
|
closeAnchor():boolean;
|
|
1338
1369
|
/** Explicitly focuses the first eligible rendered anchor action. Returns false for a hidden,
|
|
1339
1370
|
* stale, inert or not-yet-placed anchor, or when no eligible target exists. Never queues focus. */
|
|
1340
|
-
focusAnchor():boolean;private anchorRuntime;private anchorPlacementRuntime;private anchorChildren;private syncAnchor;private scheduleAnchorSync;private onAnchorFocus;private onAnchorSlotChange;private onAnchorsSlotChange;private anchorMapHost;private anchorHost;private zoomIntoCluster;private clusterZoomToken;private applyCameraPadding;
|
|
1371
|
+
focusAnchor():boolean;private anchorRuntime;private anchorPlacementRuntime;private anchorChildren;private syncAnchor;private scheduleAnchorSync;private onAnchorFocus;private onAnchorSlotChange;private onAnchorsSlotChange;private anchorMapHost;private anchorHost;private zoomIntoCluster;private clusterZoomToken;private applyCameraPadding;
|
|
1372
|
+
/**
|
|
1373
|
+
* Synchronously reads the current visible box as frozen `[[west, south], [east, north]]`: by
|
|
1374
|
+
* default inside the applied `cameraPadding` (the box `lr-map-move` and `lr-map-view-change`
|
|
1375
|
+
* report), or the whole viewport with `{ padded: false }`. `west` is wrapped into [-180, 180]
|
|
1376
|
+
* and `east` keeps the span, so it can exceed 180 across the antimeridian; latitudes are clamped
|
|
1377
|
+
* to [-90, 90]. Returns `null` before the engine exists or when the peer cannot report a box.
|
|
1378
|
+
*/
|
|
1379
|
+
getVisibleBounds(options?:LyraMapVisibleBoundsOptions):LyraMapBounds|null;private readVisibleBounds;private scheduleMoveReport;private flushMoveReport;private cancelMoveReport;private reportMove;private applyFit;private applyPendingFit;private reflectCamera;private pushCamera;private writeCamera;connectedCallback():void;disconnectedCallback():void;private failureMessage;private failInitialization;private scheduleStyleRequiredFailure;private disposeMap;adoptedCallback():void;private tryConstructMap;private flushMapLoad;private beginStyleReadiness;requestUpdate(...args:Parameters<LyraElement['requestUpdate']>):void;private mapUpdateActive;protected performUpdate():void;protected updated(changed:PropertyValues):void;protected willUpdate(changed:PropertyValues):void;private paintThemeKey?;private paintThemeSources?;private paintThemeTokens;private syncPaintTheme;private readonly mapPaintBatch;private mapPaintBatchActive;private withMapPaintBatch;private removeMapLayer;private setMapPaint;private pendingDrawingTheme;private refreshThemePaint;private refreshThemePaintBatch;
|
|
1341
1380
|
/**
|
|
1342
1381
|
* Records bounded desired state for a currently restored, unambiguous logical source. `true`
|
|
1343
1382
|
* means admission, not a native paint acknowledgement; `whenIdle()` covers application and
|
|
@@ -1386,7 +1425,7 @@ undoDrawing():boolean;
|
|
|
1386
1425
|
completeDrawing():boolean;
|
|
1387
1426
|
/** Cancels an armed or started drawing and clears its temporary resources and mode. An armed
|
|
1388
1427
|
* mode whose drawing runtime is still loading is cancelled synchronously as well. */
|
|
1389
|
-
cancelDrawing():boolean;private cancelMapDrawing;private resetDrawingMode;private syncDrawing;private drawingRuntime;private drawingHost;private showDrawingError;private drawingErrorMessage;private drawMapCenter;private cancelMapPick;private pickMapCenter;private handleMapInteraction;private cancelFeaturePreparation;private generatedFeatureRequirements;private externalSourceEffects?;private externalLayerInput;private dataLayerOrderGroups;private nativeLayerOrder;private applyDataLayerOrder;private reconcileGeneratedLayers;private resolveStyleOverride;private appliedChoroplethPaintKey?;private applyChoropleth;private choroplethColorExpression;private choroplethNoDataColor;private choroplethOutlineExpression;private resolveChoroplethSourceId;private removeChoropleth;private readonly appliedLayerPaintKeys;private readonly appliedRowRanges;private applyDataLayers;private applyDataLayerRange;private applyDataLayerRendering;private paintDataLayer;private applyGeoLabel;private applyGeometryLayers;private paintGeometryLayers;private lineColor;private mutedPointOpacity;private paintPoints;private pointIconColor;private removePointIcons;private applyPointIcons;private paintPointIcons;private clusterColorExpression;private applyClusterLayers;private paintClusterLayers;private applyHeatmapLayer;private paintHeatmapLayer;private heatmapColorExpression;private styleHasTextFonts;private styleProvidesGlyphs;private resolveDataLayerSourceId;private removeDataLayer;private applyMarkers;private readonly configuredMarkerElements;private configureMarkerInteraction;private emitMarkerActivation;private get effectiveMapLabel();private popupId;private configurePopupSemantics;private stopObservingMapAllocation;private observeMapAllocation;private stopObservingPeerChrome;private peerControlsResizeObserver?;private peerControlsResizeFrame?;private schedulePeerControlInsets;private measurePeerControlInsets;private syncPeerChromeParts;private syncPeerAttributionExpansion;private observePeerChrome;private syncPopupSemantics;private syncMapSemantics;private formatDistance;private formatArea;private drawingSummary;private drawingLabelText;private formatCount;private legendLimitText;private onLegendSlotChange;
|
|
1428
|
+
cancelDrawing():boolean;private cancelMapDrawing;private resetDrawingMode;private syncDrawing;private drawingRuntime;private drawingHost;private showDrawingError;private drawingErrorMessage;private drawMapCenter;private cancelMapPick;private pickMapCenter;private activateMapCenter;private handleMapInteraction;private cancelFeaturePreparation;private generatedFeatureRequirements;private externalSourceEffects?;private externalLayerInput;private dataLayerOrderGroups;private nativeLayerOrder;private applyDataLayerOrder;private reconcileGeneratedLayers;private resolveStyleOverride;private appliedChoroplethPaintKey?;private applyChoropleth;private choroplethColorExpression;private choroplethNoDataColor;private choroplethOutlineExpression;private resolveChoroplethSourceId;private removeChoropleth;private readonly appliedLayerPaintKeys;private readonly appliedRowRanges;private applyDataLayers;private applyDataLayerRange;private applyDataLayerRendering;private paintDataLayer;private applyGeoLabel;private applyGeometryLayers;private paintGeometryLayers;private lineColor;private mutedPointOpacity;private paintPoints;private pointIconColor;private removePointIcons;private applyPointIcons;private paintPointIcons;private clusterColorExpression;private applyClusterLayers;private paintClusterLayers;private applyHeatmapLayer;private paintHeatmapLayer;private heatmapColorExpression;private styleHasTextFonts;private styleProvidesGlyphs;private resolveDataLayerSourceId;private removeDataLayer;private applyMarkers;private readonly configuredMarkerElements;private configureMarkerInteraction;private emitMarkerActivation;private get effectiveMapLabel();private popupId;private configurePopupSemantics;private stopObservingMapAllocation;private observeMapAllocation;private stopObservingPeerChrome;private peerControlsResizeObserver?;private peerControlsResizeFrame?;private schedulePeerControlInsets;private measurePeerControlInsets;private syncPeerChromeParts;private attributionState?;private syncAttributionState;private syncPeerAttributionExpansion;private observePeerChrome;private syncPopupSemantics;private syncMapSemantics;private formatDistance;private formatArea;private drawingSummary;private drawingLabelText;private formatCount;private legendLimitText;private onLegendSlotChange;
|
|
1390
1429
|
/**
|
|
1391
1430
|
* The continuous gradient bar plus its two endpoint captions, or nothing when `legendGradient`
|
|
1392
1431
|
* holds fewer than two usable stops. Part names mirror `lr-heatmap`'s
|