Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I have a Javascript code which use openLayer3. I need to implement this code in a angular2 project, in Typescript.

Someone knows how use openlayer with angular2 / Typescript please ?

Thanks a lot,

John

share|improve this question

As for the typings you may be interested in DefinitelyTyped project - you can find there openlayers/openlayers.d.ts - you probably need to understand the tsd, folder convetions etc.

As for the AngularJS 2 considering it's still in beta the experience tells you're mostly on your own. Still googling can point you to i.e. https://gist.github.com/borchsenius/5a1ec0b48b283ba65021.

Usual approach is first to understand the AngularJS 2 way according to already existing examples. You should soon notice lot of common sense in the way different integrations are looking. Then try to adapt what you want in appropriate manner. Then there is the great part to give further and share the knowledge :)

Also knowing existing AngularJS 1.x solutions like this article may help.

share|improve this answer
    
A side note to this is the openlayers typings are incomplete. I've contributed a little bit to it, but it is far from complete. Make sure to check the documentation. Do not rely on the intellisense. If you find a method or property you need to use that isn't in the definition file, make sure you add it and submit a pull request! – rgvassar Feb 23 at 17:39
    
Good notice and good to know. Actually this is the way typings are evolving for the untyped JS world. I'm trying to do the same when using other typings that are incomplete. – ciekawy Feb 23 at 18:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.