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

Example visualization. Geolocation #5

Closed
santiagotsp opened this issue Jul 14, 2021 · 3 comments
Closed

Example visualization. Geolocation #5

santiagotsp opened this issue Jul 14, 2021 · 3 comments

Comments

@santiagotsp
Copy link

santiagotsp commented Jul 14, 2021

Cannot use namespace 'GeometryType' as a type. TS2709

62 | 
63 |                     <RInteraction.RDraw

64 | type={"Polygon" as GeometryType}
| ^
65 | condition={shiftKeyOnly}
66 | freehandCondition={altShiftKeysOnly}
67 | />

@mmomtchev
Copy link
Owner

@santiagotsp
Copy link
Author

This is my tsconfig.json before running the app and Geolocation.tsx doesn´t show any errors.
{ "compilerOptions": { "target": "es5", "lib": [ "dom", "dom.iterable", "esnext" ], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": false, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "baseUrl": "./", "paths": { "ol": [ "node_modules/@types/ol" ], "ol/*": [ "node_modules/@types/ol/*" ] }, }, "include": [ "src" ] }

After running the app the tsconfig.json changed to (deletes paths attribute):
{ "compilerOptions": { "target": "es5", "lib": [ "dom", "dom.iterable", "esnext" ], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": false, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "baseUrl": "./" }, "include": [ "src" ] }

The Geolocatio.tsx file show this errors:
error_rlayers

@mmomtchev
Copy link
Owner

Yes, the new OpenLayers 6.6.0 native Typescript types are not compatible, you have to keep the paths for now
An eventual new rlayers 1.1 version will support the new Typescript types, but it won't be compatible with OpenLayers < 6.6.0
I am still waiting for the typings to stabilize - there was a new 6.6.1 release a few hours ago - and I will publish rlayers 1.1
For now the only way to use OpenLayers 6.6.0 with Typescript is to add the paths attribute

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

No branches or pull requests

2 participants