angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

Polygons directive not watching visible property

Open aplus01 opened this issue 11 years ago • 6 comments

The uiGmapPolygons directive is not hiding/showing when the visible property of the model is modified. What am I doing wrong here?

http://plnkr.co/edit/EhFihJRBK9Lb0s3mwMSl

aplus01 avatar Jan 06 '15 19:01 aplus01

Polylines also. Toggle visible not working on demo page now.

https://rawgit.com/angular-ui/angular-google-maps/master/example/example.html

jackysee avatar Jan 09 '15 06:01 jackysee

The polylines example http://plnkr.co/edit/dVpNl7kTdDDf2jWkApH2?p=preview I'm using v2.0.11.

The problem is that I have set property like draggable to false. This will trigger an early return in polylines-parent-model.coffee

      setChildScope: (childScope, model) =>
        _.each @scopePropNames, (name) =>
          nameKey = name + 'Key'
          newValue = if @[nameKey] == 'self' then model else model[@[nameKey]]
          if(newValue != childScope[name])
            childScope[name] = newValue
        childScope.model = model

So it should be

      setChildScope: (childScope, model) =>
        _.each @scopePropNames, (name) =>
          nameKey = name + 'Key'
          newValue = if @[nameKey] == 'self' then model else model[@[nameKey]]
          if(newValue != childScope[name])
            childScope[name] = newValue
            return true
        childScope.model = model

It can fix the problem in v2.0.11, but it seems not to be the root cause this bug for v2.0.12.

jackysee avatar Jan 09 '15 10:01 jackysee

Ill try and look into it. I would try playing with develop. As that is what I am mainly using. However if I were to release it. It would really be considered a 2.1.X.

nmccready avatar Jan 09 '15 22:01 nmccready

This is not surprising for polylines and polygons as they are the same code. Nice example as it is still failing on the first round for the toggles. It works afterwards though.

nmccready avatar Jan 21 '15 05:01 nmccready

Confirmed.. looking into it.

nmccready avatar Jan 21 '15 06:01 nmccready

http://plnkr.co/edit/3HoutKlQWMk51cPB1v8y fixed

nmccready avatar Jan 21 '15 13:01 nmccready