-
Notifications
You must be signed in to change notification settings - Fork 214
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
GoogleMaps support #7604
base: master
Are you sure you want to change the base?
GoogleMaps support #7604
Conversation
@@ -19,6 +19,10 @@ export type ImageryMapLayerFormatId = "ArcGIS" | "BingMaps" | "MapboxImagery" | | |||
/** @public */ | |||
export type SubLayerId = string | number; | |||
|
|||
/** @public */ | |||
export type PropertyBagArrayProperty = Array<number|string|boolean>; | |||
export interface PropertyBag { [key: string]: number | string | boolean | PropertyBagArrayProperty }; |
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.
See if you can avoid reinventing JSONSchema.
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.
export type JSONSchemaType = string | number | boolean | object | JSONSchemaType[];
I need a type representing types that can be directly serialized and can be compared easily. This is why I excluded object
, and I didn't want to support array of arrays.
Is there a way to compose type from existing types with typescript ?
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.
Do the google maps property bags definitely conform to those constraints? Do we anticipate other map providers that might not meet those constraints?
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.
Currently for google it only holds this data structure:
export interface CreateGoogleMapsSessionOptions {
mapType: GoogleMapsMapType;
language: string;
region: string;
orientation?: number;
layerTypes?: string[];
};
My thinking is that MapLayerSettings's properties are meant to be simple list key,value pairs that can be passed down to the provider, it's not meant to pass complex data structures. If nested objects need to be passed, it can always be simplified into a flat list of values and re-construct inside the provider.
@pmconne Part of this PR, I need to have an async version of My only solution right now, would consist in created an Any thoughts? |
The |
else if (lhs.length === 0 && rhs.length === 0) { | ||
return 0; | ||
} else if (lhs.length !== rhs.length) { | ||
return Math.abs(lhs.length - rhs.length); |
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.
Why absolute value? It breaks the strict weak constraint.
No description provided.