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
Merge main
  • Loading branch information
Falke-Design committed Apr 15, 2022
commit 8132b812c5f416e128c673050ccf9d344fe7c648
9 changes: 4 additions & 5 deletions src/layer/GeoJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,10 @@ export function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) {
// Reverse of [`coordsToLatLng`](#geojson-coordstolatlng)
// Coordinates values are rounded with [`formatNum`](#util-formatnum) function.
export function latLngToCoords(latlng, precision) {
precision = typeof precision === 'number' ? precision : 6;
var Truelatlng = toLatLng(latlng);
return Truelatlng.alt !== undefined ?
[Util.formatNum(Truelatlng.lng, precision), Util.formatNum(Truelatlng.lat, precision), Util.formatNum(Truelatlng.alt, precision)] :
[Util.formatNum(Truelatlng.lng, precision), Util.formatNum(Truelatlng.lat, precision)];
latlng = toLatLng(latlng);
return latlng.alt !== undefined ?
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision), Util.formatNum(latlng.alt, precision)] :
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision)];
}

// @function latLngsToCoords(latlngs: Array, levelsDeep?: Number, closed?: Boolean, precision?: Number|false): Array
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.