Skip to content

Commit

Permalink
Update example app
Browse files Browse the repository at this point in the history
  • Loading branch information
asennikov committed Jan 4, 2016
1 parent 1a9bcee commit a110531
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
7 changes: 7 additions & 0 deletions tests/dummy/app/controllers/application.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import Ember from 'ember';

const { computed } = Ember;

export default Ember.Controller.extend({
randomVariable: 111,

addressQuery: 'SF, Lafayette Park',
addressQueryInput: computed.reads('addressQuery'),

customOptions: {
mapTypeId: google.maps.MapTypeId.TERRAIN
Expand All @@ -16,6 +19,10 @@ export default Ember.Controller.extend({

onInfowindowClosed() {
window.alert('Info Window Closed!');
},

updateAdressQuery() {
this.set('addressQuery', this.get('addressQueryInput'));
}
}
});
17 changes: 11 additions & 6 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<h2 id="title">Ember-g-map Component</h2>

<p>
<label>Address Query for Bound Marker</label>
{{input value=addressQuery}}
</p>

{{#g-map shouldFit=true options=customOptions as |context|}}
<form {{action "updateAdressQuery" on="submit"}}>
<p>
<label>Address Query for Bound Marker</label>
{{input value=addressQueryInput}}
</p>
<p>
<button type="submit"> Update bound marker </button>
</p>
</form>

{{#g-map markersFitMode="live" options=customOptions as |context|}}
{{g-map-marker context lat=37.7933 lng=-122.4467}}

{{#g-map-marker context lat=37.7433 lng=-122.3867 as |markerContext|}}
Expand Down

0 comments on commit a110531

Please sign in to comment.