Created
June 29, 2015 15:35
-
-
Save odoe/b6c1843649a564a1e871 to your computer and use it in GitHub Desktop.
This file contains 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 Ember from 'ember'; | |
import Search from 'esri/dijit/Search'; | |
export default Ember.Component.extend({ | |
willRemoveElement() { | |
var search = this.get('search'); | |
if (search) { | |
search.destroy(); | |
} | |
}, | |
onMapChange: function() { | |
var search = this.get('search'); | |
var map = this.get('map'); | |
if (map && search) { | |
search.set('map', map); | |
} | |
if (map && !search) { | |
search = new Search({ | |
map: this.get('map') | |
}, this.elementId); | |
this.set('search', search); | |
} | |
}.observes('map') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment