quentinlampin / ngx-openlayers

Angular2+ components for Openlayers 4.x
Mozilla Public License 2.0
137 stars 98 forks source link

Cannot find Module openlayers #2

Closed FallenRiteMonk closed 7 years ago

FallenRiteMonk commented 7 years ago

Importing the module like:

...
import { AngularOpenlayersModule } from 'angular2-openlayers';

@NgModule({
  imports: [
    ...,
    AngularOpenlayersModule
  ],
...

result in the following error message:

ERROR in [default] <PROJECT_PATH>/web/node_modules/angular2-openlayers/dist/components/feature.component.d.ts:2:24 
Cannot find module 'openlayers'.

ERROR in [default] <PROJECT_PATH>/node_modules/angular2-openlayers/dist/components/geometry.components.d.ts:2:21 
Cannot find module 'openlayers'.

ERROR in [default] <PROJECT_PATH>/node_modules/angular2-openlayers/dist/components/layer.components.d.ts:2:22 
Cannot find module 'openlayers'.

ERROR in [default] <PROJECT_PATH>/node_modules/angular2-openlayers/dist/components/map.component.d.ts:2:20 
Cannot find module 'openlayers'.

ERROR in [default] <PROJECT_PATH>/node_modules/angular2-openlayers/dist/components/source.components.d.ts:2:23 
Cannot find module 'openlayers'.

ERROR in [default] <PROJECT_PATH>/node_modules/angular2-openlayers/dist/components/view.component.d.ts:2:21 
Cannot find module 'openlayers'.
quentin-ol commented 7 years ago

It looks like the openlayers type definitions are missing, my bad. I will add them as a dependency.

In the meantime, those are available in the @types npm repository :

npm install @types/openlayers --save 
quentin-ol commented 7 years ago

Fixed in commit e2721f8c1b5baa0775f1393de2c2b6cf53d64772. Available as npm package 0.1.4: npm update should do the trick. Closing the issue.