Skip to content
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

Merged
merged 10 commits into from Apr 11, 2022

Conversation

HeimEndyd
Copy link
Collaborator

No description provided.

Signed-off-by: Maksim Suslov <maksim.suslov@actionengine.com>
Signed-off-by: Maksim Suslov <maksim.suslov@actionengine.com>
Signed-off-by: Maksim Suslov <maksim.suslov@actionengine.com>
Signed-off-by: Maksim Suslov <maksim.suslov@actionengine.com>
wireframe: boolean;
};

export type GeoJsonLayerConfig = Merge<
Copy link
Contributor

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

Copy link
Collaborator Author

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?

Copy link
Contributor

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';
Copy link
Contributor

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;

Copy link
Collaborator Author

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}}[];
Copy link
Contributor

@heshan0131 heshan0131 Apr 5, 2022

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 <maksim.suslov@actionengine.com>
Signed-off-by: Maksim Suslov <maksim.suslov@actionengine.com>
Signed-off-by: Maksim Suslov <maksim.suslov@actionengine.com>
@HeimEndyd HeimEndyd merged commit 68abc5b into master Apr 11, 2022
@delete-merged-branch delete-merged-branch bot deleted the ms/js_to_ts_convertion/layers/geojson-layer branch April 11, 2022 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants