/ol3ng2

openlayers3 directives for angular 2

Primary LanguageTypeScriptGNU General Public License v3.0GPL-3.0

ol3ng2 Build Status

ol3 directives for angular 2 (under construction)

Usage

...
import {Ol3Ng2} from 'ol3ng2/ol3ng2';
...

@Component({
      ...
      directives: [Ol3Ng2]
    })
    export class AccessibleMapComponent implements OnInit {
      public layerType = ol.layer.Tile;
      public source: ol.source.Source = new ol.source.OSM();
      public center: ol.Coordinate = [0, 0];
      public zoom: number = 2;
      ...
}

Build your map in template:

<map>
    <layer [type]="layerType" [source]="source"></layer>
    <view [(center)]="center" [(zoom)]="zoom"></view>
</map>