@longline/aqua-ui 1.0.39 → 1.0.42
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/map/Map/Map.d.ts +11 -2
- package/map/Map/Map.js +3 -3
- package/package.json +1 -1
package/map/Map/Map.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Map as OriginalMap } from 'mapbox-gl';
|
|
2
|
+
import { MapMouseEvent, Map as OriginalMap } from 'mapbox-gl';
|
|
3
3
|
import { ViewState } from 'react-map-gl';
|
|
4
4
|
interface IProps {
|
|
5
5
|
/** @ignore */
|
|
@@ -57,11 +57,20 @@ interface IProps {
|
|
|
57
57
|
* @default 20
|
|
58
58
|
*/
|
|
59
59
|
maxZoom?: number;
|
|
60
|
+
/**
|
|
61
|
+
* IDs of interactive layers.
|
|
62
|
+
* @default []
|
|
63
|
+
*/
|
|
64
|
+
interactiveLayerIDs?: string[];
|
|
60
65
|
/**
|
|
61
66
|
* Fired when map is loaded.
|
|
62
67
|
*/
|
|
63
68
|
onLoad?: (map: OriginalMap) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Fired when map is clicked.
|
|
71
|
+
*/
|
|
72
|
+
onClick?: (e: MapMouseEvent) => void;
|
|
64
73
|
}
|
|
65
74
|
declare const useViewState: () => ViewState;
|
|
66
|
-
declare const Map: ({ longitude, latitude, zoom, pitch, bearing, clipped, logoPosition, minZoom, maxZoom, ...props }: IProps) => React.JSX.Element;
|
|
75
|
+
declare const Map: ({ longitude, latitude, zoom, pitch, bearing, clipped, logoPosition, interactiveLayerIDs, minZoom, maxZoom, ...props }: IProps) => React.JSX.Element;
|
|
67
76
|
export { Map, useViewState };
|
package/map/Map/Map.js
CHANGED
|
@@ -207,7 +207,7 @@ var MapBase = function (props) {
|
|
|
207
207
|
var handleMove = function (e) {
|
|
208
208
|
setViewState(e.viewState);
|
|
209
209
|
};
|
|
210
|
-
return (React.createElement(GLMap, __assign({}, viewState, { mapboxAccessToken: props.token, style: { width: '100%', height: '100%', minHeight: '300px', font: theme.font.bodyMedium }, logoPosition: props.logoPosition, mapStyle: props.style, minZoom:
|
|
210
|
+
return (React.createElement(GLMap, __assign({}, viewState, { mapboxAccessToken: props.token, style: { width: '100%', height: '100%', minHeight: '300px', font: theme.font.bodyMedium }, logoPosition: props.logoPosition, mapStyle: props.style, minZoom: props.minZoom, maxZoom: props.maxZoom, interactiveLayerIds: props.interactiveLayerIDs, doubleClickZoom: true, onMove: handleMove, onLoad: handleLoad, onClick: props.onClick }),
|
|
211
211
|
props.clipped && React.createElement(React.Fragment, null,
|
|
212
212
|
React.createElement(Source, { type: "raster", tiles: ["https://api.mapbox.com/raster/v1/mapbox.mapbox-terrain-dem-v1/{z}/{x}/{y}.webp?access_token=".concat(props.token)] },
|
|
213
213
|
React.createElement(Layer, { id: "overlay", type: "raster" })),
|
|
@@ -218,8 +218,8 @@ var MapBase = function (props) {
|
|
|
218
218
|
};
|
|
219
219
|
var Controls = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n & > * {\n pointer-events: all;\n }\n\n ", ";\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n & > * {\n pointer-events: all;\n }\n\n ", ";\n"])), function (p) { return p.theme.font.bodyMedium; });
|
|
220
220
|
var Map = function (_a) {
|
|
221
|
-
var _b = _a.longitude, longitude = _b === void 0 ? -64.6 : _b, _c = _a.latitude, latitude = _c === void 0 ? 44.02 : _c, _d = _a.zoom, zoom = _d === void 0 ? 11 : _d, _e = _a.pitch, pitch = _e === void 0 ? 0 : _e, _f = _a.bearing, bearing = _f === void 0 ? 0 : _f, _g = _a.clipped, clipped = _g === void 0 ? false : _g, _h = _a.logoPosition, logoPosition = _h === void 0 ? 'top-right' : _h, _j = _a.
|
|
222
|
-
return React.createElement(MapBase, __assign({ longitude: longitude, latitude: latitude, zoom: zoom, pitch: pitch, bearing: bearing, clipped: clipped, logoPosition: logoPosition, minZoom: minZoom, maxZoom: maxZoom }, props));
|
|
221
|
+
var _b = _a.longitude, longitude = _b === void 0 ? -64.6 : _b, _c = _a.latitude, latitude = _c === void 0 ? 44.02 : _c, _d = _a.zoom, zoom = _d === void 0 ? 11 : _d, _e = _a.pitch, pitch = _e === void 0 ? 0 : _e, _f = _a.bearing, bearing = _f === void 0 ? 0 : _f, _g = _a.clipped, clipped = _g === void 0 ? false : _g, _h = _a.logoPosition, logoPosition = _h === void 0 ? 'top-right' : _h, _j = _a.interactiveLayerIDs, interactiveLayerIDs = _j === void 0 ? [] : _j, _k = _a.minZoom, minZoom = _k === void 0 ? 1 : _k, _l = _a.maxZoom, maxZoom = _l === void 0 ? 20 : _l, props = __rest(_a, ["longitude", "latitude", "zoom", "pitch", "bearing", "clipped", "logoPosition", "interactiveLayerIDs", "minZoom", "maxZoom"]);
|
|
222
|
+
return React.createElement(MapBase, __assign({ longitude: longitude, latitude: latitude, zoom: zoom, pitch: pitch, bearing: bearing, clipped: clipped, logoPosition: logoPosition, interactiveLayerIDs: interactiveLayerIDs, minZoom: minZoom, maxZoom: maxZoom }, props));
|
|
223
223
|
};
|
|
224
224
|
export { Map, useViewState };
|
|
225
225
|
var templateObject_1;
|