Closed pieterjandesmedt closed 9 years ago
It seems interesting. What do you think about this @nmccready?
I would change refresh to be more obvious that it is a boolean. Like doRefresh
that is if it is a boolean, it could be a function.
But yes this makes sense. I hope there are checks in the scope.$watch('layers', function())
to make sure it really has changed as well.
Ok! Agree with the "doRefrest". I'm coding this.
@pieterjandesmedt, do you have any example of dynamic overlay layer which could be added to an example to test this funcionality?
I was looking at his fork; and it looks like he started the code changes. However he is missing examples.
The traffic speed layers on http://www.10miles.be-mobile.biz/web/apps/10miles/#/map are refreshed every minute, however it is using an older version of your excellent library.
Layer url is http://map.be-mobile.be/customer/mobileninja/nl/los/{z}/{x}/{y}.png.
I append a rand
query parameter to the url to force refresh, e.g. ?rand=0.7992366699036211
.
You should submit your changes, I'm sure I will find this one especially useful
@jessertaylor Unfortunately, that particular fix doesn't seem to work anymore. A fix like that used to work in previous versions (at least in the version of 27-10-2014). But this example might be useful, I haven't tested it yet for translations.
In layers.js there are checks to see if a layer needs to be deleted. These checks can be modified to make a layer refreshable: Line 76
becomes
and line 126
becomes
then you can do this:
and make an angular service refresh the layer every minute or so.