You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was recently working with coordinates and thought of this helpful feature.
Explanation
Validating Latitude and Longitude is a frequent use case for many location-based applications and while @Min() and @Max() may be used in conjunction with lower and upper bounds respectively, a @IsCoordinate() solution would seem more appropriate.
@IsCoordinate(...) Arguments
Perhaps the data to be validated appears in comma-separated form (ie. latitude, longitude) so a boolean argument may tell the validation engine whether to check the input as singular lat/lng value or both in combination (as above).
Sure why not. But I would like to follow some standards as e.g. https://en.wikipedia.org/wiki/ISO_6709. There is multiple formats and we should cover them all or say exactly what formats we support.
Yeah that seems right. If we adopt the solutions that are present, this reduces the encounter with bugs ,also we do not have to search around for solutions @vlapo
Activity
rubiin commentedon Sep 11, 2019
@vlapo @NoNameProvided
vlapo commentedon Sep 25, 2019
Sure why not. But I would like to follow some standards as e.g. https://en.wikipedia.org/wiki/ISO_6709. There is multiple formats and we should cover them all or say exactly what formats we support.
rubiin commentedon Sep 25, 2019
@vlapo I think we can do like validatorjs https://github.com/validatorjs/validator.js/blob/master/lib/isLatLong.js
vlapo commentedon Sep 25, 2019
If there is validator.js solution let`s adopt them. Maybe we should check all missing validators from validator.js.
rubiin commentedon Sep 25, 2019
Yeah that seems right. If we adopt the solutions that are present, this reduces the encounter with bugs ,also we do not have to search around for solutions @vlapo
rubiin commentedon Sep 30, 2019
@vlapo @NoNameProvided I have adopted validatorjs solutiona and made isLatLong() function for this. #427 check this pull request
lock commentedon Oct 9, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.