Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

chore: fix tests (#3403)

Igor Dykhtaa9ca4a80c327
diff --git a/src/components/src/kepler-gl.tsx b/src/components/src/kepler-gl.tsx
index ed44f9065..d5606613e 100644
--- a/src/components/src/kepler-gl.tsx
+++ b/src/components/src/kepler-gl.tsx
@@ -196,7 +196,9 @@ export const mapFieldsSelector = (props: KeplerGLProps, index = 0) => {
bottomMapContainerProps: props.bottomMapContainerProps,
// transformRequest for Mapbox basemaps
- transformRequest: props.transformRequest
+ transformRequest: props.transformRequest,
+
+ RTLTextPlugin: props.RTLTextPlugin
};
};
@@ -466,6 +468,9 @@ type KeplerGLBasicProps = {
bottomMapContainerProps?: object;
transformRequest?: (url: string) => {url: string};
+
+ /** Pass `false` to disable the remote RTL text plugin, or a URL string to self-host it. */
+ RTLTextPlugin?: string | false;
};
type KeplerGLProps = KeplerGlState & KeplerGlActions & KeplerGLBasicProps;
diff --git a/src/components/src/map-container.tsx b/src/components/src/map-container.tsx
index 6fe270e54..fc81156b4 100644
--- a/src/components/src/map-container.tsx
+++ b/src/components/src/map-container.tsx
@@ -405,6 +405,9 @@ export interface MapContainerProps {
bottomMapContainerProps: any;
transformRequest?: (url: string, resourceType?: string) => {url: string};
+ /** Pass `false` to disable the remote RTL text plugin, or a URL string to self-host it. */
+ RTLTextPlugin?: string | false;
+
datasetAttributions?: DatasetAttribution[];
attributionLogos?: AttributionWithStyle[];
@@ -1198,6 +1201,10 @@ export default function MapContainerFactory(
transformRequest(currentStyle?.accessToken || mapboxApiAccessToken)
};
+ if (this.props.RTLTextPlugin !== undefined) {
+ mapProps.RTLTextPlugin = this.props.RTLTextPlugin;
+ }
+
if (useMapboxAdapter) {
const mapboxConfig = getApplicationConfig().baseMapLibraryConfig[MAP_LIB_OPTIONS.MAPBOX];
mapProps.mapLib = mapboxConfig.getMapLib();
@@ -1292,6 +1299,9 @@ export default function MapContainerFactory(
style={MAP_STYLE.top}
mapboxAccessToken={mapProps.mapboxAccessToken}
transformRequest={mapProps.transformRequest}
+ {...(mapProps.RTLTextPlugin !== undefined
+ ? {RTLTextPlugin: mapProps.RTLTextPlugin}
+ : {})}
{...(useMapboxAdapter
? {
mapLib:
diff --git a/test/node/utils/export-utils-test.js b/test/node/utils/export-utils-test.js
index a5c40af6d..adf442a34 100644
--- a/test/node/utils/export-utils-test.js
+++ b/test/node/utils/export-utils-test.js
@@ -122,7 +122,7 @@ test('exportUtils -> calculateExportImageSize', t => {
ratio: EXPORT_IMG_RATIOS.SCREEN,
resolution: '1920x1080'
}),
- {scale: undefined, imageW: 1920, imageH: 1080},
+ {zoomOffset: 0, scale: 1, imageW: 1920, imageH: 1080},
'Should return fixed resolution 1920x1080'
);
@@ -133,7 +133,7 @@ test('exportUtils -> calculateExportImageSize', t => {
ratio: EXPORT_IMG_RATIOS.SCREEN,
resolution: '1280x720'
}),
- {scale: undefined, imageW: 1280, imageH: 720},
+ {zoomOffset: 0, scale: 1, imageW: 1280, imageH: 720},
'Should return fixed resolution 1280x720'
);
@@ -144,7 +144,7 @@ test('exportUtils -> calculateExportImageSize', t => {
ratio: EXPORT_IMG_RATIOS.SCREEN,
resolution: '2560x1440'
}),
- {scale: undefined, imageW: 2560, imageH: 1440},
+ {zoomOffset: 0, scale: 1, imageW: 2560, imageH: 1440},
'Should return fixed resolution 2560x1440'
);