1

I want to add more than one layer to snapping in map

var layerInfos = [

  {layer:results[0].layer}

];

snappingManager.setLayerInfos(layerInfos);
2
  • Welcome to GIS SE! As a new user be sure to take the Tour to learn how this site works. What GIS software are you using here?
    – PolyGeo
    Dec 5 '15 at 9:00
  • thanks for your advice i am building a gis application using arcgis javascript api
    – Hassan
    Dec 5 '15 at 9:22
1
var snapToTheseLayers = [

  {layer: layer1},
  {layer: layer2}, ...//add as many layers as you want

];

snappingManager.setLayerInfos(snapToTheseLayers );
2
  • Please edit provide context for your answer.
    – MaryBeth
    Jan 26 '16 at 14:16
  • not sure what context is needed, took what max4ever suggested and applied it to ESRI's 'Measurement Widget' example here and it worked great,
    – Tom_s
    Jun 9 '16 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.