I am trying to add polyline in my existing leaflet map. But unfortunately its not overlapping the correct coordinates.

enter image description here

this.testd = [
            [26.946345158021394, 45.30658810117468], [31.74737690870502, 58.27657611253403], [3.572373155835759, 50.87794848675696]

        this.pathLine = L.polyline(this.testd);

Please let me know how to make it work.


Correct order of coordinates when specifying geographical points in Leaflet is [latitude, longitude], so you have to reverse your coordinates in this.testd array.

  • Yeah i got that. Such a silly mistake. Now i am using : L.GeoJSON.coordsToLatLngs(filteredFeatureDataCoordinates); to swap and solve. – TrickOrTreat Jul 30 '19 at 8:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.