When a user manually enters lat/lon coordinates, at the moment they need to enter "decimal" values like

-38.032997, 145.303297

when the more natural system (for lat/lon aware users, like pilots) would be

38° 1' 58.7892" S, 145° 18' 11.8692" E

In fact this latter format is actually used to display coordinates. Please add support for parsing the lat/lon entered from this (and similar) formats.

Comments

lyricnz’s picture

StatusFileSize
new3.34 KB

Here's a patch that adds support for three different formats to Location lat/lon entry:

  • decimal number with optional trailing NSEW identifier (this includes simple floats)
  • full DMS format (as emitted by module) 36° 52' 30.8316" S or any logical subset of that
  • another format commonly used by pilots (degrees plus decimal minutes) S37 50.810
  • lyricnz’s picture

    Status: Active » Needs review
    StatusFileSize
    new1.74 KB

    And a bit of simpletest that exercises the main function in previous patch.

    SebCorbin’s picture

    Status: Needs review » Needs work

    This should be tested using location picker from gmap module also. (currently breaking the thing)

    lyricnz’s picture

    Kindof uninterested in testing, given that this patch has been languishing with no comments for 5 months.

    lyricnz’s picture

    What problem did you experience with gmap location picker? I just tested latest -dev of location and gmap, and it worked fine.

    SebCorbin’s picture

    StatusFileSize
    new2.62 KB

    With latest stable version of both of the modules I got a javascript problem, it tries to insert the d/m/s lat/lon into the marker values. Indeed it's not working and I got a "NaN" in my field after losing focus.

    I did a overriding javascript file to passby this error and convert with a regex a degrees minutes seconds to decimal while losing focus, attaching it...

    yesct’s picture

    Alkaaran: can you post a step by step with how to replicate your issue (try it on a blank test site and post the steps you do)

    lyricnz: thanks for taking another look, even though the issue is old. There have been recent commits in location, so all hope is not lost! activity in the issue queue could pick up.

    lyricnz’s picture

    Alkaaran: this patch will be applied to -dev codebase, so you should test with -dev. (neither Location or Gmap modules have had a release in 16 months - a lot has changed since then).

    dwhutton’s picture

    I am experiencing this same problem in trying to get Gmap / Location to accept coordinates in other formats.
    I'm using Gmap 6.x-1.1 and Location 6.x-3.1

    I've already patched location.module using the patch provided in post #1, but still get 'NaN' in the coordinates box when trying to enter non-decimal coordinates.

    I don't know how to apply the lockpicker patch provided in post #6. Can anyone point me in the right direction?

    legolasbo’s picture

    Issue summary: View changes
    Status: Needs work » Closed (outdated)

    Closing old D6 issues as D6 is end of life