-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
TypeScript types for the format GeoJSON cause compilation errors #13881
Comments
It should be enough to move these types from |
Thanks @ahocevar. I was testing your proposal and I have found out that if I compile OpenLayers locally, then I no longer get the error. So a basic Angular application compiles without problems if I do the following:
However if I import GeoJSON from the OpenLayers' NPM package, then I get the error back again. |
Sorry, I think my previous comment was confusing. What I wrote was a suggestion to fix the problem in OpenLayers, so it was about OpenLayers's |
I understood your first comment, @ahocevar. I updated OpenLayers'
|
Only those that are used in the public API are needed:
|
You get the same error if you import the format TopoJSON, as this is in turn importing types from
Thanks |
Just ended up here and thought it's worth mentioning: There is also a type issue in a dependency of
It has been fixed on master there in March, but there haven't been any new releases since. |
@mediafreakch That's a different issue, which was reported recently in #13924. |
installing typescript types npm libraries fixed my issue, very similar to yours. $ |
Did you ever get around to this? Else I'll gladly do it. I just ran into this issue recently as well. |
I never found the time to create a PR. Please go ahead if you can. Thanks. |
I guess they can be removed later once the official npm package includes them. openlayers/openlayers#13881
* update gitignore * update proxy config * add geojson endpoint * fixing merge error * remove prev. changes * adding extra Openlayers dependencies. I guess they can be removed later once the official npm package includes them. openlayers/openlayers#13881 * remove unnecessary type dependency * work in progress * remove obsolete fixture * some error handling * implementing rest of the filtering * add back networks fixture * add description for geoinfo.json * Release 2.4.4 (#772) * order of loading fixtures changed * release 2.4.4 prepared * Exclude user data as reference (#773) * user dataset can be selected max n-1 times, as it can not be spatial reference * user dataset can not be selected as the spatial reference * explanation added to the tooltip * release note updated * Rabit version downgraded to avoid issues with connection between work… (#777) * Rabit version downgraded to avoid issues with connection between worker and celery containers; release prepared * release note udpated * add clustered points * fixing entrypoint.sh --------- Co-authored-by: Zoltan Bakcsa <bakcsa@awst.at>
* update gitignore * update proxy config * add geojson endpoint * fixing merge error * remove prev. changes * adding extra Openlayers dependencies. I guess they can be removed later once the official npm package includes them. openlayers/openlayers#13881 * remove unnecessary type dependency * work in progress * remove obsolete fixture * some error handling * implementing rest of the filtering * add back networks fixture * add description for geoinfo.json * add clustered points * fixing entrypoint.sh * printing commented * code refinement done * map legend added * legend updated; missing interface added * tooltip for multiple sensors added * tooltips updated * single locations with multiple sensors marked separately * map filter updated to be consistent with ISMN depth filter * code refinement done; network map filter uncommented * map updated * map updated added when frm filter is checked * frm class removed from the tooltip * map layer updated * geojson file view updated, not to throw an error if other than ismn dataset is requested * geojson file name defined in globals * ismn package updated to the master branch to prepare geojson files properly * entrypoint updated to create geojson files --------- Co-authored-by: Zoltan Bakcsa <bakcsa@awst.at>
* update gitignore * update proxy config * add geojson endpoint * fixing merge error * remove prev. changes * adding extra Openlayers dependencies. I guess they can be removed later once the official npm package includes them. openlayers/openlayers#13881 * remove unnecessary type dependency * work in progress * remove obsolete fixture * some error handling * implementing rest of the filtering * add back networks fixture * add description for geoinfo.json * add clustered points * fixing entrypoint.sh * printing commented * code refinement done * map legend added * legend updated; missing interface added * tooltip for multiple sensors added * tooltips updated * single locations with multiple sensors marked separately * map filter updated to be consistent with ISMN depth filter * code refinement done; network map filter uncommented * map updated * map updated added when frm filter is checked * frm class removed from the tooltip * map layer updated * geojson file view updated, not to throw an error if other than ismn dataset is requested * geojson file name defined in globals * ismn package updated to the master branch to prepare geojson files properly * entrypoint updated to create geojson files * path updated * page content centered --------- Co-authored-by: Zoltan Bakcsa <bakcsa@awst.at>
* Ismn on map (#823) * update gitignore * update proxy config * add geojson endpoint * fixing merge error * remove prev. changes * adding extra Openlayers dependencies. I guess they can be removed later once the official npm package includes them. openlayers/openlayers#13881 * remove unnecessary type dependency * work in progress * remove obsolete fixture * some error handling * implementing rest of the filtering * add back networks fixture * add description for geoinfo.json * add clustered points * fixing entrypoint.sh * printing commented * code refinement done * map legend added * legend updated; missing interface added * tooltip for multiple sensors added * tooltips updated * single locations with multiple sensors marked separately * map filter updated to be consistent with ISMN depth filter * code refinement done; network map filter uncommented * map updated * map updated added when frm filter is checked * frm class removed from the tooltip * map layer updated * geojson file view updated, not to throw an error if other than ismn dataset is requested * geojson file name defined in globals * ismn package updated to the master branch to prepare geojson files properly * entrypoint updated to create geojson files --------- Co-authored-by: Zoltan Bakcsa <bakcsa@awst.at> * Ismn on map (#824) * update gitignore * update proxy config * add geojson endpoint * fixing merge error * remove prev. changes * adding extra Openlayers dependencies. I guess they can be removed later once the official npm package includes them. openlayers/openlayers#13881 * remove unnecessary type dependency * work in progress * remove obsolete fixture * some error handling * implementing rest of the filtering * add back networks fixture * add description for geoinfo.json * add clustered points * fixing entrypoint.sh * printing commented * code refinement done * map legend added * legend updated; missing interface added * tooltip for multiple sensors added * tooltips updated * single locations with multiple sensors marked separately * map filter updated to be consistent with ISMN depth filter * code refinement done; network map filter uncommented * map updated * map updated added when frm filter is checked * frm class removed from the tooltip * map layer updated * geojson file view updated, not to throw an error if other than ismn dataset is requested * geojson file name defined in globals * ismn package updated to the master branch to prepare geojson files properly * entrypoint updated to create geojson files * path updated * page content centered --------- Co-authored-by: Zoltan Bakcsa <bakcsa@awst.at> * docker updated (#825) * Update entrypoint.sh missing / added * Update entrypoint.sh printing added * Update entrypoint.sh creating ismn geojson script updated * Update entrypoint.sh ismn keyword removed from the path reuirements * Update entrypoint.sh data folder updated * Update entrypoint.sh var added; 2018 folder excluded * Ismn on map and geojson (#826) * docker updated * file name updated * permissions added * Ismn on map and geojson (#827) * docker updated * file name updated * permissions added * legend updated * condition updated to work properly * code refinement done * disabling validate button added when there are no ismn stations available * Ismn on map and geojson (#828) * docker updated * file name updated * permissions added * legend updated * condition updated to work properly * code refinement done * disabling validate button added when there are no ismn stations available * updating the map added when removing dataset * Update app-routing.module.ts about route removed --------- Co-authored-by: Zoltan Bakcsa <bakcsa@awst.at>
Describe the bug
I am using OpenLayers 6.15.1 in an Angular 14 application and when I make use of the GeoJSON format I get the following compilation errors:
The error disappears if I add the following dependency:
npm install @types/geojson --save-dev
To Reproduce
Steps to reproduce the behavior:
ng new test-app
cd test-app
npm install ol
ng build
Expected behavior
Not to have to add the dependency
@types/geojson
in order to get rid of the compilation errors. The same issue happens with the format EsriJSON, so I am guessing that the installation of multiple dependencies may potentially be required.The text was updated successfully, but these errors were encountered: