Skip to content

[Feature Request] @IsCoordinate() / @IsLatitude() / @IsLongitude() #415

Closed

Description

@olafwrieden

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).

Possible Alternatives

  • @IsLatitude()
  • @IsLongitude()

Activity

  1. rubiin commented on Sep 11, 2019

    @rubiin
    Contributor
  2. vlapo commented on Sep 25, 2019

    @vlapo
    Contributor

    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.

  3. added
    type: feature
    on Sep 25, 2019
  4. rubiin commented on Sep 25, 2019

    @rubiin
    Contributor
  5. vlapo commented on Sep 25, 2019

    @vlapo
    Contributor

    If there is validator.js solution let`s adopt them. Maybe we should check all missing validators from validator.js.

  6. rubiin commented on Sep 25, 2019

    @rubiin
    Contributor

    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

  7. rubiin commented on Sep 30, 2019

    @rubiin
    Contributor

    @vlapo @NoNameProvided I have adopted validatorjs solutiona and made isLatLong() function for this. #427 check this pull request

  8. added this to the 0.10.2 milestone on Oct 2, 2019
  9. lock commented on Oct 9, 2019

    @lock

    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.

  10. locked as resolved and limited conversation to collaborators on Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: feature

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions