Any way to prevent generalization of features?

741
2
Jump to solution
10-19-2012 02:29 PM
SteveCole
Frequent Contributor
Me again. 😄

I've been steadily knocking down many issues with my app and here's another one that I can't satisfactorily tackle using maxAllowableOffset.

My app loads at the full extent of my county. If I select a project from a combo box, the map will then zoom into the extent of the project's feature. The attached screenshot shows you what is returned after the zoom in. The line basically straight lines from end to end instead of following the shape of the road (note the curves at the south end of the project). As the user zooms in and out of the map, the graphic representation of the features gets better and better.

Since the feature layers I'm interested in only have ~30 records max, is there a way to specify that the features are ALWAYS drawn at the highest detail possible? I've tried adding a setMaxAllowable tied to the map's onZoomEnd event but it doesn't seem to correct the issue I see:

var maxOffset = function maxOffset(map, pixelTolerance) {   return Math.floor(map.extent.getWidth() / map.width) * pixelTolerance; }; . . .  dojo.connect(map, 'onZoomEnd', function() {       dojo.forEach(mapLayers, function(fl) {   fl.setMaxAllowableOffset(maxOffset(map,1));    });  });


Steve

[ATTACH=CONFIG]18593[/ATTACH]
0 Kudos
1 Solution

Accepted Solutions
JohnGravois
Frequent Contributor
0 Kudos
2 Replies
JohnGravois
Frequent Contributor
have you tried calling setAutoGeneralize(false)?
0 Kudos
SteveCole
Frequent Contributor
Thanks, John! I was not aware of that option. Once I did set it, it rendered my features with full detail.
0 Kudos