@tileflow/react 0.1.0-alpha.21 → 0.1.0-alpha.22
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 +9 -0
- package/dist/static.d.ts +1 -1
- package/dist/static.js +5 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -230,9 +230,13 @@ export function Preview() {
|
|
|
230
230
|
<StaticMap
|
|
231
231
|
map="madrid"
|
|
232
232
|
camera={{type: 'center', center: [-3.7038, 40.4168], zoom: 12}}
|
|
233
|
+
attribution={{mode: 'external'}}
|
|
233
234
|
size={{width: 1200, height: 800}}
|
|
234
235
|
createUrl="/api/static-maps"
|
|
235
236
|
idempotencyKey={idempotencyKey}
|
|
237
|
+
onReady={(result) => {
|
|
238
|
+
if (result.resultVersion === 2) showAttribution(result.attribution.entries);
|
|
239
|
+
}}
|
|
236
240
|
/>
|
|
237
241
|
);
|
|
238
242
|
}
|
|
@@ -243,6 +247,11 @@ reuse it across retries and remounts. Concurrent React consumers share work only
|
|
|
243
247
|
normalized scene, and idempotency key all identify the same operation; unmounting the final
|
|
244
248
|
consumer aborts its in-flight request.
|
|
245
249
|
|
|
250
|
+
`StaticMap` forwards `attribution` as part of the normalized scene and request identity. Omission
|
|
251
|
+
uses embedded automatic placement. With `mode: 'external'`, the component still renders the image,
|
|
252
|
+
but the application must render every structured `onReady` attribution entry beside it. Existing
|
|
253
|
+
`imageUrl` mode has no operation result and cannot infer attribution from an immutable image URL.
|
|
254
|
+
|
|
246
255
|
Hosted interactive maps automatically preflight a short-lived commercial session grant before
|
|
247
256
|
eligible resources. Setting `analytics={{enabled: false}}` disables the optional beacon only; it
|
|
248
257
|
does not remove hosted authorization or override a user `mapOptions.transformRequest` callback.
|
package/dist/static.d.ts
CHANGED
|
@@ -26,6 +26,6 @@ type StaticMapCreateProps = {
|
|
|
26
26
|
imageUrl?: never;
|
|
27
27
|
};
|
|
28
28
|
type StaticMapProps = StaticMapBaseProps & (StaticMapCreateProps | StaticMapImageProps);
|
|
29
|
-
declare function StaticMap({ alt, camera, className, captureId, createUrl, imageStyle, imageUrl, idempotencyKey, keepPreviousImage, loading, map, onError, onImageLoad, onReady, overlays, size, style, theme, }: StaticMapProps): react.JSX.Element;
|
|
29
|
+
declare function StaticMap({ alt, attribution, camera, className, captureId, createUrl, format, imageStyle, imageUrl, idempotencyKey, keepPreviousImage, loading, map, onError, onImageLoad, onReady, overlays, size, style, theme, }: StaticMapProps): react.JSX.Element;
|
|
30
30
|
|
|
31
31
|
export { StaticMap, type StaticMapProps };
|
package/dist/static.js
CHANGED
|
@@ -107,10 +107,12 @@ function abortReason(signal) {
|
|
|
107
107
|
import { jsx } from "react/jsx-runtime";
|
|
108
108
|
function StaticMap({
|
|
109
109
|
alt = "",
|
|
110
|
+
attribution,
|
|
110
111
|
camera,
|
|
111
112
|
className,
|
|
112
113
|
captureId,
|
|
113
114
|
createUrl,
|
|
115
|
+
format,
|
|
114
116
|
imageStyle,
|
|
115
117
|
imageUrl,
|
|
116
118
|
idempotencyKey,
|
|
@@ -135,10 +137,10 @@ function StaticMap({
|
|
|
135
137
|
const resolvedCaptureId = normalizeTileflowCaptureId(captureId);
|
|
136
138
|
const onErrorRef = useRef(onError);
|
|
137
139
|
const onReadyRef = useRef(onReady);
|
|
138
|
-
const sceneInputKey = stableStringify2({ camera, map, overlays, size, theme });
|
|
140
|
+
const sceneInputKey = stableStringify2({ attribution, camera, format, map, overlays, size, theme });
|
|
139
141
|
const preparedSceneCandidate = useMemo(
|
|
140
|
-
() => prepareSceneRequest({ camera, map, overlays, size, theme }),
|
|
141
|
-
[camera, map, overlays, size, theme]
|
|
142
|
+
() => prepareSceneRequest({ attribution, camera, format, map, overlays, size, theme }),
|
|
143
|
+
[attribution, camera, format, map, overlays, size, theme]
|
|
142
144
|
);
|
|
143
145
|
const preparedScene = useStablePreparedSceneRequest(preparedSceneCandidate);
|
|
144
146
|
const sceneKey = preparedScene.ok ? preparedScene.request.sceneKey : `invalid:${sceneInputKey}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tileflow/react",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.22",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "React components for rendering Tileflow maps with MapLibre.",
|
|
6
6
|
"type": "module",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@tileflow/core": ">=0.1.0-alpha.
|
|
49
|
+
"@tileflow/core": ">=0.1.0-alpha.23 <0.1.0-beta.0",
|
|
50
50
|
"@tileflow/interactions": ">=0.1.0-alpha.1 <0.1.0-beta.0",
|
|
51
|
-
"@tileflow/static": ">=0.1.0-alpha.
|
|
51
|
+
"@tileflow/static": ">=0.1.0-alpha.22 <0.1.0-beta.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"maplibre-gl": ">=5 <7",
|