Skip to content

chore: add geojson types to terra-draw example#1086

Open
JamesLMilner wants to merge 1 commit intogooglemaps-samples:mainfrom
JamesLMilner:chore/terra-draw-geojson-types
Open

chore: add geojson types to terra-draw example#1086
JamesLMilner wants to merge 1 commit intogooglemaps-samples:mainfrom
JamesLMilner:chore/terra-draw-geojson-types

Conversation

@JamesLMilner
Copy link

At the moment if you try to run npm run start after running npm install in the map-drawing-terradraw sample it fails with the following TypeScript compilation error:

> @js-api-samples/map-drawing-terradraw@1.0.0 start
> tsc && vite build --base './' && vite

../../node_modules/terra-draw/dist/common.d.ts:1:47 - error TS2307: Cannot find module 'geojson' or its corresponding type declarations.

1 import { LineString, Polygon, Position } from "geojson";
                                                ~~~~~~~~~
../../node_modules/terra-draw/dist/modes/pixel-distance.behavior.d.ts:3:26 - error TS2307: Cannot find module 'geojson' or its corresponding type declarations.

3 import { Position } from "geojson";
                           ~~~~~~~~~
../../node_modules/terra-draw/dist/modes/select/behaviors/coordinate-point.behavior.d.ts:1:33 - error TS2307: Cannot find module 'geojson' or its corresponding type declarations.

1 import { Point, Position } from "geojson";
                                  ~~~~~~~~~
../../node_modules/terra-draw/dist/modes/select/behaviors/midpoint.behavior.d.ts:1:33 - error TS2307: Cannot find module 'geojson' or its corresponding type declarations.

1 import { Point, Position } from "geojson";
                                  ~~~~~~~~~
../../node_modules/terra-draw/dist/modes/select/behaviors/selection-point.behavior.d.ts:1:54 - error TS2307: Cannot find module 'geojson' or its corresponding type declarations.

1 import { LineString, Point, Polygon, Position } from "geojson";
                                                       ~~~~~~~~~
../../node_modules/terra-draw/dist/store/store.d.ts:1:53 - error TS2307: Cannot find module 'geojson' or its corresponding type declarations.

1 import { Feature, Point, Polygon, LineString } from "geojson";
                                                      ~~~~~~~~~
../../node_modules/terra-draw/dist/terra-draw.d.ts:16:26 - error TS2307: Cannot find module 'geojson' or its corresponding type declarations.

16 import { Position } from "geojson";
                            ~~~~~~~~~

Found 7 errors in 7 files.

Errors  Files
     1  ../../node_modules/terra-draw/dist/common.d.ts:1
     1  ../../node_modules/terra-draw/dist/modes/pixel-distance.behavior.d.ts:3
     1  ../../node_modules/terra-draw/dist/modes/select/behaviors/coordinate-point.behavior.d.ts:1
     1  ../../node_modules/terra-draw/dist/modes/select/behaviors/midpoint.behavior.d.ts:1
     1  ../../node_modules/terra-draw/dist/modes/select/behaviors/selection-point.behavior.d.ts:1
     1  ../../node_modules/terra-draw/dist/store/store.d.ts:1
     1  ../../node_modules/terra-draw/dist/terra-draw.d.ts:16

This PR adds in the necessary geojson types required to allow the command to run correctly.

@google-cla
Copy link

google-cla bot commented Feb 8, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

1 participant