Can you change/update an overlay's opacity from angular?
I tried adding a button to my controller
$scope.onClick = function() { $scope.layers.overlays.myOverlay.layerOptions.opacity = 0.5; }
Although the value changes, the new opacity does not reflect on the map.
You're correct that you cant right now. I just got back from vacation and I'm going to make an honest effort to figure out my build problems so I can start contributing - but in the meantime, I can offer this: cc8fadb9f01b52d431424274656d6467a29d4975
I quickly modified my working version to accommodate recent changes in master, I might have made a mistake. You have to call leaflet api methods on the layers to update the opacity or zIndex, so we can't handle them in a very generic way. Let me know if you have any problems. If this works right away, I could issue a pull request but I'll leave that up to everyone else.
See: https://github.com/tombatossals/angular-leaflet-directive/issues/215
I just tried it and it works great. could you issue the pull request?
actually it does reset the visibility of the overlays. So I had to work around that. If you could get that solved it'd be perfect.
Any progress on this?
@ccrabb please PR.
Hi, layercontrol directive does it, an example here:
http://tombatossals.github.io/angular-leaflet-directive/examples/0000-viewer.html#/controls/custom-layer-control-example
This feature requires HTML5 browsers.
Actually @elesdoar I think they know how to set the opacity. I think the issue is that updating the opacity doesn't work at a later point in time.
Does anyone want credit for their work? Please make a PR; or do I have to pull it in manually. Please make our lives easier by making a PR through github.
I think that it was not clear, layercontrol support change opacity and order in layers.
Click double down arrow

Layer control show an opacity control

But, the problem is that leaflet directive not watch opacity or z-index changes without layercontrol.
Ok @elesdoar then we should be good "as is" and close right?
For now, yes, soon I will fixing for be enough setting layer options anywhere...