@longline/aqua-ui 1.0.46 → 1.0.47
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 +6 -1
- package/map/Map/Map.js +10 -3
- package/package.json +1 -1
package/map/Map/Map.d.ts
CHANGED
|
@@ -62,6 +62,11 @@ interface IProps {
|
|
|
62
62
|
* @default []
|
|
63
63
|
*/
|
|
64
64
|
interactiveLayerIDs?: string[];
|
|
65
|
+
/**
|
|
66
|
+
* If set, map cannot be rotated using dragging or touch gestures.
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
noRotate?: boolean;
|
|
65
70
|
/**
|
|
66
71
|
* Fired when map is loaded.
|
|
67
72
|
*/
|
|
@@ -72,5 +77,5 @@ interface IProps {
|
|
|
72
77
|
onClick?: (e: MapMouseEvent) => void;
|
|
73
78
|
}
|
|
74
79
|
declare const useViewState: () => ViewState;
|
|
75
|
-
declare const Map: ({ longitude, latitude, zoom, pitch, bearing, clipped, logoPosition, interactiveLayerIDs, minZoom, maxZoom, ...props }: IProps) => React.JSX.Element;
|
|
80
|
+
declare const Map: ({ longitude, latitude, zoom, pitch, bearing, clipped, logoPosition, interactiveLayerIDs, noRotate, minZoom, maxZoom, ...props }: IProps) => React.JSX.Element;
|
|
76
81
|
export { Map, useViewState };
|
package/map/Map/Map.js
CHANGED
|
@@ -201,8 +201,15 @@ var MapBase = function (props) {
|
|
|
201
201
|
};
|
|
202
202
|
}, []);
|
|
203
203
|
var handleLoad = function (e) {
|
|
204
|
+
var map = e.target;
|
|
205
|
+
if (props.noRotate) {
|
|
206
|
+
// disable map rotation using right click + drag
|
|
207
|
+
map.dragRotate.disable();
|
|
208
|
+
// disable map rotation using touch rotation gesture
|
|
209
|
+
map.touchZoomRotate.disableRotation();
|
|
210
|
+
}
|
|
204
211
|
if (props.onLoad)
|
|
205
|
-
props.onLoad(
|
|
212
|
+
props.onLoad(map);
|
|
206
213
|
};
|
|
207
214
|
var handleMove = function (e) {
|
|
208
215
|
setViewState(e.viewState);
|
|
@@ -218,8 +225,8 @@ var MapBase = function (props) {
|
|
|
218
225
|
};
|
|
219
226
|
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
227
|
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.interactiveLayerIDs, interactiveLayerIDs = _j === void 0 ? [] : _j, _k = _a.
|
|
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));
|
|
228
|
+
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.noRotate, noRotate = _k === void 0 ? false : _k, _l = _a.minZoom, minZoom = _l === void 0 ? 1 : _l, _m = _a.maxZoom, maxZoom = _m === void 0 ? 20 : _m, props = __rest(_a, ["longitude", "latitude", "zoom", "pitch", "bearing", "clipped", "logoPosition", "interactiveLayerIDs", "noRotate", "minZoom", "maxZoom"]);
|
|
229
|
+
return React.createElement(MapBase, __assign({ longitude: longitude, latitude: latitude, zoom: zoom, pitch: pitch, bearing: bearing, clipped: clipped, logoPosition: logoPosition, interactiveLayerIDs: interactiveLayerIDs, noRotate: noRotate, minZoom: minZoom, maxZoom: maxZoom }, props));
|
|
223
230
|
};
|
|
224
231
|
export { Map, useViewState };
|
|
225
232
|
var templateObject_1;
|