Skip to content

Instantly share code, notes, and snippets.

@odoe
Created June 29, 2015 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odoe/b6c1843649a564a1e871 to your computer and use it in GitHub Desktop.
Save odoe/b6c1843649a564a1e871 to your computer and use it in GitHub Desktop.
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