-
Notifications
You must be signed in to change notification settings - Fork 69
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
GeoJson layer props #245
GeoJson layer props #245
Conversation
@@ -2198,7 +2198,7 @@ declare module '@deck.gl/core/lib/deck' { | |||
// https://github.com/visgl/deck.gl/blob/e948740f801cf91b541a9d7f3bba143ceac34ab2/modules/react/src/deckgl.js#L71-L72 | |||
width: string | number; | |||
height: string | number; | |||
layers: Layer<any>[]; | |||
layers: (Layer<any> | undefined | null | false)[]; |
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.
https://deck.gl/docs/api-reference/core/deck#layers
Nested arrays are accepted, as well as falsy values (null, false, undefined).
@@ -925,7 +925,7 @@ declare module '@deck.gl/core/lifecycle/component' { | |||
import { LayerContext } from '@deck.gl/core/lib/layer'; | |||
export default class Component<P> { | |||
constructor(props: P, ...additionalProps: P[]); | |||
clone(newProps: P): any; | |||
clone(newProps?: Partial<P>): any; |
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.
https://deck.gl/docs/api-reference/core/layer#clone
Create a copy of this layer, optionally change some prop values.
@@ -200,7 +200,7 @@ declare module '@deck.gl/geo-layers/tile-layer/tile-layer' { | |||
url: string; | |||
bbox: any; | |||
signal: AbortSignal; | |||
}) => D[] | Promise<D[]> | null; | |||
}) => D[] | null | Promise<D[] | 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.
https://deck.gl/docs/api-reference/geo-layers/tile-layer#gettiledata
It should return either the tile data or a Promise that resolves to the tile data.
If
signal
is aborted, then throw or return falsy fromgetTileData
so the data is not cached; do not return incomplete data.
as the getTileData
could be sync or async function, so when it's an async function and in the falsy scenario, the return type should be Promise<null>
.
// Point Options | ||
pointType?: string; | ||
|
||
// pointType:circle Options (ScatterplotLayer Props) | ||
/** | ||
* @deprecated | ||
* getRadius is deprecated since deck.gl v8.5, use {@link getPointRadius} instead | ||
* */ | ||
getRadius?: ScatterplotLayerProps<D>['getRadius']; | ||
getPointRadius?: ScatterplotLayerProps<D>['getRadius']; | ||
pointRadiusUnits?: ScatterplotLayerProps<D>['radiusUnits']; | ||
pointRadiusScale?: ScatterplotLayerProps<D>['radiusScale']; | ||
pointRadiusMinPixels?: ScatterplotLayerProps<D>['radiusMinPixels']; | ||
pointRadiusMaxPixels?: ScatterplotLayerProps<D>['radiusMaxPixels']; | ||
pointAntialiasing?: ScatterplotLayerProps<D>['antialiasing']; | ||
pointBillboard?: ScatterplotLayerProps<D>['billboard']; | ||
|
||
// pointType:icon Options (IconLayer Props) | ||
iconAtlas?: IconLayerProps<D>['iconAtlas']; | ||
iconMapping?: IconLayerProps<D>['iconMapping']; | ||
getIcon?: IconLayerProps<D>['getIcon']; | ||
getIconSize?: IconLayerProps<D>['getSize']; | ||
getIconColor?: IconLayerProps<D>['getColor']; | ||
getIconAngle?: IconLayerProps<D>['getAngle']; | ||
getIconPixelOffset?: IconLayerProps<D>['getPixelOffset']; | ||
iconSizeUnits?: IconLayerProps<D>['sizeUnits']; | ||
iconSizeScale?: IconLayerProps<D>['sizeScale']; | ||
iconSizeMinPixels?: IconLayerProps<D>['sizeMinPixels']; | ||
iconSizeMaxPixels?: IconLayerProps<D>['sizeMaxPixels']; | ||
iconBillboard?: IconLayerProps<D>['billboard']; | ||
iconAlphaCutoff?: IconLayerProps<D>['alphaCutoff']; | ||
|
||
// pointType:text Options (TextLayer Props) | ||
getText?: TextLayerProps<D>['getText']; | ||
getTextColor?: TextLayerProps<D>['getColor']; | ||
getTextAngle?: TextLayerProps<D>['getAngle']; | ||
getTextSize?: TextLayerProps<D>['getSize']; | ||
getTextAnchor?: TextLayerProps<D>['getTextAnchor']; | ||
getTextAlignmentBaseline?: TextLayerProps<D>['getAlignmentBaseline']; | ||
getTextPixelOffset?: TextLayerProps<D>['getPixelOffset']; | ||
getTextBackgroundColor?: TextLayerProps<D>['getBackgroundColor']; | ||
getTextBorderColor?: TextLayerProps<D>['getBorderColor']; | ||
getTextBorderWidth?: TextLayerProps<D>['getBorderWidth']; | ||
textSizeUnits?: TextLayerProps<D>['sizeUnits']; | ||
textSizeScale?: TextLayerProps<D>['sizeScale']; | ||
textSizeMinPixels?: TextLayerProps<D>['sizeMinPixels']; | ||
textSizeMaxPixels?: TextLayerProps<D>['sizeMaxPixels']; | ||
textCharacterSet?: TextLayerProps<D>['characterSet']; | ||
textFontFamily?: TextLayerProps<D>['fontFamily']; | ||
textFontWeight?: TextLayerProps<D>['fontWeight']; | ||
textLineHeight?: TextLayerProps<D>['lineHeight']; | ||
textMaxWidth?: TextLayerProps<D>['maxWidth']; | ||
textWordBreak?: TextLayerProps<D>['wordBreak']; | ||
textBackground?: TextLayerProps<D>['background']; | ||
textBackgroundPadding?: TextLayerProps<D>['backgroundPadding']; | ||
textOutlineColor?: TextLayerProps<D>['outlineColor']; | ||
textOutlineWidth?: TextLayerProps<D>['outlineWidth']; | ||
textBillboard?: TextLayerProps<D>['billboard']; | ||
textFontSettings?: TextLayerProps<D>['fontSettings']; |
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.
Adapting all available props from sub-layers that are listed in the doc:
https://deck.gl/docs/api-reference/layers/geojson-layer#pointtypecircle-options
https://deck.gl/docs/api-reference/layers/geojson-layer#pointtypeicon-options
https://deck.gl/docs/api-reference/layers/geojson-layer#pointtypetext-options
getBackgroundColor?: ((d: D) => RGBAColor) | RGBAColor; | ||
getBorderColor?: ((d: D) => RGBAColor) | RGBAColor; | ||
getBorderWidth?: ((d: D) => number) | 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.
Add missing props to TextLayerProps
billboard?: boolean; | ||
antialiasing?: boolean; |
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.
Add missing props to ScatterplotLayerProps
Thanks! Is this ready to merge? |
Yes, it's ready. Cheers |
Thanks! Published 4.9.23 |
getTileData
returnsPromise
with falsy valueScatterplotLayer
types need updating #227