Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Array traitment into latLngToCoords/latLngsToCoords #7436

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
minify code
  • Loading branch information
Falke-Design committed Apr 15, 2022
commit 693f7e72c17d0734ee65e853ec701069f7765ec2
6 changes: 2 additions & 4 deletions src/layer/GeoJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,9 @@ export function latLngToCoords(latlng, precision) {
export function latLngsToCoords(latlngs, levelsDeep, closed, precision) {
var coords = [];
for (var i = 0, len = latlngs.length; i < len; i++) {
var latlng;
if (!levelsDeep) { latlng = toLatLng(latlngs[i]); } else { latlng = latlngs[i]; }
coords.push(levelsDeep ?
latLngsToCoords(latlng, levelsDeep - 1, closed, precision) :
latLngToCoords(latlng, precision));
latLngsToCoords(latlngs[i], levelsDeep - 1, closed, precision) :
latLngToCoords(toLatLng(latlngs[i]), precision));
}

if (!levelsDeep && closed) {
Expand Down