Select to view content in your preferred language

3.1 FeatureLayer bug?

530
4
08-10-2012 07:39 AM
ReneeMaxwell
Regular Contributor
When adding a FeatureLayer to the map with a minScale/maxScale property, those properties are ignored and the layer(s) display at all scales.

This does not occur in v3.0, just 3.1
0 Kudos
4 Replies
JohnGravois
Deactivated User
I took a look at our Feature Layer On Demand sample (linked below) and when I zoom out, the minimum scale of the Hydrology layer is definitely being honored.  Is the problem you are seeing specific to another drawing mode or a particular map/feature service?

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/fl_ondemand.html
0 Kudos
JohnGravois
Deactivated User
I did another quick test and added the following line to the sample and it appears that our Javascript methods for setting scale dependency are working as well.

featureLayer.setMaxScale(99999);


With a maximum scale of 99999, in conjunction with the minimum scale interpreted from the map service of 100000, the hydrology layer wasn't drawing at all in my tests.

If you have any additional details about the error, please let us know.
0 Kudos
ReneeMaxwell
Regular Contributor
I loaded the layer in MODE_ONDEMAND and the layer loaded correctly. I had been using Snapshot mode before and that still fails. Thanks!

Setting scale dependency manually does work, but that shouldn't be necessary if the map service/featureLayer already has that property set by default.

Thanks again for your help.
0 Kudos
bobcarr
Occasional Contributor
I have posted a sample (http://jsfiddle.net/bob_carr/EB86S/) of the drawing errors which occur when using SNAPSHOT mode on services with scale-dependent layers.  Besides drawing at all scales, the second layer does not respond to panning or zooming.  The 'DOCTYPE' and CSS settings mentioned in other Forum posts about frozen panning are applied in this sample.

In our application (internal - not available for viewing), SNAPSHOT mode is preferred, as we have only 14 features for possible display, and are using the graphics attributes to change symbology for sub-sets of the 14 feature based on a selection from a drop-down menu.  We need to maintain this symbology through all zoom levels.  Our work-around has been to request the service providers create another map service with no scale-dependency for the unit polygons.  Would another possibility be to use ONDEMAND mode and pass the symbol settings from one layer to another when the zoom level triggers a layer change?
0 Kudos