How to include typescript openlayers 3 external module? -
i want try setting simple map in openlayers using typescript:
https://github.com/borisyankov/definitelytyped/blob/master/openlayers/openlayers.d.ts
i take file, put
/typings/openlayers/openlayers.d.ts
i have app.ts file @ top in root directory put:
import { map } "olx";
in tsconfig.json, i've included path openlayers.d.ts file. gettting olx not defined when use tsc command npm's typescript package.
all going drawing simple openlayers3 map, hope not deviate javascript if possible.
first install openlayers:
npm install openlayers
then install types openlayers dev env:
npm install --save-dev @types/openlayers
to import tried:
import * ol 'openlayers';
then can invoke in openlayers this:
new ol.map();
Comments
Post a Comment