21 reputation
14
bio website
location
age
visits member for 1 year, 9 months
seen Nov 8 '13 at 10:57

Mar
3
awarded  Notable Question
Jun
13
awarded  Popular Question
Nov
19
awarded  Supporter
Nov
19
comment openlayers toggle visibility of layer
Wow. Thanks! What an amazing answer! I needed those tips on debugging in the browser, that's help me get a grip on the problem. I think the main thing now is to implement my js properly as described in sites/all/modules/openlayers/docs/BEHAVIORS.txt - in other words as ever I need to rtfm! Thanks again. I'll report back!
Nov
17
revised openlayers toggle visibility of layer
added 265 characters in body
Nov
17
revised openlayers toggle visibility of layer
deleted 35 characters in body
Nov
17
revised openlayers toggle visibility of layer
added 302 characters in body
Nov
17
comment openlayers toggle visibility of layer
Thank you for your response, I'm using standard drupal code to deal with the $ namespacing ... I have updated the original post.
Nov
17
comment openlayers toggle visibility of layer
that's not it, sorry for not being clear: if I comment out the first line and uncomment the other lines and add alerts like this. // layers[0].setVisibility(true); // this doesn't work alert(layers[0].visibility); if (layers[0].visibility) { layers[0].setVisibility(false); } else { layers[0].setVisibility(true); } ... I get a first alert 'false' and a second 'true'
Nov
17
comment openlayers toggle visibility of layer
Thanks both. I have edited the code above to show the whole js that I am loading, including the drupal-specific parts (first/last 3 lines). I'm still not sure what's happening, not sure what 'the layer is trapped in a closure' means. When I find a way forward, I'll obviously come back here and post an update. Thanks again.
Nov
17
awarded  Editor
Nov
17
revised openlayers toggle visibility of layer
provided the full js code including drupal-specific elements
Nov
15
awarded  Student
Nov
15
asked openlayers toggle visibility of layer