AnsweredAssumed Answered

JavaScript API 3.0 - Problems when adding/panning layers

Question asked by mleahyesri-ca-esridist Employee on Jun 19, 2012
Latest reply on Jun 27, 2012 by amarsden
Hello JSAPI folks,

I have found that when I upgrade to 3.0, and account for all of the noted changes needed to make the transition from 2.x, I find that there are problems panning the map when multiple feature and or graphics layers are added .

After a fair bit of debugging, I have narrowed this down to at least one clearly repeatable scenario.  If a featureLayer is added to the map, then I create a new graphics layer with visible set to false, add this layer to a map, then make the graphics layer visible, the initially added feature layer seems to be 'forgotten' by the map when you pan.

I have attached a modified copy of one of the JavaScript API samples that are now using version 3.0 of the API.  If you open this sample in a web browser, you'll see a green dot added to a graphics layer near the centre of the map.  When you pan the map, the base layer and the graphics layer will move, but the feature layer (showing the great lakes) will remain static.

If the feature layer is added after the graphics layer is added, or if the graphics layer is visible when it is first added, this problem does not occur.

The comments in the sample HTML document should help explain what's going on.

Would this be considered a bug?

Attachments

Outcomes