Skip to content

Commit a343ee7

Browse files
committed
Improve documentation for coordinate projection functions to follow Dart standards
1 parent 41bfee5 commit a343ee7

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

lib/src/helpers.dart

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ num convertArea(num area,
203203
}
204204

205205

206-
/// Converts coordinates from one system to another
207-
/// Valid systems: wgs84, mercator
208-
/// Returns: Array of coordinates in the target system
206+
/// Converts coordinates from one system to another.
207+
///
208+
/// Valid systems: [CoordinateSystem.wgs84], [CoordinateSystem.mercator]
209+
/// Returns: [List] of coordinates in the target system
209210
List<double> convertCoordinates(
210211
List<num> coord,
211212
CoordinateSystem fromSystem,
@@ -224,9 +225,10 @@ List<double> convertCoordinates(
224225
}
225226
}
226227

227-
/// Converts a WGS84 coordinate to Web Mercator
228-
/// Valid inputs: Array of [longitude, latitude]
229-
/// Returns: Array of [x, y] coordinates in meters
228+
/// Converts a WGS84 coordinate to Web Mercator.
229+
///
230+
/// Valid inputs: [List] of [longitude, latitude]
231+
/// Returns: [List] of [x, y] coordinates in meters
230232
List<double> toMercator(List<num> coord) {
231233
if (coord.length < 2) {
232234
throw Exception("coordinates must contain at least 2 values");
@@ -252,9 +254,10 @@ List<double> toMercator(List<num> coord) {
252254
return [clampedX, clampedY];
253255
}
254256

255-
/// Converts a Web Mercator coordinate to WGS84
256-
/// Valid inputs: Array of [x, y] in meters
257-
/// Returns: Array of [longitude, latitude] coordinates
257+
/// Converts a Web Mercator coordinate to WGS84.
258+
///
259+
/// Valid inputs: [List] of [x, y] in meters
260+
/// Returns: [List] of [longitude, latitude] coordinates
258261
List<double> toWGS84(List<num> coord) {
259262
if (coord.length < 2) {
260263
throw Exception("coordinates must contain at least 2 values");

0 commit comments

Comments
 (0)