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

reverseGeocode should use named parameters and follow API specification #50

Open
jt274 opened this issue Jun 1, 2024 · 1 comment
Open

Comments

@jt274
Copy link
Contributor

jt274 commented Jun 1, 2024

The reverse geocode documentation: https://radar.com/documentation/api#reverse-geocode says there are two input parameters, coordinates and layers.

The flutter documentation here: https://radar.com/documentation/sdk/flutter#geocoding shows a type Map<String, dynamic> input that uses latitude, longitude, and accuracy. There is no description of what accuracy does, one can only assume. There is also no mention of the layers parameter.

The reverseGeocode function should use named parameters, not a Map<String, dynamic> type which can easily be mistyped. It should include:

latitude (type double)
longitude (type double)
layers (type List<Layer>, using enum to avoid mistyped layer names)

Example:

final res = await Radar.reverseGeocode({
  latitude: 11.1234,
  longitude: 22.3456,
  layers: [
    Layer.place,
    Layer.address,
    Layer.state,
  ],
});

Additionally, the return type should not be Map<dynamic, dynamic>? (again to avoid mistyped parameter names), but have its own class.

@KennyHuRadar
Copy link
Contributor

This issues should be addressed here: #56 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants