src/util/PolygonSplitter.js
function (points, intersections, iMap, pole) {
                var pointsClone;

                if (pole === Location.poles.NORTH) {
                    var intersection = intersections.shift();
                    var poleLat = 90;
                }
                else if (pole === Location.poles.SOUTH) {
                    intersection = intersections.pop();
                    poleLat = -90;
                }

                var iEnd = iMap.get(intersection.indexEnd);
                var iStart = iMap.get(intersection.indexStart);
                iEnd.forPole = true;
                iStart.forPole = true;

                this.poleIndexOffset = intersection.indexStart;

                pointsClone = points.slice(0, intersection.indexEnd + 1);
                var polePoint1 = this.createPoint(poleLat, points[iEnd.index].longitude, points[iEnd.index].altitude);
                var polePoint2 = this.createPoint(poleLat, points[iStart.index].longitude, points[iStart.index].altitude);
                pointsClone.push(polePoint1, polePoint2);
                pointsClone = pointsClone.concat(points.slice(this.poleIndexOffset));

                return pointsClone;
            }
function (points, intersections, iMap, pole) {
                var pointsClone;

                if (pole === Location.poles.NORTH) {
                    var intersection = intersections.shift();
                    var poleLat = 90;
                }
                else if (pole === Location.poles.SOUTH) {
                    intersection = intersections.pop();
                    poleLat = -90;
                }

                var iEnd = iMap.get(intersection.indexEnd);
                var iStart = iMap.get(intersection.indexStart);
                iEnd.forPole = true;
                iStart.forPole = true;

                this.poleIndexOffset = intersection.indexStart;

                pointsClone = points.slice(0, intersection.indexEnd + 1);
                var polePoint1 = this.createPoint(poleLat, points[iEnd.index].longitude, points[iEnd.index].altitude);
                var polePoint2 = this.createPoint(poleLat, points[iStart.index].longitude, points[iStart.index].altitude);
                pointsClone.push(polePoint1, polePoint2);
                pointsClone = pointsClone.concat(points.slice(this.poleIndexOffset));

                return pointsClone;
            }
function ( points , intersections , iMap , pole ) { var pointsClone ; if ( pole === Location . poles . NORTH ) { var intersection = intersections . shift ( ) ; var poleLat = 90 ; } else if ( pole === Location . poles . SOUTH ) { intersection = intersections . pop ( ) ; poleLat = - 90 ; } var iEnd = iMap . get ( intersection . indexEnd ) ; var iStart = iMap . get ( intersection . indexStart ) ; iEnd . forPole = true ; iStart . forPole = true ; this . poleIndexOffset = intersection . indexStart ; pointsClone = points . slice ( 0 , intersection . indexEnd + 1 ) ; var polePoint1 = this . createPoint ( poleLat , points [ iEnd . index ] . longitude , points [ iEnd . index ] . altitude ) ; var polePoint2 = this . createPoint ( poleLat , points [ iStart . index ] . longitude , points [ iStart . index ] . altitude ) ; pointsClone . push ( polePoint1 , polePoint2 ) ; pointsClone = pointsClone . concat ( points . slice ( this . poleIndexOffset ) ) ; return pointsClone ; }
Internal. Applications should not call this method.
Creates a new array of points containing the two pole locations on both sides of the anti-meridian

@param {Location[] | Position[]} points
@param {Array} intersections
@param {HashMap} iMap
@param {Number} pole
@return {Object} an object containing the new points and a new reIndexed iMap
Internal . Applications should not call this method . Creates a new array of points containing the two pole locations on both sides of the anti - meridian