Wildhoney / Leaflet.FreeDraw

:earth_asia: FreeDraw allows the free-hand drawing of shapes on your Leaflet.js map layer – providing an intuitive and familiar UX for creating geospatial boundaries similar to Zoopla and others. Included out-of-the-box is the concaving of polygons, polygon merging and simplifying, as well as the ability to add edges and modify existing shapes.
https://freedraw.herokuapp.com/
MIT License
544 stars 103 forks source link

draw polygon when second time #119

Closed zhuyinjing closed 6 years ago

zhuyinjing commented 6 years ago

hi, i use it in my code:

drawpolygon (annotationTypeName, color, img, dataSetName) {
      console.log(this.freeDraw)
      const tileURL = this.deepzoomServer + img + '/{z}/{x}_{y}.jpeg?random=' + Math.random()
      L.tileLayer(tileURL).addTo(this.map)
      /* eslint-disable */
      var freeDraw = new FreeDraw({
        mode: FreeDraw.ALL,
        mergePolygons: false
      })

      this.freeDraw = freeDraw
      this.map.addLayer(this.freeDraw)
}

when i click brush-pencil , it calls drawpolygon function and when i click brush-pencil the twice time, the polygon background color is deeper than the first time.. what's wrong with my code? thanks a lot!!! 2018-04-04 16-47-38 ![Uploading 2018-04-04 16-48-17屏幕截图.png…]()