-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Chore]: Technical: Translate geojson-layer #1757
[Chore]: Technical: Translate geojson-layer #1757
Conversation
Signed-off-by: Maksim Suslov <[email protected]>
Signed-off-by: Maksim Suslov <[email protected]>
Signed-off-by: Maksim Suslov <[email protected]>
Signed-off-by: Maksim Suslov <[email protected]>
Signed-off-by: Maksim Suslov <[email protected]>
wireframe: boolean; | ||
}; | ||
|
||
export type GeoJsonLayerConfig = Merge< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type GeoJsonLayerVisualChannelConfig = LayerColorConfig & LayerStrokeColorConfig
LayerSizeConfig & LayerHeightConfig & LayerRadiusConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is meant by LayerRadiusConfig?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add this to base-layer
export type LayerRadiusConfig = {
radiusField: VisualChannelField;
radiusDomain: VisualChannelDomain;
radiusScale: VisualChannelScale;
};
@@ -22,7 +22,7 @@ import wktParser from 'wellknown'; | |||
import normalize from '@mapbox/geojson-normalize'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please types below to type the functions in this file
import {KeplerTable} from '../../utils';
import {Feature, BBox} from 'geojson';
import {LayerColumns} from '../index';
type GetFeature = (d: any) => Feature;
type GeojsonDataMaps = Array<Feature | null>;
export enum FeatureTypes {
Point = 'Point',
MultiPoint = 'MultiPoint',
LineString = 'LineString',
MultiLineString = 'MultiLineString',
Polygon = 'Polygon',
MultiPolygon = 'MultiPolygon'
}
type FeatureTypeMap = {
[key in FeatureTypes]: boolean;
};
export function parseGeoJsonRawFeature(rawFeature: unknown): Feature | null;
export function getGeojsonDataMaps(
allData: KeplerTable['allData'],
getFeature: GetFeature
): GeojsonDataMaps;
export function getGeojsonBounds(features: Feature[]): BBox | null;
export function getGeojsonFeatureTypes(allFeatures: Feature[]): FeatureTypeMap;
export function parseGeometryFromString(geoString: string): Feature | null;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KeplerTable does not contain property allData
|
||
// access feature properties from geojson sub layer | ||
export const defaultElevation = 500; | ||
export const defaultLineWidth = 1; | ||
export const defaultRadius = 1; | ||
|
||
export default class GeoJsonLayer extends Layer { | ||
declare config: GeoJsonLayerConfig; | ||
declare visConfigSettings: GeoJsonVisConfigSettings; | ||
dataToFeature: {properties?: {radius?: number}}[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dataToFeature: GeojsonDataMaps
See comments in geojson-utils
Signed-off-by: Maksim Suslov <[email protected]>
Signed-off-by: Maksim Suslov <[email protected]>
Signed-off-by: Maksim Suslov <[email protected]>
No description provided.