This repository was archived by the owner on Nov 30, 2018. It is now read-only.

Description
// view.html
<button ng-click="ctrl.updateWindData()">Refresh wind</button>
<button ng-click="ctrl.toggleWind()">Toggle wind</button>
<google-map ...>
<layer type='FusionTablesLayer' options='ctrl.windLayer.options' show='ctrl.windLayer.show'></layer>
</google-map>
//controller.js
function MapCtrl() {
this.windLayer = {
show: true,
options: {
query: {
from: 'FUSION_TABLE_ID_1',
select: 'location'
}
}
}
}
MapCtrl.prototype.toggleWind = function() {
this.windLayer.show = !this.windLayer.show;
};
MapCtrl.prototype.updateWindData = function() {
this.windLayer.options.query.from = 'FUSION_TABLE_ID_2';
};
- When map is loaded initially, data from FUSION_TABLE_ID_1 is shown.
- Clicking 'Toggle wind' button toggles layer on and off as expected.
- Clicking 'Refresh wind' turns off the layer instead of loading and showing data from FUSION_TABLE_ID_2.
- However clicking 'Toggle wind' 2 times (off then on) after clicking 'Refresh wind' does show the data from FUSION_TABLE_ID_2.
Is it possible to make it so that when model (options.query.from) is updated layer would load and show new data automatically without having to turn layer off and on via 'show' attribute?
Sorry if I'm missing something. Thanks!