GraphicsLayer hide/show

864
4
06-19-2012 01:39 PM
AamirSuleman
New Contributor II
This was working well with 2.8.

Browser version FF 13.0.1

Am using layerID.hide() & layerID.show() to toggle visibility on a GraphicsLayer.
Once I show(), the layer starts floating independently of the map.
Am using three graphicslayers.

Using setVisibility(true) helps to some extent (no pun intended). GraphicsLayer pan at the end of Map's Pan event.

Please help!
0 Kudos
4 Replies
MichaelLeahy
Esri Contributor
Your problem sounds very similar to what I have experienced - maybe you could take a look at the question I posted not long after you: http://forums.arcgis.com/threads/60374-JavaScript-API-3.0-Problems-when-adding-panning-layers

I haven't figured out an ideal workaround yet.  As far as I can tell, the appearance of this issue is dependent on the order in which feature and graphics layers are added and/or whether layers are visible when they are initially added.
0 Kudos
AamirSuleman
New Contributor II
Appears to work find now. At least for me. Can you confirm the same?
0 Kudos
MichaelLeahy
Esri Contributor
It does appear to be fixed...not sure how that could have happened without the API being updated.
0 Kudos
KellyHutchins
Esri Frequent Contributor
We updated version 3.0 of the JavaScript API last night to add a small patch to fix the graphics layer issue and a minor problem with the BasemapGallery. So if you re-test your code today using v3.0 the problem should be resolved.
0 Kudos