Sha256: e70b67055557aaafe6691d5045589180b0c2611fa45d192404d0a1988a9b88a9
Contents?: true
Size: 782 Bytes
Versions: 10
Compression:
Stored size: 782 Bytes
Contents
L.Polygon.include({ // Checks a polygon for any intersecting line segments. Ignores holes. intersects: function () { var polylineIntersects, points = this._originalPoints, len, firstPoint, lastPoint, maxIndex; if (this._tooFewPointsForIntersection()) { return false; } polylineIntersects = L.Polyline.prototype.intersects.call(this); // If already found an intersection don't need to check for any more. if (polylineIntersects) { return true; } len = points.length; firstPoint = points[0]; lastPoint = points[len - 1]; maxIndex = len - 2; // Check the line segment between last and first point. Don't need to check the first line segment (minIndex = 1) return this._lineSegmentsIntersectsRange(lastPoint, firstPoint, maxIndex, 1); } });
Version data entries
10 entries across 10 versions & 1 rubygems