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

FusionTablesLayer not reacting properly when 'options.query.from' is changed. #492

@zavidovych

Description

@zavidovych
// 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';
};
  1. When map is loaded initially, data from FUSION_TABLE_ID_1 is shown.
  2. Clicking 'Toggle wind' button toggles layer on and off as expected.
  3. Clicking 'Refresh wind' turns off the layer instead of loading and showing data from FUSION_TABLE_ID_2.
  4. 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!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions