-
-
Notifications
You must be signed in to change notification settings - Fork 743
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
MapLibre doesn't work Angular 13.2.2 #970
Comments
If you are using angular I suggest to use npx-maplibre-gl. |
Thanx for responding me pal. Certainly, I am using npx-maplibre-gl and it installed all I needed. But I have the same issue. |
Please share a stackblitz or something similar. |
I don't know how to use stackblitz. Basically, I create a new project after install Angular. I installed and configured both maplibre-gl and npx-maplibre-gl (in different times) and I had same results. |
It happens after I import map from maplibregl |
I'm sorry, I can't help without seeing the problem... |
Ok pal. Error: node_modules/maplibre-gl/dist/maplibre-gl.d.ts:3:19 - error TS7016: Could not find a declaration file for module '@mapbox/point-geometry'. 'D:/PROJECTS/ANGULAR/homelasvegasnevada/node_modules/@mapbox/point-geometry/index.js' implicitly has an 'any' type. 3 import Point from '@mapbox/point-geometry'; Error: node_modules/maplibre-gl/dist/maplibre-gl.d.ts:5:52 - error TS7016: Could not find a declaration file for module '@mapbox/vector-tile'. 'D:/PROJECTS/ANGULAR/homelasvegasnevada/node_modules/@mapbox/vector-tile/index.js' implicitly 5 import { VectorTileFeature, VectorTileLayer } from '@mapbox/vector-tile'; Error: node_modules/maplibre-gl/dist/maplibre-gl.d.ts:2232:61 - error TS2344: Type 'Us' does not satisfy the constraint '{}'. 2232 export declare type UniformValues = $ObjMap<Us, (u: Uniform) => V>; Error: node_modules/maplibre-gl/dist/maplibre-gl.d.ts:8635:4 - error TS2411: Property 'mousemove' of type 'undefined' 8635 mousemove?: undefined; Error: node_modules/maplibre-gl/dist/maplibre-gl.d.ts:8636:4 - error TS2411: Property 'mouseout' of type 'undefined' is not assignable to string index type '(e: any) => void'. 8636 mouseout?: undefined; ERRORS HAPPENED INTO maplibre-gl.d.ts |
I tried installing: 3 import Point from '@mapbox/point-geometry'; node_modules/@types/mapbox__point-geometry/index.d.ts:46:1 Error: node_modules/maplibre-gl/dist/maplibre-gl.d.ts:2232:61 - error TS2344: Type 'Us' does not satisfy the constraint '{}'. 2232 export declare type UniformValues = $ObjMap<Us, (u: Uniform) => V>; |
Maybe I can adapt https://github.com/wipfli/maplibre-typescript such that it runs @peteresteris Angular project... |
Even I had the same error building my project with 1.15.2 maplibrgl version. I remove it from package.json and used the below npm install that resolved my issue. Ref : https://www.geoapify.com/tutorial/angular-leaflet-mapbox-maplibre-openlayers#angular-maplibre npm i maplibre-gl@1.x ERROR node_modules/maplibre-gl/dist/maplibre-gl.d.ts:5:52 - error TS7016: Could not find a declaration file for module '@mapbox/vector-tile'. 'D:/PROJECTS/ANGULAR/homelasvegasnevada/node_modules/@mapbox/vector-tile/index.js' implicitly has an 'any' type. 5 import { VectorTileFeature, VectorTileLayer } from '@mapbox/vector-tile';
|
Just out of curiosity, why do you use v1 @rajakumar-durga ? |
We are using angular 10.2.x , if I use >v1 I am end up seeing the same error. waiting 66 r: number, 67 g: number, 68 b: number, 69 alpha: number 78 h: number, |
FWIW, I have the latest MapLibre (v3.3.1) working just fine with Angular 16! |
Latest versions are working as expect as mentioned by @neodescis. |
Hello! Thanks for contributing. For the fastest response and resolution, please:
Hi pals!
I have used maplibre in angular but after last version 13.2.2 through some misterious errors. This is my versions:
imagen
I have intalled MapLibreGl by command:
npm install maplibregl @types/maplibregl @types/geojson
I followed all instructions like:
But, in the first moment I put "import { Map } from 'maplibre-gl';" into .ts file, it throughs me a very strange pack of errors:
Compiled with problems:X
ERROR
node_modules/maplibre-gl/dist/maplibre-gl.d.ts:3:19 - error TS7016: Could not find a declaration file for module '@mapbox/point-geometry'. 'D:/PROJECTS/ANGULAR/homelasvegasnevada/node_modules/@mapbox/point-geometry/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/mapbox__point-geometry if it exists or add a new declaration (.d.ts) file containing declare module '@mapbox/point-geometry';
3 import Point from '@mapbox/point-geometry';
The text was updated successfully, but these errors were encountered: