Drawing snapping

477
0
03-18-2013 04:33 AM
AdrianMarsden
Occasional Contributor III
HI

I have this chunk of code that sets the snapping environment to a specific sublayer in a map service

    var snappinglayer = new esri.layers.FeatureLayer(mapservice1 + "/6", {
        mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
        outFields: ["*"]
    });
    var snapManager = map.enableSnapping({ snapKey: dojo.keys.copyKey });
    snapManager.tolerance=15;
    var layerInfos = [{ layer: snappinglayer }];
    snapManager.setLayerInfos(layerInfos);




When the CTRL key is held down whilst drawing a new polygon, I get the default blue cross on the required layer, but the drawing doesn't snap to it at all

[ATTACH=CONFIG]22690[/ATTACH]

See image.  If I remove the layer requirements the new drawing polygon will ONLY snap to previously drawn user graphics.  But it does work exactly as it should.

Prior to patching with SP1 the time taken for the blue cross to move on my required layer was painful.  With SP1 it at least moves at a OK speed, but simply doesn't snap

Have I missed something?

Cheers

ACM
0 Kudos
0 Replies