src/leaflet-arc.js
function _createLatLngs(line, from) {
    if (line.geometries[0] && line.geometries[0].coords[0]) {
        /**
         * stores how many times arc is broken over 180 longitude
         * @type {number}
         */
        let wrap = from.lng - line.geometries[0].coords[0][0] - 360;

        return line.geometries
            .map(subLine => {
                wrap += 360;
                return subLine.coords.map(point => L.latLng([point[1], point[0] + wrap]));
            })
            .reduce((all, latlngs) => all.concat(latlngs));
    } else {
        return [];
    }
}
function _createLatLngs(line, from) {
    if (line.geometries[0] && line.geometries[0].coords[0]) {
        /**
         * stores how many times arc is broken over 180 longitude
         * @type {number}
         */
        let wrap = from.lng - line.geometries[0].coords[0][0] - 360;

        return line.geometries
            .map(subLine => {
                wrap += 360;
                return subLine.coords.map(point => L.latLng([point[1], point[0] + wrap]));
            })
            .reduce((all, latlngs) => all.concat(latlngs));
    } else {
        return [];
    }
}
function _createLatLngs ( line , from ) { if ( line . geometries [ 0 ] && line . geometries [ 0 ] . coords [ 0 ] ) { /**
         * stores how many times arc is broken over 180 longitude
         * @type {number}
         */ let wrap = from . lng - line . geometries [ 0 ] . coords [ 0 ] [ 0 ] - 360 ; return line . geometries . map ( subLine => { wrap += 360 ; return subLine . coords . map ( point => L . latLng ( [ point [ 1 ] , point [ 0 ] + wrap ] ) ) ; } ) . reduce ( ( all , latlngs ) => all . concat ( latlngs ) ) ; } else { return [ ] ; } }
Create array of L.LatLng objects from line produced by arc.js
@param {object} line
@param {L.LatLng} from
@private
@returns {Array}
Create array of L . LatLng objects from line produced by arc . js