Select to view content in your preferred language

JavaScript API 3.0 - Problems when adding/panning layers

1919
12
Jump to solution
06-19-2012 03:36 PM
by Anonymous User
Not applicable
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?
0 Kudos
12 Replies
AdrianMarsden
Honored Contributor
"CDN" ?

The issue is still very much a problem for myself and the person who just posted on the other thread.
0 Kudos
derekswingley1
Deactivated User
CDN, the URL where our API is hosted:  http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.0

I'll go take a look at the other thread.
0 Kudos
AdrianMarsden
Honored Contributor
In that case, could you reply to the other thread (which hasn't been answered) to say what is being done about that issue?
0 Kudos