Skip to content

Commit 5da329a

Browse files
[Maps] Isolate mapbox-gl types and align downstream package versions. (#100610)
1 parent aa32903 commit 5da329a

43 files changed

Lines changed: 132 additions & 185 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@
158158
"@loaders.gl/core": "^2.3.1",
159159
"@loaders.gl/json": "^2.3.1",
160160
"@mapbox/geojson-rewind": "^0.5.0",
161-
"@mapbox/mapbox-gl-draw": "^1.2.0",
162-
"@mapbox/mapbox-gl-rtl-text": "^0.2.3",
161+
"@mapbox/mapbox-gl-draw": "1.3.0",
162+
"@mapbox/mapbox-gl-rtl-text": "0.2.3",
163163
"@mapbox/vector-tile": "1.3.1",
164164
"@scant/router": "^0.1.1",
165165
"@slack/webhook": "^5.0.4",
@@ -285,7 +285,7 @@
285285
"lru-cache": "^4.1.5",
286286
"lz-string": "^1.4.4",
287287
"mapbox-gl": "1.13.1",
288-
"mapbox-gl-draw-rectangle-mode": "^1.0.4",
288+
"mapbox-gl-draw-rectangle-mode": "1.0.4",
289289
"markdown-it": "^10.0.0",
290290
"md5": "^2.1.0",
291291
"memoize-one": "^5.0.0",
@@ -562,7 +562,7 @@
562562
"@types/loader-utils": "^1.1.3",
563563
"@types/lodash": "^4.14.159",
564564
"@types/lru-cache": "^5.1.0",
565-
"@types/mapbox-gl": "^1.9.1",
565+
"@types/mapbox-gl": "1.13.1",
566566
"@types/markdown-it": "^0.0.7",
567567
"@types/md5": "^2.2.0",
568568
"@types/memoize-one": "^4.1.0",

packages/kbn-mapbox-gl/src/index.ts

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@
77
*/
88

99
import './typings';
10+
import type {
11+
Map,
12+
GeoJSONSource,
13+
VectorSource,
14+
Layer,
15+
AnyLayer,
16+
FeatureIdentifier,
17+
Style,
18+
MapboxOptions,
19+
MapMouseEvent,
20+
MapSourceDataEvent,
21+
LngLat,
22+
LngLatBounds,
23+
PointLike,
24+
MapboxGeoJSONFeature,
25+
Point,
26+
CustomLayerInterface,
27+
} from 'mapbox-gl';
1028
import mapboxgl from 'mapbox-gl/dist/mapbox-gl-csp';
1129
// @ts-expect-error
1230
import mbRtlPlugin from '!!file-loader!@mapbox/mapbox-gl-rtl-text/mapbox-gl-rtl-text.min.js';
@@ -17,4 +35,22 @@ import 'mapbox-gl/dist/mapbox-gl.css';
1735
mapboxgl.workerUrl = mbWorkerUrl;
1836
mapboxgl.setRTLTextPlugin(mbRtlPlugin);
1937

20-
export { mapboxgl };
38+
export {
39+
mapboxgl,
40+
Map,
41+
GeoJSONSource,
42+
VectorSource,
43+
Layer,
44+
AnyLayer,
45+
FeatureIdentifier,
46+
Style,
47+
MapboxOptions,
48+
MapMouseEvent,
49+
MapSourceDataEvent,
50+
LngLat,
51+
LngLatBounds,
52+
PointLike,
53+
MapboxGeoJSONFeature,
54+
Point,
55+
CustomLayerInterface,
56+
};

src/plugins/vis_type_vega/public/vega_view/vega_map_view/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Side Public License, v 1.
77
*/
88

9-
import type { Style } from 'mapbox-gl';
9+
import type { Style } from '@kbn/mapbox-gl';
1010
import { TMS_IN_YML_ID } from '../../../../maps_ems/public';
1111

1212
export const vegaLayerId = 'vega';

src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Side Public License, v 1.
77
*/
88

9-
import type { Map } from 'mapbox-gl';
9+
import type { Map } from '@kbn/mapbox-gl';
1010

1111
export interface LayerParameters<TContext extends Record<string, any> = {}> {
1212
id: string;

src/plugins/vis_type_vega/public/vega_view/vega_map_view/layers/vega_layer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Side Public License, v 1.
77
*/
88

9-
import type { Map, CustomLayerInterface } from 'mapbox-gl';
9+
import type { Map, CustomLayerInterface } from '@kbn/mapbox-gl';
1010
import type { View } from 'vega';
1111
import type { LayerParameters } from './types';
1212

src/plugins/vis_type_vega/public/vega_view/vega_map_view/view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import { i18n } from '@kbn/i18n';
10-
import type { Map, Style, MapboxOptions } from 'mapbox-gl';
10+
import type { Map, Style, MapboxOptions } from '@kbn/mapbox-gl';
1111

1212
import { View, parse } from 'vega';
1313

x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77

8-
import { Map as MbMap, GeoJSONSource as MbGeoJSONSource } from 'mapbox-gl';
8+
import type { Map as MbMap, GeoJSONSource as MbGeoJSONSource } from '@kbn/mapbox-gl';
99
import { FeatureCollection } from 'geojson';
1010
import { AbstractLayer } from '../layer';
1111
import { HeatmapStyle } from '../../styles/heatmap/heatmap_style';

x-pack/plugins/maps/public/classes/layers/layer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
/* eslint-disable @typescript-eslint/consistent-type-definitions */
99

10-
import { Map as MbMap } from 'mapbox-gl';
10+
import type { Map as MbMap } from '@kbn/mapbox-gl';
1111
import { Query } from 'src/plugins/data/public';
1212
import _ from 'lodash';
1313
import React, { ReactElement, ReactNode } from 'react';

x-pack/plugins/maps/public/classes/layers/tiled_vector_layer/tiled_vector_layer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
*/
77

88
import React from 'react';
9-
import {
9+
import type {
1010
Map as MbMap,
1111
GeoJSONSource as MbGeoJSONSource,
1212
VectorSource as MbVectorSource,
13-
} from 'mapbox-gl';
13+
} from '@kbn/mapbox-gl';
1414
import { EuiIcon } from '@elastic/eui';
1515
import { Feature } from 'geojson';
1616
import uuid from 'uuid/v4';

x-pack/plugins/maps/public/classes/layers/vector_layer/utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import { FeatureCollection } from 'geojson';
9-
import { Map as MbMap } from 'mapbox-gl';
9+
import type { Map as MbMap } from '@kbn/mapbox-gl';
1010
import {
1111
EMPTY_FEATURE_COLLECTION,
1212
SOURCE_BOUNDS_DATA_REQUEST_ID,

0 commit comments

Comments
 (0)