Can MaxAllowableOffset use a factor, rather than a number?

751
4
01-16-2011 05:13 PM
StephenLead
Regular Contributor III
http://help.arcgis.com/EN/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/featurelayer.htm shows that a featureLayer can have a MaxAllowableOffset value, which can be useful in quickly drawing a complex layer (simplying it on-the-fly rather than trying to draw every vertex exactly).

The problem is that the applicable offset value will usually change depending on the current map scale. Eg, at a state level an applicable offset might be 100 meters, while at street level it will be 1 meter.

Is there a way to accommodate this using the MaxAllowableOffset parameter? Because the MaxAllowableOffset parameter is found under the New keyword, can it be changed as the scale changes?

Ideally this parameter should be configurable as a factor, eg 1/1000 of the current map width or similar.

Thanks,
Steve
0 Kudos
4 Replies
StephenLead
Regular Contributor III
In case anyone else needs to know, the answer is to use layer.setMaxAllowableOffset to change the value of an existing layer.

If you change this on the onZoomEnd event, you can set it to the appropriate value for any scale.
0 Kudos
StephenLead
Regular Contributor III
FYI, we've just published a new version of our site, which now uses setMaxAllowableOffset to change the layer simplification on-the-fly.

See http://atlas.nsw.gov.au/public/nsw/home/map/population.html for an example - there shouldn't be any visible gaps between the polygons, but they are simplified to reduce the download size.
0 Kudos
bbieb
by
Occasional Contributor
Just a comment on your map, it is very well done.
brian
brian
0 Kudos
StephenLead
Regular Contributor III
Thanks Brian, glad you like it!
0 Kudos