Openlayers javascript library in typescript -



Openlayers javascript library in typescript -

we working on project using typescript. out first project typescript. in project need connect wfs server , returns gml us. parse gml, think of using openlayers javascript library. know there definitelytyped version of openlayers, gml parsing isn't ready yet.

so tried javascript files. think missing something, because getting error: openlayers undifined.

this our code:

module pp.data { declare var openlayers: any; export class webrequest { public getgml(url: string): xmldocument { var retour: xmldocument; var _this = this; $.ajax({ url: url, type: 'get', crossdomain: true, cache: false, async: false, datatype: 'xml' }).done(function (data) { var format = new openlayers.format.gml(); retour = format.read(data); }); homecoming retour; } } }

so error starts when seek create instance of gml.

any ideas?

thanks!

openlayers undefined.

make sure openlayers included (e.g. using script tag) before seek utilize typescript

not related error noticed

you returning undefined here (as retour isn't assigned before returned).

.done(function (data) { var format = new openlayers.format.gml(); retour = format.read(data); }); homecoming retour;

you should homecoming promise ie. homecoming value of .done function or have callback. needs async way down.

javascript typescript openlayers

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -