Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapping for polygon when editing #659

Open
nyrull opened this issue Dec 16, 2016 · 6 comments
Open

snapping for polygon when editing #659

nyrull opened this issue Dec 16, 2016 · 6 comments

Comments

@nyrull
Copy link

nyrull commented Dec 16, 2016

  • Leaflet version I'm using: 0.7.5
  • Leaflet Draw version I'm using: 3.0
  • Browser (with version) I'm using: chrome Version 54.0.2840.99 m
  • OS/Platform (with version) I'm using: win 10 64bit pro version 1511

Hi,im posting here because Leaflet.snap github look dead,as you can see i have already posted there :
makinacorpus/Leaflet.Snap#41

I can create polygon and when creating it will snap to existing one no problem,but when editing there is no snapping at all, if someone can tell me whats wrong !

some code,very basic :

$(document).ready(function () {
       var guideLayers = [];
  
        var   map = L.map('mapContainer', {
               layers: MQ.mapLayer(),
               center: [46.814184, -71.207425],
               zoomControl: true,
               zoom: 8
           });

        var   drawnItems = new L.FeatureGroup();
           map.addLayer(drawnItems);

         var   drawControl = new L.Control.Draw({
               draw: {
                   circle: false,
                   marker: false,
                   polyline: false,
                   rectangle:false,
                   polygon: {
                       guideLayers: guideLayers, 
                       snapDistance: 5,
                       allowIntersection: false,
                       showArea: true,
                       drawError: {
                           color: '#b00b00',
                           timeout: 1000
                       },
                   }
               },
               edit: {
                   featureGroup: drawnItems,
                   edit: true,
                   remove:false
               }
           });
            map.addControl(drawControl);
           
            map.on('draw:created', function (e) {
                var type = e.layerType,
                    layer = e.layer;         
                drawnItems.addLayer(layer);                                              
                guideLayers.push(layer);
            });           
          
       });

```javascript
@germanjoey
Copy link

germanjoey commented Dec 16, 2016 via email

@nyrull
Copy link
Author

nyrull commented Feb 9, 2017

HI ! Haven't heard of L.Snap since then ?
I have look at it and dont see any change.

Is it dead ?

@germanjoey
Copy link

germanjoey commented Feb 9, 2017 via email

@themre
Copy link

themre commented Feb 9, 2017 via email

@germanjoey
Copy link

germanjoey commented Feb 9, 2017 via email

@nyrull
Copy link
Author

nyrull commented Feb 9, 2017

Leaflet.PM look nice but i have too much stuff going on with Leaflet.Draw right now in my app. It would be too much work to change all the api.

Leaflet.SnapDraw sound good :)

It is sad to not have any news from L.Snap...

If you decide to fork Leaflet.Draw and Leaflet.Snap into a new project let me know ! Anyway, thx for your time , i really appreciate it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants