@tileflow/react-native 0.0.0-bootstrap.0 → 0.1.0-alpha.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/README.md +216 -4
- package/TileflowNativeAdmission.podspec +34 -0
- package/android/build.gradle +43 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/dev/tileflow/reactnative/AdmissionBootstrap.kt +144 -0
- package/android/src/main/java/dev/tileflow/reactnative/AdmissionBootstrapOkHttpNetwork.kt +89 -0
- package/android/src/main/java/dev/tileflow/reactnative/AdmissionCatalog.kt +137 -0
- package/android/src/main/java/dev/tileflow/reactnative/AdmissionDocumentScope.kt +22 -0
- package/android/src/main/java/dev/tileflow/reactnative/AdmissionEngine.kt +335 -0
- package/android/src/main/java/dev/tileflow/reactnative/AdmissionModuleProvider.kt +68 -0
- package/android/src/main/java/dev/tileflow/reactnative/AdmissionOkHttpNetwork.kt +86 -0
- package/android/src/main/java/dev/tileflow/reactnative/AdmissionProviderLease.kt +56 -0
- package/android/src/main/java/dev/tileflow/reactnative/AdmissionTypes.kt +85 -0
- package/android/src/main/java/dev/tileflow/reactnative/AdmissionUrl.kt +100 -0
- package/android/src/main/java/dev/tileflow/reactnative/HandlerAdmissionScheduler.kt +16 -0
- package/android/src/main/java/dev/tileflow/reactnative/MobileConfiguration.kt +95 -0
- package/android/src/main/java/dev/tileflow/reactnative/MobileConfigurationResources.kt +43 -0
- package/android/src/main/java/dev/tileflow/reactnative/NativeDocumentOkHttpNetwork.kt +101 -0
- package/android/src/main/java/dev/tileflow/reactnative/NativeDocumentRegistry.kt +136 -0
- package/android/src/main/java/dev/tileflow/reactnative/NativeSurfaceState.kt +115 -0
- package/android/src/main/java/dev/tileflow/reactnative/TileflowNativeAdmissionModule.kt +234 -0
- package/android/src/main/java/dev/tileflow/reactnative/TileflowNativeAdmissionPackage.kt +16 -0
- package/android/src/main/java/dev/tileflow/reactnative/TileflowNativeConfigurationModule.kt +43 -0
- package/android/src/main/java/dev/tileflow/reactnative/TileflowNativeDocumentsModule.kt +80 -0
- package/android/src/main/java/dev/tileflow/reactnative/TileflowNativeSurfaceModule.kt +277 -0
- package/android/src/main/res/raw/tileflow_configuration_keep.xml +3 -0
- package/dist/contract-DWs-lDPo.d.ts +144 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +6989 -0
- package/dist/internal/camera.d.ts +65 -0
- package/dist/internal/camera.js +325 -0
- package/dist/internal/hosted-binding.d.ts +18 -0
- package/dist/internal/hosted-binding.js +277 -0
- package/dist/internal/initial-view.d.ts +11 -0
- package/dist/internal/initial-view.js +8 -0
- package/dist/internal/interactions.d.ts +76 -0
- package/dist/internal/interactions.js +794 -0
- package/dist/internal/native-admission-bridge.d.ts +29 -0
- package/dist/internal/native-admission-bridge.js +351 -0
- package/dist/internal/native-admission.d.ts +78 -0
- package/dist/internal/native-admission.js +1614 -0
- package/dist/internal/native-appearance.d.ts +21 -0
- package/dist/internal/native-appearance.js +110 -0
- package/dist/internal/native-configuration-bridge.d.ts +9 -0
- package/dist/internal/native-configuration-bridge.js +343 -0
- package/dist/internal/session.d.ts +125 -0
- package/dist/internal/session.js +887 -0
- package/dist/internal/source-state.d.ts +11 -0
- package/dist/internal/source-state.js +26 -0
- package/dist/native-admission-contract-k7LKE1vW.d.ts +89 -0
- package/docs/native-admission.md +108 -0
- package/docs/native-configuration.md +210 -0
- package/docs/native-interactions.md +161 -0
- package/docs/native-location.md +148 -0
- package/ios/TFAdmissionBootstrap.h +17 -0
- package/ios/TFAdmissionBootstrap.mm +168 -0
- package/ios/TFAdmissionCatalog.h +13 -0
- package/ios/TFAdmissionCatalog.mm +193 -0
- package/ios/TFAdmissionDocumentScope.h +7 -0
- package/ios/TFAdmissionDocumentScope.mm +45 -0
- package/ios/TFAdmissionEngine.h +57 -0
- package/ios/TFAdmissionEngine.mm +371 -0
- package/ios/TFAdmissionInstallation.h +27 -0
- package/ios/TFAdmissionInstallation.mm +117 -0
- package/ios/TFAdmissionNetwork.h +16 -0
- package/ios/TFAdmissionNetwork.mm +268 -0
- package/ios/TFAdmissionURL.mm +116 -0
- package/ios/TFDocumentBounds.h +9 -0
- package/ios/TFDocumentBounds.mm +19 -0
- package/ios/TFMobileConfiguration.h +23 -0
- package/ios/TFMobileConfiguration.mm +139 -0
- package/ios/TFNativeAdmissionURLProtocol.mm +69 -0
- package/ios/TFNativeDocumentRegistry.h +28 -0
- package/ios/TFNativeDocumentRegistry.mm +193 -0
- package/ios/TFNativeDocumentURL.h +6 -0
- package/ios/TFNativeSurfaceState.h +28 -0
- package/ios/TFNativeSurfaceState.mm +128 -0
- package/ios/TileflowNativeAdmission.h +9 -0
- package/ios/TileflowNativeAdmission.mm +184 -0
- package/ios/TileflowNativeConfiguration.mm +41 -0
- package/ios/TileflowNativeDocuments.h +12 -0
- package/ios/TileflowNativeDocuments.mm +105 -0
- package/ios/TileflowNativeSurface.mm +403 -0
- package/ios/tileflow_native_admission.rb +45 -0
- package/package.json +51 -7
- package/react-native.config.cjs +13 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TileflowNativeSourceState } from '@tileflow/core/native';
|
|
2
|
+
import { v as MapSourceState } from '../contract-DWs-lDPo.js';
|
|
3
|
+
import '@maplibre/maplibre-react-native';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'react-native';
|
|
6
|
+
import '@tileflow/interactions';
|
|
7
|
+
|
|
8
|
+
/** Read only a canonical Core snapshot; never expose its URLs, style body or Error instance. */
|
|
9
|
+
declare function projectMapSourceState(state: TileflowNativeSourceState | undefined): MapSourceState | undefined;
|
|
10
|
+
|
|
11
|
+
export { projectMapSourceState };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/source-state.ts
|
|
2
|
+
function projectMapSourceState(state) {
|
|
3
|
+
if (!state) return void 0;
|
|
4
|
+
if (state.status === "loading")
|
|
5
|
+
return Object.freeze({ status: "loading", generation: state.generation });
|
|
6
|
+
if (state.status === "error") {
|
|
7
|
+
return Object.freeze({
|
|
8
|
+
status: "error",
|
|
9
|
+
generation: state.generation,
|
|
10
|
+
error: Object.freeze({
|
|
11
|
+
code: state.error.code,
|
|
12
|
+
field: state.error.field,
|
|
13
|
+
kind: state.error.kind
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return Object.freeze({
|
|
18
|
+
status: "ready",
|
|
19
|
+
generation: state.generation,
|
|
20
|
+
map: state.map.name,
|
|
21
|
+
theme: Object.freeze({ name: state.theme.name, colorScheme: state.theme.colorScheme })
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
projectMapSourceState
|
|
26
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { NativeSessionResourceScope } from './internal/session.js';
|
|
2
|
+
|
|
3
|
+
type NativeAdmissionResource = Readonly<{
|
|
4
|
+
url: string;
|
|
5
|
+
scope: NativeSessionResourceScope;
|
|
6
|
+
tilesetId?: string;
|
|
7
|
+
template?: 'tile' | 'glyphs';
|
|
8
|
+
fontStacks?: readonly string[];
|
|
9
|
+
}>;
|
|
10
|
+
type NativeAdmissionCode = 'NATIVE_ADMISSION_INVALID' | 'NATIVE_ADMISSION_CANCELLED' | 'NATIVE_ADMISSION_EXPIRED' | 'NATIVE_ADMISSION_DENIED' | 'NATIVE_ADMISSION_OWNERSHIP' | 'NATIVE_ADMISSION_UNAVAILABLE';
|
|
11
|
+
type NativeAdmissionTicket = Readonly<{
|
|
12
|
+
ticket: string;
|
|
13
|
+
url: string;
|
|
14
|
+
}>;
|
|
15
|
+
type NativeAdmissionResult = Readonly<{
|
|
16
|
+
ticket: string;
|
|
17
|
+
kind: 'grant';
|
|
18
|
+
validForMs: number;
|
|
19
|
+
authority: Readonly<{
|
|
20
|
+
grant: string;
|
|
21
|
+
mapId: string;
|
|
22
|
+
resourceOrigins: readonly string[];
|
|
23
|
+
resourceScopes: readonly NativeSessionResourceScope[];
|
|
24
|
+
tilesetIds: readonly string[];
|
|
25
|
+
}>;
|
|
26
|
+
}> | Readonly<{
|
|
27
|
+
ticket: string;
|
|
28
|
+
kind: 'delegate';
|
|
29
|
+
}> | Readonly<{
|
|
30
|
+
ticket: string;
|
|
31
|
+
kind: 'reject';
|
|
32
|
+
code: NativeAdmissionCode;
|
|
33
|
+
}>;
|
|
34
|
+
type ContextEvent = Readonly<{
|
|
35
|
+
installation: string;
|
|
36
|
+
context: string;
|
|
37
|
+
generation: number;
|
|
38
|
+
}>;
|
|
39
|
+
type NativeAdmissionEvent = (ContextEvent & Readonly<{
|
|
40
|
+
kind: 'batch';
|
|
41
|
+
batch: string;
|
|
42
|
+
tickets: readonly NativeAdmissionTicket[];
|
|
43
|
+
}>) | (ContextEvent & Readonly<{
|
|
44
|
+
kind: 'cancel';
|
|
45
|
+
tickets: readonly string[];
|
|
46
|
+
}>) | (ContextEvent & Readonly<{
|
|
47
|
+
kind: 'retired';
|
|
48
|
+
code: NativeAdmissionCode;
|
|
49
|
+
}>) | (ContextEvent & Readonly<{
|
|
50
|
+
kind: 'response';
|
|
51
|
+
status: number;
|
|
52
|
+
}>) | Readonly<{
|
|
53
|
+
kind: 'lifecycle';
|
|
54
|
+
installation: string;
|
|
55
|
+
foreground: boolean;
|
|
56
|
+
}> | Readonly<{
|
|
57
|
+
kind: 'ownershipLost';
|
|
58
|
+
installation: string;
|
|
59
|
+
}>;
|
|
60
|
+
type NativeContextAck = Readonly<{
|
|
61
|
+
context: string;
|
|
62
|
+
generation: number;
|
|
63
|
+
}>;
|
|
64
|
+
type NativeRemovalAck = Readonly<{
|
|
65
|
+
removed: boolean;
|
|
66
|
+
ownershipLost: boolean;
|
|
67
|
+
}>;
|
|
68
|
+
type NativeAdmissionBridge = Readonly<{
|
|
69
|
+
subscribe(listener: (event: NativeAdmissionEvent) => void): () => void;
|
|
70
|
+
install(): Promise<Readonly<{
|
|
71
|
+
installation: string;
|
|
72
|
+
}>>;
|
|
73
|
+
registerContext(installation: string, registration: Readonly<{
|
|
74
|
+
mapId: string | null;
|
|
75
|
+
resources: readonly NativeAdmissionResource[];
|
|
76
|
+
}>): Promise<NativeContextAck>;
|
|
77
|
+
extendContext?(installation: string, context: string, resources: readonly NativeAdmissionResource[]): Promise<Readonly<{
|
|
78
|
+
resources: number;
|
|
79
|
+
}>>;
|
|
80
|
+
retireContext(installation: string, context: string): Promise<Readonly<{
|
|
81
|
+
retired: true;
|
|
82
|
+
}>>;
|
|
83
|
+
completeBatch(installation: string, context: string, generation: number, batch: string, results: readonly NativeAdmissionResult[]): Promise<Readonly<{
|
|
84
|
+
accepted: number;
|
|
85
|
+
}>>;
|
|
86
|
+
remove(installation: string): Promise<NativeRemovalAck>;
|
|
87
|
+
}>;
|
|
88
|
+
|
|
89
|
+
export type { NativeAdmissionEvent as N, NativeAdmissionResource as a, NativeContextAck as b, NativeAdmissionResult as c, NativeRemovalAck as d, NativeAdmissionCode as e, NativeAdmissionBridge as f };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Private native resource admission
|
|
2
|
+
|
|
3
|
+
This guide describes the private native networking boundary used by the mounted Tileflow `Map` in `@tileflow/react-native`. The transport, session controller, resource catalog, configuration reader and native bridge are **not a public API**. The package root exports the Tileflow `Map` and public Map types only; it does not export grants, credentials, session objects, admission handles, native renderer handles or request interception controls.
|
|
4
|
+
|
|
5
|
+
The mounted owner prepares a **bounded Style/TileJSON resource closure** before native rendering. It covers the current owned style document, one TileJSON edge per tile source, tile templates, sprite leaves, glyph templates, native-v1 managed font faces and supported base assets represented by the current contracts. It does not recursively trust arbitrary remote graphs. Ambiguous, unsafe, oversized or incomplete protected graphs fail closed, while foreign/unowned resources remain unchanged.
|
|
6
|
+
|
|
7
|
+
## Exact native dependencies
|
|
8
|
+
|
|
9
|
+
The source targets React 19.2.0, React Native 0.83.10, MapLibre React Native 11.3.10, MapLibre Native Android 13.2.0 and MapLibre Native iOS 6.26.0. Android's HTTP dependency is OkHttp 4.12.0. These pins and the existence of source tests are **not evidence** of a successful build, device run, Hosted service or app-store acceptance; qualify the exact revision in the intended host.
|
|
10
|
+
|
|
11
|
+
Android's library build uses the host's Android Gradle/Kotlin plugins and SDK settings. `react-native.config.cjs` autolinks `TileflowNativeAdmissionPackage`, which registers the private admission, document, configuration and surface modules. The library depends on the autolinked `:maplibre_maplibre-react-native` project and rejects conflicting MapLibre Native versions rather than selecting another version silently.
|
|
12
|
+
|
|
13
|
+
On iOS, the `TileflowNativeAdmission` pod depends on the exact React and MapLibre React Native pods. MapLibre Native itself is the existing pinned Swift Package Manager product, not a second MapLibre CocoaPod. Retain the host's React Native post-install work and MapLibre setup, then invoke:
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
$MLRN.post_install(installer)
|
|
17
|
+
tileflow_native_admission_post_install(installer)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The helper requires the MapLibre distribution reference with `exactVersion` 6.26.0 and reuses that product for the Tileflow pod/test targets. It does not add another SDK or change the pin.
|
|
21
|
+
|
|
22
|
+
## Installation ownership
|
|
23
|
+
|
|
24
|
+
Tileflow owns the MapLibre networking seam in explicit installation order. Android captures the previous `ModuleProvider`, wraps `createHttpRequest()` and delegates unowned traffic to the previous provider. iOS adds `TFNativeAdmissionURLProtocol` only to MapLibre's session configuration and uses an independent internal URLSession; it never registers an application-global protocol.
|
|
25
|
+
|
|
26
|
+
Installation/removal are acknowledged operations. Partial installation rolls back only state still owned by that attempt. A later incompatible provider/configuration replacement makes protected work fail closed; removal never overwrites a later owner. This is not a guarantee for arbitrary third-party mutation chains.
|
|
27
|
+
|
|
28
|
+
The process-level installation may be shared by mounted Maps, but that is the only shared ownership. Each real Map owns a distinct source generation, Hosted binding/session/controller, native context, catalog, queue, tickets and callbacks. One Map's retirement or cleanup failure cannot spend, remove or reuse another Map's authority.
|
|
29
|
+
|
|
30
|
+
## Mounted Map lifecycle
|
|
31
|
+
|
|
32
|
+
A native Map is created only after source resolution and context acknowledgement. If the resolved manifest uses Hosted session delivery, application configuration must first yield a binding whose canonical API origin exactly matches the manifest. Non-session delivery does not read the mobile credential or bootstrap Hosted authority.
|
|
33
|
+
|
|
34
|
+
Theme transactions keep the same native Map, context, session and camera. Resource additions are append-only and become usable only after native `extendContext` acknowledgement. Glyph templates may extend their finite font-stack allowlist across themes by an acknowledged union; the template URL, origin, class and scope cannot change. A logical source/Map replacement retires the previous context before opening the next one.
|
|
35
|
+
|
|
36
|
+
Retirement is idempotent and cancels queue, JavaScript wait, admitted work, document acquisition and late native completions. Removal acknowledgements are retryable. Strict Mode unmount/remount therefore cannot revive the old generation or share its context with the replacement.
|
|
37
|
+
|
|
38
|
+
## Resource identity and projection
|
|
39
|
+
|
|
40
|
+
Every protected resource is canonical HTTPS and belongs to one explicit class: `style`, `tilejson`, `tile`, `sprite`, `glyph` or `font`. Tile and TileJSON entries also preserve exact tileset identity. Tile templates use only the bounded native placeholder grammar. Glyph templates require both `{fontstack}` and `{range}` and a finite exact font-stack set.
|
|
41
|
+
|
|
42
|
+
Style preparation resolves relative URLs through Core's native URL policy. A style may discover at most one bounded TileJSON document for a declared tile source; TileJSON cannot recursively point to another TileJSON. Sprite base URLs are admitted through their concrete JSON/PNG 1x/2x leaves before the style receives its transient context discriminator. Native-v1 font-face arrays preserve family/style/weight attributes while only their admitted URL is rewritten.
|
|
43
|
+
|
|
44
|
+
Owned URLs must match the exact Hosted origin/path rules and the session policy's scope/tileset set. A resource on a foreign origin remains unmodified. An URL on an owned origin but outside a known resource path fails closed instead of inheriting authority merely because its origin matches.
|
|
45
|
+
|
|
46
|
+
The non-secret `__tf_native_context` discriminator selects one Map context. It is stripped before HTTP and never conveys authority. Unknown, malformed, stale, duplicate or retired reserved context values are rejected rather than delegated as third-party traffic. Other URL identity is preserved.
|
|
47
|
+
|
|
48
|
+
## Admission accounting
|
|
49
|
+
|
|
50
|
+
Every eligible protected request produces one logical controller `acquire()` result. A bounded bridge batch may carry several tickets but never shares one acquire, preallocates grants, counts chunks or maintains a native commercial counter. Direct/non-session contexts delegate without commercial acquisition.
|
|
51
|
+
|
|
52
|
+
The controller preserves the 10,000-request and six-hour rotation semantics: the 10,000th acquisition remains in its session and the next rotates. Bootstrap/refresh are single-flight where allowed. Native cancellation does not refund a logical acquisition already made. HTTP response observation does not confirm or undo server-owned commercial completion.
|
|
53
|
+
|
|
54
|
+
`X-Tileflow-Native-Grant` is the only protected-resource grant carrier. It is attached only after resource/context/session policy checks and never enters query strings, URLs, cache keys, public state, events, errors or logs.
|
|
55
|
+
|
|
56
|
+
## Independent bootstrap and expiry
|
|
57
|
+
|
|
58
|
+
Bootstrap uses an independent OkHttp client or ephemeral URLSession channel. It sends the bounded session-start POST to the configured canonical API origin and carries the publishable mobile credential only in `X-Tileflow-Mobile-Client`. Cookies, ambient credentials and automatic redirects are disabled.
|
|
59
|
+
|
|
60
|
+
Each context binds its validated bootstrap endpoint/credential. Retiring that context cancels its bootstrap without cancelling another Map. TypeScript alone parses session authority and makes admission decisions.
|
|
61
|
+
|
|
62
|
+
The controller's private transport budget remains anchored to its existing local `validUntil`. Native never reconstructs a fresh lifetime from server timestamps. The budget is bounded by the earlier ticket-enqueue time, the native wait deadline and a safety margin, and is rechecked immediately before network start and redirects. Backgrounding, clock rollback, source replacement, disposal and expiry invalidate stale authority.
|
|
63
|
+
|
|
64
|
+
No synchronous network hook, main thread or OkHttp interceptor waits for JavaScript. Suspended JavaScript therefore cannot authorize stale protected work.
|
|
65
|
+
|
|
66
|
+
## Redirects and observation
|
|
67
|
+
|
|
68
|
+
Protected redirects are handled by the adapter, not by automatic credential forwarding. Same-origin targets must still satisfy catalog, path/class, tileset, context and ticket validity. Cross-origin, different-port, uncataloged or conflicting-context targets receive no forwarded grant. A redirect does not consume another admission for the same ticket.
|
|
69
|
+
|
|
70
|
+
iOS does not rely on MapLibre forwarding `didReceiveResponse` to a configuration delegate. The adapter observes its own response. Native observation events contain only bounded identifiers/status and are private; they are not renderer readiness or commercial completion events.
|
|
71
|
+
|
|
72
|
+
## Renderer readiness
|
|
73
|
+
|
|
74
|
+
Admission success is not Map readiness. The private surface adapter requires current style acceptance, committed positive native layout and a fully rendered native map/frame after that layout. Background, layout loss, camera gesture/command epochs and style replacement invalidate the evidence. Resume re-arms native evidence; JavaScript animation frames and sleeps are not readiness proof.
|
|
75
|
+
|
|
76
|
+
Camera commands carry private monotonically correlated tokens. A successful public controller command is acknowledged only after the native target is applied, not merely queued by the upstream React Native bridge. User gestures are classified from native gesture reasons and remain separate from programmatic commands.
|
|
77
|
+
|
|
78
|
+
## Fixed transport bounds
|
|
79
|
+
|
|
80
|
+
| Boundary | Limit |
|
|
81
|
+
| -------------------------------------- | --------------------------------------------: |
|
|
82
|
+
| Live Map contexts per installation | 16 |
|
|
83
|
+
| Catalog resources per context | 128 |
|
|
84
|
+
| Native engine ingress per installation | 2,048 |
|
|
85
|
+
| Protected work per context | 128 |
|
|
86
|
+
| Tickets per bridge batch | 8 |
|
|
87
|
+
| Resource URL | 2,048 characters including discriminator room |
|
|
88
|
+
| Admission bridge payload | 524,288 bytes |
|
|
89
|
+
| Grant | 24,576 characters |
|
|
90
|
+
| Protected transport deadline | 30 seconds from enqueue |
|
|
91
|
+
| Validity safety margin | 1 second |
|
|
92
|
+
| Protected redirects | 3 |
|
|
93
|
+
| Protected response body | 8,388,608 bytes |
|
|
94
|
+
| Pending bootstrap bridge work | 32 |
|
|
95
|
+
| Bootstrap request / response | 2,048 / 65,536 bytes |
|
|
96
|
+
| Bootstrap deadline | 30 seconds |
|
|
97
|
+
|
|
98
|
+
Cancellation retains transport capacity until the corresponding native cleanup boundary. Capacity bounds are transport safety limits, not product quotas or billing counters.
|
|
99
|
+
|
|
100
|
+
## Application configuration
|
|
101
|
+
|
|
102
|
+
The publishable mobile application credential and trusted API origin are configured through native application configuration only. They are not component props or JavaScript globals. See [Native application configuration](./native-configuration.md) for exact iOS/Android keys, credential grammar, origin normalization, rotation/revocation and the end-user threat-model boundary.
|
|
103
|
+
|
|
104
|
+
## Local qualification
|
|
105
|
+
|
|
106
|
+
The source-checkout [mounted Map harness](../harness/README.md) uses the real public Tileflow component in an existing development host and is excluded from package exports/packed files. It creates no service, runner or deployment.
|
|
107
|
+
|
|
108
|
+
Before accepting a revision, qualify package build/types/tests, the exact Android and iOS native test suites, CocoaPods/SPM integration, two concurrent Maps, Strict Mode replay, source replacement during each asynchronous phase, theme success/rollback, controlled camera gestures/commands, background/resume, readiness ordering, redirects, ownership mutation and teardown retries. Inspect only secret-free fixture assertions and public events. Authored source and tests are not evidence that these checks passed.
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Native application configuration
|
|
2
|
+
|
|
3
|
+
This guide describes the private application-configuration reader used by the mounted Tileflow
|
|
4
|
+
`Map` in `@tileflow/react-native`. Its root exports the mounted `Map` and public types; the
|
|
5
|
+
configuration reader remains private. Mobile credentials remain application
|
|
6
|
+
configuration: there is no credential prop, JavaScript setter, provider, public configuration
|
|
7
|
+
object or public configuration subpath.
|
|
8
|
+
|
|
9
|
+
Importing `@tileflow/react-native` does not read configuration, install networking, start a session,
|
|
10
|
+
acquire admission or create a native Map. Configuration is read lazily only when a mounted source
|
|
11
|
+
resolves to Hosted session delivery. Follow the [package setup](../README.md) and the
|
|
12
|
+
[native admission guide](native-admission.md) for the exact native dependencies and installation
|
|
13
|
+
order. No Expo config plugin is supplied.
|
|
14
|
+
|
|
15
|
+
## Prerequisites and identity
|
|
16
|
+
|
|
17
|
+
Hosted native production requires a claimed Tileflow account/project, a Hosted Map and its scoped,
|
|
18
|
+
revocable, publishable mobile application credential. The credential authenticates the distributed
|
|
19
|
+
application, not an end user. There is no Tileflow end-user login, account provider or authentication
|
|
20
|
+
hook in this integration. Web deployment with allowed-domain authorization is a different mechanism.
|
|
21
|
+
A compatible SDK/API pair is required; this document is not a publication or availability claim.
|
|
22
|
+
|
|
23
|
+
Use only the publishable mobile credential, whose exact grammar is `tf_public_` followed by
|
|
24
|
+
48 lowercase hexadecimal characters, for a total of 58 ASCII characters. A CLI, deployment,
|
|
25
|
+
administration or other privileged credential must never enter application configuration.
|
|
26
|
+
|
|
27
|
+
The two logical fields are `apiOrigin` and `credential`. `apiOrigin` is the API origin approved by
|
|
28
|
+
the application operator, not a value copied automatically from a remote manifest. The native
|
|
29
|
+
session contract has no implicit origin. The examples below use `api.example.test` and an
|
|
30
|
+
intentionally invalid credential placeholder; replace both in the application build.
|
|
31
|
+
|
|
32
|
+
## Configure iOS
|
|
33
|
+
|
|
34
|
+
In the **application target's Info.plist**, add one `TileflowMobileConfiguration` key of type Array.
|
|
35
|
+
Its two String elements are `apiOrigin=...` and `credential=...`:
|
|
36
|
+
|
|
37
|
+
```xml
|
|
38
|
+
<key>TileflowMobileConfiguration</key>
|
|
39
|
+
<array>
|
|
40
|
+
<string>apiOrigin=https://api.example.test</string>
|
|
41
|
+
<string>credential=YOUR_PUBLISHABLE_MOBILE_CREDENTIAL</string>
|
|
42
|
+
</array>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Place this in the final application plist, not in a pod, framework, MapLibre configuration or
|
|
46
|
+
`InfoPlist.strings`. When Xcode generates the plist, ensure the resulting application target still
|
|
47
|
+
contains one literal array. Application-owned build substitution may supply each string, but
|
|
48
|
+
unresolved placeholders fail validation.
|
|
49
|
+
|
|
50
|
+
The autolinked `TileflowNativeConfiguration` module reads only `NSBundle.mainBundle` when its
|
|
51
|
+
private asynchronous reader is requested. It exports no constants or events. Constructing the
|
|
52
|
+
module, importing the package and mounting a non-session Map do not perform that read.
|
|
53
|
+
|
|
54
|
+
## Configure Android
|
|
55
|
+
|
|
56
|
+
In the application's `android/app/src/main/res/values/tileflow.xml`, add one literal String Array:
|
|
57
|
+
|
|
58
|
+
```xml
|
|
59
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
60
|
+
<resources>
|
|
61
|
+
<string-array name="tileflow_mobile_configuration" translatable="false">
|
|
62
|
+
<item>apiOrigin=https://api.example.test</item>
|
|
63
|
+
<item>credential=YOUR_PUBLISHABLE_MOBILE_CREDENTIAL</item>
|
|
64
|
+
</string-array>
|
|
65
|
+
</resources>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The array belongs to the application package. Do not use AndroidManifest metadata, BuildConfig,
|
|
69
|
+
a system property, an alias or a second runtime input. Both entries must be literal strings;
|
|
70
|
+
references such as `@string/...`, `@array/...`, theme attributes and styled strings are rejected.
|
|
71
|
+
Build flavors may deliberately provide their own single final application configuration, but each
|
|
72
|
+
resulting application must be checked independently.
|
|
73
|
+
|
|
74
|
+
`TileflowNativeAdmissionPackage` autolinks the configuration reader alongside the private admission
|
|
75
|
+
and surface modules. Constructing those modules does not read configuration or install networking.
|
|
76
|
+
The library includes a resource-shrinker keep declaration for the dynamically located array; the
|
|
77
|
+
application's optimized release build must retain it. The library ships no default configuration
|
|
78
|
+
array or embedded credential.
|
|
79
|
+
|
|
80
|
+
## Array and origin contract
|
|
81
|
+
|
|
82
|
+
Both platforms use the same bounded list of exactly two `key=value` strings. Order is irrelevant;
|
|
83
|
+
keys are case-sensitive. Split only at the first equals sign. Missing, empty, additional,
|
|
84
|
+
wrong-typed or duplicate entries fail closed. Each complete entry is limited to 2,080 UTF-16 code
|
|
85
|
+
units.
|
|
86
|
+
|
|
87
|
+
The application-owned `apiOrigin` is at most 2,048 UTF-16 code units. Normalization is deliberately
|
|
88
|
+
limited to the HTTPS scheme and ASCII hostname, omission of port 443 and removal of one optional
|
|
89
|
+
root slash. For example, application configuration `HTTPS://API.Example.test:443/` becomes
|
|
90
|
+
`https://api.example.test`. Port 8443 remains distinct. The grammar permits ASCII DNS labels or
|
|
91
|
+
canonical dotted-decimal IPv4; IPv6 literals are outside this application-configuration grammar.
|
|
92
|
+
|
|
93
|
+
Ports are decimal 1–65535 without leading zeroes. HTTP, user-info, non-root paths, query strings,
|
|
94
|
+
fragments, whitespace, backslashes, percent escapes, wildcards, trailing host dots, Unicode hostname
|
|
95
|
+
conversion and shortened/octal/hexadecimal/integer IPv4 forms are rejected.
|
|
96
|
+
|
|
97
|
+
The **remote manifest is not normalized into trust**. Its declared `apiUrl` must already be the exact
|
|
98
|
+
canonical string stored in the application snapshot. A trailing slash, explicit default port or
|
|
99
|
+
case variation in the remote declaration is rejected, even if normalizing it would produce the same
|
|
100
|
+
origin. Equality includes scheme, host and non-default port; there is no suffix or subdomain match.
|
|
101
|
+
If both root and map-level API declarations are present, they must agree exactly.
|
|
102
|
+
|
|
103
|
+
## Source-to-session boundary
|
|
104
|
+
|
|
105
|
+
Use the public Native manifest URL returned by an explicit compatible
|
|
106
|
+
[`deploy --with-native`](../../cli/docs/native-artifacts.md#publish-web-and-native-together):
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
https://api.example.test/maps/map_0123456789abcdef/native/manifest.json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The `Map` source remains `{map, manifestUrl}`. `map` is the authored map name, not the managed Map ID.
|
|
113
|
+
The initial document is bounded, one-map, version-1 public metadata. It contains theme names,
|
|
114
|
+
identity, revisions and references, not Style JSON or authority. It receives no credential or grant.
|
|
115
|
+
|
|
116
|
+
The private binding resolver consumes the current resolved Core source, not an executable config or
|
|
117
|
+
a renderer style. Only `map.usageMode === 'session'` can request application configuration. It
|
|
118
|
+
requires the declared Hosted `mapId`, exact `apiUrl`, agreement between the resolved logical map
|
|
119
|
+
name and selected source, and both the original requested URL and final response URL equal to the
|
|
120
|
+
canonical Hosted route for that managed Map. A redirect to another origin, Map, CDN route or query
|
|
121
|
+
alias is rejected. URL identity is a selector checked against the document, not authority.
|
|
122
|
+
|
|
123
|
+
A missing `usageMode` produces the existing direct binding without evaluating configuration only for
|
|
124
|
+
a non-Hosted source. A document obtained from the reserved Hosted Native route cannot omit that mode
|
|
125
|
+
to downgrade into direct delivery. Local, self-hosted and other non-session sources otherwise keep
|
|
126
|
+
their existing account-free behavior. Unknown modes, malformed session metadata, origin mismatches
|
|
127
|
+
or conflicting Map identity fail before a Hosted binding is delivered.
|
|
128
|
+
|
|
129
|
+
The publishable credential is sent **only** to the application's configured API origin at
|
|
130
|
+
`POST /v1/sessions/start`. The existing bootstrap transport does not follow redirects. Neither a
|
|
131
|
+
manifest URL nor a manifest-declared `apiUrl` can select a different credential destination. Styles,
|
|
132
|
+
TileJSON, tiles, sprites, glyphs and fonts use the existing resource grant, never that credential.
|
|
133
|
+
|
|
134
|
+
The resolver itself has no renderer or resource-admission authority. The mounted Map passes the
|
|
135
|
+
acknowledged binding into its private admission/session owner only after source resolution. Creating
|
|
136
|
+
a resolver does not call `acquire()`, and importing the package does not construct a resolver.
|
|
137
|
+
|
|
138
|
+
## Deployment revisions and stale discovery
|
|
139
|
+
|
|
140
|
+
Hosted themes carry mandatory revision hashes and versioned protected style URLs of the form
|
|
141
|
+
`/maps/<mapId>/native/v<deploymentVersion>/<theme>.json`. Every theme in one manifest belongs to the
|
|
142
|
+
same deployment version. The server checks current deployment ownership and verifies stored style
|
|
143
|
+
bytes against the revision. The mounted owner checks the returned style URL and its
|
|
144
|
+
Map/theme/deployment/revision metadata before projecting resources or creating a renderer.
|
|
145
|
+
|
|
146
|
+
If the root protected style cannot be read or fails this correspondence, the owner may discard its
|
|
147
|
+
cached discovery document and reload the canonical manifest **once per explicit source/theme
|
|
148
|
+
selection**. This recovery retains the same session and admission context. A refresh cannot switch
|
|
149
|
+
Map, origin or delivery mode, or move backwards to an older deployment. Child-resource failures do
|
|
150
|
+
not replenish that retry budget. A second failure uses the existing safe error or theme-rollback
|
|
151
|
+
path. It never composes a new active style with stale public metadata silently.
|
|
152
|
+
|
|
153
|
+
A public manifest GET, session start or Map render is not itself a commercial completion event.
|
|
154
|
+
Server completion remains conditional on an eligible protected GET returning 200/206 under the
|
|
155
|
+
existing admission contract. Disabled mobile delivery fails closed even for valid public references.
|
|
156
|
+
|
|
157
|
+
## Mounted ownership, caching and cancellation
|
|
158
|
+
|
|
159
|
+
The native reader caches one immutable application snapshot, or one safe failure, for the
|
|
160
|
+
application process. It does not retain a React context. JavaScript coalesces native reads and copies
|
|
161
|
+
the result into a frozen private value. Each mounted Map still owns an independent pending binding,
|
|
162
|
+
session controller, admission context, callbacks and renderer lifetime. Shared immutable application
|
|
163
|
+
configuration never implies shared grants, counters or source ownership.
|
|
164
|
+
|
|
165
|
+
Source replacement and Map disposal invalidate that owner's in-flight binding immediately. A late
|
|
166
|
+
configuration success or failure cannot deliver authority to a retired owner. Retiring one Map does
|
|
167
|
+
not cancel another Map's access to the process-level immutable configuration snapshot. Configuration
|
|
168
|
+
is not hot-reloaded; restart the application process after changing native values.
|
|
169
|
+
|
|
170
|
+
The configuration reader installs no timeout, timer, background poller or service. One unresolved
|
|
171
|
+
native read can remain pending, but every Map resolver remains independently disposable. Camera,
|
|
172
|
+
resource projection and rendered-readiness logic are owned elsewhere in the mounted Map runtime;
|
|
173
|
+
they are not configuration-reader responsibilities.
|
|
174
|
+
|
|
175
|
+
## Public credential threat model and rotation
|
|
176
|
+
|
|
177
|
+
A credential distributed inside a mobile application is extractable. Native configuration is not a
|
|
178
|
+
secret vault, proof of installation authenticity or end-user authentication. This version does not
|
|
179
|
+
authenticate with bundle ID, package name, signing identity or attestation. Origin binding prevents
|
|
180
|
+
the SDK from forwarding its configured credential to an origin selected by an untrusted manifest;
|
|
181
|
+
it does not stop a party that has copied the publishable credential from making its own requests.
|
|
182
|
+
Scope, revocation and server-side authorization remain necessary.
|
|
183
|
+
|
|
184
|
+
The credential crosses only the private reader/binding/bootstrap path. It is not a native grant and
|
|
185
|
+
is not a resource URL, cache key, public ref field, source state, renderer event or diagnostic.
|
|
186
|
+
Errors use fixed internal codes/messages rather than configured values or native causes. Do not log
|
|
187
|
+
native module responses, credentials, bootstrap bodies or grant material.
|
|
188
|
+
|
|
189
|
+
For rotation, issue a new credential with the intended Map scope, update the same native entries,
|
|
190
|
+
rebuild and distribute the application, then retire the old credential according to the rollout
|
|
191
|
+
policy. Revoking an old credential may stop installed versions that still contain it. Do not repair
|
|
192
|
+
that failure with a JavaScript override or a second credential source.
|
|
193
|
+
|
|
194
|
+
A future Expo plugin, if introduced, would write these same native values rather than create another
|
|
195
|
+
runtime configuration channel. No plugin or end-user login is part of this integration. Selection
|
|
196
|
+
presentation and foreground-location policy remain application-owned; this contract adds neither UI
|
|
197
|
+
nor a location API.
|
|
198
|
+
|
|
199
|
+
## Validation boundary
|
|
200
|
+
|
|
201
|
+
The authored source tests cover grammar, exact origin matching, source/final URL identity, lazy reads,
|
|
202
|
+
safe failures, stale results, bounded discovery recovery, independent resolvers and the absence of a
|
|
203
|
+
public credential surface. Native tests cover parser boundaries, versioned style ownership,
|
|
204
|
+
duplicate/wrong-typed configuration, resource literals, caching and reentrancy. Package tests protect
|
|
205
|
+
autolinking, exact peers, private configuration declarations and archive contents.
|
|
206
|
+
|
|
207
|
+
Those sources are not execution evidence. Local qualification must additionally exercise the final
|
|
208
|
+
iOS Info.plist and Android resource extraction, resource shrinking, bridge registration, cold starts,
|
|
209
|
+
concurrent mounted Maps, direct versus session sources, replacement/disposal, stale public metadata
|
|
210
|
+
and corrected/revoked credentials in the pinned native host.
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Native interaction contract
|
|
2
|
+
|
|
3
|
+
The React Native `Map` accepts portable annotations, semantic interaction bindings, activation
|
|
4
|
+
callbacks and an optional marker renderer. It exposes normalized targets and bounded data. The
|
|
5
|
+
application owns persistent selection and its presentation. Tileflow does not render a popup,
|
|
6
|
+
callout, tooltip, sheet, panel or modal.
|
|
7
|
+
|
|
8
|
+
The mounted implementation uses a private renderer-neutral foundation. It reuses schemas, target
|
|
9
|
+
types and diagnostics from the ordinary `@tileflow/interactions` root without
|
|
10
|
+
importing its browser adapter, DOM implementation or `maplibre-gl`. Native map handles, style
|
|
11
|
+
proofs, query ports and owners are not exported by `@tileflow/react-native`.
|
|
12
|
+
|
|
13
|
+
## Public Map inputs
|
|
14
|
+
|
|
15
|
+
`Map` is generic over the supplied annotation type, so application data remains typed in
|
|
16
|
+
`renderMarker` and `onInteractionEvent`. `annotations` and `interactions` are complete portable
|
|
17
|
+
documents, not patches. The shared annotation and binding validators still accept web presentation
|
|
18
|
+
metadata, but mobile does not use `popup` or `tooltip` fields.
|
|
19
|
+
|
|
20
|
+
`renderMarker` composes marker content only. Tileflow retains the native marker host, coordinate,
|
|
21
|
+
stable key, activation and authoritative accessibility wrapper. Without a renderer, Tileflow shows
|
|
22
|
+
a bounded default marker. Each marker has the annotation label, a 44-by-44-point minimum touch
|
|
23
|
+
target, button semantics and disabled accessibility state. Custom marker content does
|
|
24
|
+
not create another accessible target.
|
|
25
|
+
|
|
26
|
+
`onInteractionEvent` receives `target:activate` events for annotations and semantic POIs.
|
|
27
|
+
`onInteractionDiagnostic` receives fixed structured diagnostics. There is no mobile selection-state
|
|
28
|
+
prop, state callback or popup event. The application can retain the selected target in its own
|
|
29
|
+
state and choose what, if anything, to render.
|
|
30
|
+
|
|
31
|
+
## Input ownership and validation
|
|
32
|
+
|
|
33
|
+
One owner receives complete annotation and interaction-binding inputs. Omitted collections mean
|
|
34
|
+
empty collections, not partial document patches.
|
|
35
|
+
|
|
36
|
+
The owner uses the portable validators before planning any annotation changes. Invalid annotation
|
|
37
|
+
or binding replacements preserve the entire previous valid collection. The initial fallback is an
|
|
38
|
+
empty collection.
|
|
39
|
+
|
|
40
|
+
Inputs are copied and frozen before they become committed values. The portable JSON perimeter
|
|
41
|
+
rejects accessors, unsupported prototypes, non-finite numbers, unsafe keys, cycles, shared object
|
|
42
|
+
references and oversized documents. The native foundation uses the same portable bounds: at most
|
|
43
|
+
1,000 annotations, 100 bindings, 256,000 JSON bytes, depth 64, 20,000 nodes and 50,000 properties per
|
|
44
|
+
document. It does not expand large feature sets into annotation hosts.
|
|
45
|
+
|
|
46
|
+
Diagnostics retain the portable code, level and a fixed bounded message. They do not include raw
|
|
47
|
+
validator paths, input values, physical layer identifiers, style JSON, URLs or native error causes.
|
|
48
|
+
Replacing callbacks alone does not change snapshots or annotation identities.
|
|
49
|
+
|
|
50
|
+
## Annotation reconciliation
|
|
51
|
+
|
|
52
|
+
The private annotation plan contains `create`, `update`, `retain`, `remove` and final `order`.
|
|
53
|
+
Planning uses stable validated annotation IDs. An existing marker ID retains its future host when
|
|
54
|
+
coordinates, data or declarative surfaces change. Its update entry contains the old and new
|
|
55
|
+
validated definitions. New IDs create entries; absent IDs produce removals in previous order.
|
|
56
|
+
Unchanged IDs are retained, and final order follows the new document.
|
|
57
|
+
|
|
58
|
+
An invalid replacement produces no partial creates, updates or removals. The mounted adapter uses
|
|
59
|
+
the annotation ID as the React and native marker identity, so updates and reordering retain the
|
|
60
|
+
compatible host while removal retires it.
|
|
61
|
+
|
|
62
|
+
## Activation without selection ownership
|
|
63
|
+
|
|
64
|
+
A valid annotation activation emits one normalized `target:activate` event with annotation data,
|
|
65
|
+
coordinate and optional binding ID. A semantic POI activation emits the same event type with a
|
|
66
|
+
bounded POI target. No event changes or clears application selection. The application decides how
|
|
67
|
+
to handle removed entities, style changes and dismissal.
|
|
68
|
+
|
|
69
|
+
A syntactically invalid annotation or binding replacement retains the last valid collection. New
|
|
70
|
+
touches, source/style replacement, backgrounding and unmount discard pending semantic queries, so
|
|
71
|
+
late results cannot activate a target from a retired map or style.
|
|
72
|
+
|
|
73
|
+
## Finalized-style query port
|
|
74
|
+
|
|
75
|
+
The semantic adapter receives a private lease for exactly one finalized style on one native Map.
|
|
76
|
+
The lease supplies its style description, an ownership check and a cancelable asynchronous query
|
|
77
|
+
operation. Its ownership check must establish the exact current native style and map, not merely
|
|
78
|
+
compare style JSON. Style replacement must invalidate the old lease before another query can use
|
|
79
|
+
it.
|
|
80
|
+
|
|
81
|
+
Each query receives an immutable request containing the touch point, the relevant declared layer
|
|
82
|
+
IDs and a result limit. A result envelope must echo the identical private request object. The
|
|
83
|
+
platform adapter may construct that envelope only after rechecking native map/style ownership.
|
|
84
|
+
Native handles never cross this neutral boundary. The adapter rejects a response associated with
|
|
85
|
+
another request or Map even when the physical URLs or layer names happen to match.
|
|
86
|
+
|
|
87
|
+
The mounted adapter uses the existing public query on the pinned MapLibre React Native Map. Because
|
|
88
|
+
its iOS and Android serializers omit physical provenance, Tileflow queries one verified semantic
|
|
89
|
+
layer at a time in finalized topmost order. The exact single-layer filter supplies the physical
|
|
90
|
+
layer, source and source-layer identity that the neutral adapter verifies again. Results preserve
|
|
91
|
+
their within-layer order and share one global 512-feature bound. This adds no Swift, Kotlin or
|
|
92
|
+
public query API.
|
|
93
|
+
|
|
94
|
+
A lease becomes current only after the private Tileflow native-surface owner accepts the matching
|
|
95
|
+
style token. A JavaScript style-loaded callback or equal style JSON is insufficient. A newer touch
|
|
96
|
+
rotates the query lease; style or source replacement, backgrounding and unmount permanently retire
|
|
97
|
+
the old proof. Upstream queries have no abort handle, so cancellation is logical: Tileflow settles
|
|
98
|
+
the old operation as stale immediately, stops issuing further layer queries and ignores late
|
|
99
|
+
results.
|
|
100
|
+
|
|
101
|
+
## Semantic POI rules
|
|
102
|
+
|
|
103
|
+
Only finalized `tileflow:interaction-manifest` metadata with exact version 2 is accepted. The
|
|
104
|
+
adapter checks the POI identity convention, deduplication tuple, representation-priority list,
|
|
105
|
+
field mapping, category vocabulary, rendered-topmost ordering and pointer-coordinate anchors.
|
|
106
|
+
The artifact's `animation-frame` frequency field is its existing version-2 vocabulary; it does not
|
|
107
|
+
introduce hover or JavaScript-frame scheduling into the native adapter.
|
|
108
|
+
|
|
109
|
+
Every declared semantic layer must exist exactly once in that same style and match its declared
|
|
110
|
+
source and source-layer. The source must exist. All declared POI representations share one
|
|
111
|
+
source/source-layer feature-ID namespace. The adapter bounds the physical style inventory at 4,096
|
|
112
|
+
layers and the semantic inventory at 256 declared layers. Missing or inconsistent metadata fails
|
|
113
|
+
closed with `SEMANTIC_MANIFEST_MISMATCH`.
|
|
114
|
+
|
|
115
|
+
Queries include only declared layers relevant to the current POI bindings and category filters.
|
|
116
|
+
The port must supply rendered-topmost results. Duplicate representations of one stable feature ID
|
|
117
|
+
use the manifest's representation priority, then layer priority, while retaining the earliest
|
|
118
|
+
rendered position of that identity. Numeric and string IDs are distinct. Features from undeclared
|
|
119
|
+
layers are excluded; an owned feature with a mismatched source or source-layer invalidates the
|
|
120
|
+
query rather than being relabeled.
|
|
121
|
+
|
|
122
|
+
A query processes at most 512 returned features. The port must report overflow rather than silently
|
|
123
|
+
truncate a result whose omitted features could change representation selection. The native
|
|
124
|
+
boundary emits only the existing semantic POI target shape, without physical layer identities.
|
|
125
|
+
Properties are restricted to category, filter rank, size rank, icon, name and type. Category and
|
|
126
|
+
rank ranges follow the portable contract; icon/type use bounded snake-case values and text uses the
|
|
127
|
+
portable 4,096-character limit. Unknown fields and unsafe property accessors are not forwarded.
|
|
128
|
+
|
|
129
|
+
Touch is the only activation modality in this adapter. There is no inferred hover, tooltip,
|
|
130
|
+
long-press or keyboard behavior. An activation without a stable feature ID can still emit a target
|
|
131
|
+
event. When present, feature IDs are safe integers or nonempty strings of at most 128 characters;
|
|
132
|
+
no property-based fallback ID is invented.
|
|
133
|
+
|
|
134
|
+
## Retirement and observation
|
|
135
|
+
|
|
136
|
+
Each mounted Map has independent inputs, annotation plans, style proofs,
|
|
137
|
+
query tickets and subscribers. No authority, Map identity or asynchronous operation is shared
|
|
138
|
+
between Maps. Marker and map delivery for one touch share one claim, so a marker activation cannot
|
|
139
|
+
also activate a semantic feature underneath it.
|
|
140
|
+
|
|
141
|
+
Ownership is checked again after asynchronous results and before event publication. Late results
|
|
142
|
+
from disposed owners or retired styles are inert. Reentrant cancellation, observer replacement,
|
|
143
|
+
exceptions and rejected observer promises cannot transfer ownership to another Map. Disposal is
|
|
144
|
+
idempotent and exposes a final safe empty snapshot plus the annotation removal plan.
|
|
145
|
+
|
|
146
|
+
Selection presentation remains outside this contract. The application owns its layout, focus,
|
|
147
|
+
dismissal and accessibility behavior. Device location is also separate and requires an explicit
|
|
148
|
+
application-owned permission and provider flow.
|
|
149
|
+
|
|
150
|
+
## Location composes as an ordinary application annotation
|
|
151
|
+
|
|
152
|
+
Foreground device location does not extend the interaction owner or semantic query port. An
|
|
153
|
+
application that chooses to display its latest validated fix can provide one stable-ID annotation
|
|
154
|
+
through the existing `annotations` input, and remove that annotation when permission is revoked or
|
|
155
|
+
the provider becomes unavailable. Tileflow does not request permission, start observation or
|
|
156
|
+
recenter the camera when that annotation changes.
|
|
157
|
+
|
|
158
|
+
See [Application-owned foreground location](./native-location.md) for the source-checkout recipe.
|
|
159
|
+
The application remains responsible for provider lifetime, privacy policy, recenter controls and
|
|
160
|
+
status/error UI, and the recipe does not alter the rule that all selection presentation remains
|
|
161
|
+
application-owned.
|