Created
January 4, 2016 16:47
-
-
Save odoe/a5764f2e11c061f5d980 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, ElementRef, Output, EventEmitter } from 'angular2/core'; | |
| import MapService from './map.service'; | |
| import { MapView } from 'esri-mods'; | |
| @Component({ | |
| selector: 'esri-map', | |
| template: '<div id="viewDiv"><ng-content></ng-content></div>', | |
| providers: [MapService] | |
| }) | |
| export class MapComponent { | |
| @Output() viewCreated = new EventEmitter(); | |
| view: null; | |
| constructor(private _service: MapService, private elRef:ElementRef) {} | |
| ngOnInit() { | |
| this.view = new MapView({ | |
| container: this.elRef.nativeElement.firstChild, | |
| map: this._service.map, | |
| zoom: 10, | |
| center: [-120.76, 37.93] | |
| }); | |
| this.viewCreated.next(this.view); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment