How to use @turf/kinks - 3 common examples

To help you get started, we’ve selected a few @turf/kinks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github geoman-io / leaflet-geoman / src / js / Edit / L.PM.Edit.Line.js View on Github external
hasSelfIntersection() {
    // check for self intersection of the layer and return true/false
    const selfIntersection = kinks(this._layer.toGeoJSON(15));
    return selfIntersection.features.length > 0;
  },
github geoman-io / leaflet-geoman / src / js / Draw / L.PM.Draw.Line.js View on Github external
hasSelfIntersection() {
    // check for self intersection of the layer and return true/false
    const selfIntersection = kinks(this._layer.toGeoJSON(15));
    return selfIntersection.features.length > 0;
  },
  _syncHintLine() {
github geoman-io / leaflet-geoman / src / js / Edit / L.PM.Edit.Line.js View on Github external
if (flash) {
        layer.setStyle({ color: 'red' });
        this.isRed = true;

        window.setTimeout(() => {
          layer.setStyle({ color: this.cachedColor });
          this.isRed = false;
        }, 200);
      } else {
        layer.setStyle({ color: 'red' });
        this.isRed = true;
      }

      // fire intersect event
      this._layer.fire('pm:intersect', {
        intersection: kinks(this._layer.toGeoJSON(15)),
      });
    } else {
      // if not, reset the style to the default color
      layer.setStyle({ color: this.cachedColor });
      this.isRed = false;
    }
  },

@turf/kinks

turf kinks module

MIT
Latest version published 3 years ago

Package Health Score

78 / 100
Full package analysis

Popular @turf/kinks functions