Skip to content

Commit

Permalink
Supress some ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcth committed Jun 22, 2024
1 parent 7620d5a commit 38c5dd6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/map/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,14 @@ export function App() {

return (
<DeckGL
// @ts-ignore
initialViewState={searchView}
layers={layers2}
controller={{ inertia: 500, scrollZoom: { speed: 0.2, smooth: false } }}
// @ts-ignore
ContextProvider={MapProvider}
onViewStateChange={({ viewState }) => {
// @ts-ignore
setZoom(viewState.zoom);

return {
Expand Down
1 change: 1 addition & 0 deletions src/map/components/Store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const useMenuStore = create<MenuState>((set) => ({
}),
})),
setSearchResult: (result: SearchResult, fun: Function) => {
// @ts-ignore
const view = {
latitude: result.geometry_xy[1],
longitude: result.geometry_xy[0],
Expand Down
3 changes: 2 additions & 1 deletion src/map/layers/datatile-layer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export default class DataTileLayer<

hexToRGB(hex: string): Array<number> {
const c = color(hex);
return [c.r, c.g, c.b];
// @ts-ignore
return [c?.r, c?.g, c?.b];
}

lon2tile(lon: number, zoom: number): number {
Expand Down
8 changes: 6 additions & 2 deletions src/map/layers/delaunay-layer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
GetPickingInfoParams,
DefaultProps,
} from "@deck.gl/core";
import { GL } from "@luma.gl/constants";
import { Device } from "@luma.gl/core";
import { Model } from "@luma.gl/engine";
// @ts-ignore
Expand Down Expand Up @@ -84,7 +83,7 @@ export default class DelaunayLayer<
static layerName = "DelaunayLayer";
static defaultProps = defaultProps;

state!: {
declare state: {
disablePicking?: boolean;
model?: Model;
mesh?: any;
Expand Down Expand Up @@ -170,8 +169,10 @@ export default class DelaunayLayer<
}
}

// @ts-ignore
draw({ uniforms }): void {
const { model } = this.state;
// @ts-ignore
model?.setVertexCount(this.state.vertexCount);
model?.setUniforms(uniforms);
model?.draw(this.context.renderPass);
Expand All @@ -196,8 +197,10 @@ export default class DelaunayLayer<
_getModel(device: Device): Model {
return new Model(
device,
// @ts-ignore
Object.assign({}, this.getShaders(), {
id: this.id,
// @ts-ignore
bufferLayout: this.getAttributeManager().getBufferLayouts(),
topology: "triangle-list",
isInstanced: false,
Expand Down Expand Up @@ -235,6 +238,7 @@ export default class DelaunayLayer<
const delaunay = Delaunay.from(points);
const indices = delaunay.triangles;

// @ts-ignore
this.state.vertexCount = indices.length;
attribute.value = new Uint32Array(indices);
}
Expand Down

0 comments on commit 38c5dd6

Please sign in to comment.