3liz / lizmap-javascript-scripts

Scripts for Lizmap Web Client
Mozilla Public License 2.0
22 stars 41 forks source link

snap on many layers - script error #17

Closed josemvm closed 4 years ago

josemvm commented 4 years ago

hi @drillinP @mdouchin (and all users who have tried or want to try this script)

please, i would be very happy if i could use your script!

but in first, with an original configuration, i get this error:

snap

another question: how does it work?

i have a layer for edition, named LAYER_EDITION and i need to snap it with 3 layers (LAYER_A, LAYER_B and LAYER_C). how should i configure the script options?

// Options
var snapLayerName = '';

var snapLayers = {
        'LAYER_EDITION' : {
        'layers': [
             'LAYER_A',
         'LAYER_B',
         'LAYER_C'
        ],
        snapToNode: true,
        snapToEdge: false,
        snapToVertex: true
       }
}

thanks very much for your work and thanks in advance for your help

rldhont commented 4 years ago

Your configuration is right.

If you need that LAYER_EDITION's features have to snap to other LAYER_EDITION's features you have to add LAYER_EDITION to layers

rldhont commented 4 years ago

fixed by https://github.com/3liz/lizmap-javascript-scripts/commit/1ff41eeba74b8621e9cd81b80f43911b6f8b3f4e