GPS Location widget: Possibility to set a default location

  • Molsen66
    Asked on November 2, 2017 at 1:09 AM

    Hi there,

    I'm trying to find out a way to copy the longitude vale and latitude value into separate text fields once they have selected a GPS location within the map.

    Currently they only show up inside the widget but i want them to display inside a text field as well.

    I tried adding a condition to replicate the values in other fields but I could not get it to work since I couldn't select the address map selectors fields.

    Is there some css code that I might be able to use to extract that data out of the widget and replicate it in another field?

     

    Cheers,

    Marty

  • BJoanna
    Replied on November 2, 2017 at 4:45 AM

    Unfortunately, that is not possible to achieve. Longitude and latitude are not input fields and they do not have field ID. 

    You can only pass all values to another field, with for example conditional logic, but it is now possible to separate only longitude and latitude.

    1509612201address Screenshot 10

    Here is a demo form: https://form.jotform.com/73052419651959 

  • Molsen66
    Replied on November 4, 2017 at 6:43 AM
    Ah thats a shame.
    Is there a widget or map plugin that has the longitude and latitude values
    in seperate field ID's?
    Would you have the contact information for the team that built address map
    locator?
    I'm hoping to find a solution as this will be a vital part of how I setup
    my location forms and surveys.
    Cheers,
    Marty
    ...
  • Elton Support Team Lead
    Replied on November 4, 2017 at 10:53 AM

    We can only submit that as an enhancement request for that widget but we can't provide you any time frame to when it would be implemented.

    Meantime, I've found a workaround using GPS Location Widget and Substring Widget.

    Demo: https://form.jotform.com/73074072590960

    Will this help?

    You can clone the form so you can use it and check the widget and its configuration.

    The GPS widget captures the latitude and longitude while the substring widget splits the result.

  • Molsen66
    Replied on November 4, 2017 at 5:43 PM
    That's fantastic, exactly what I needed.
    Thanks a lot,
    Marty
    Sent from my iPhone
    ...
  • Molsen66
    Replied on November 5, 2017 at 8:43 PM
    Hey,
    Just a follow up question.
    is it possible to set a default location with the GPS location widget?
    I'm trying to avoid the browser asking for the users location each time on
    load up.
    If I have a default location it will avoid the need to ask a users
    permission and will work better as a navigational map.
    Marty
    ...
  • BJoanna
    Replied on November 6, 2017 at 1:58 AM

    Unfortunately, the GPS Location widget does not have a default option. I will raise your request for a default option to our developers. However, we can not provide you the exact time when and if this will be implemented. 

    If you want to capture the users location by default, you can use Get Visitors Location widget. You can also use the Substring widget to separate the longitude and latitude.

    Here is a demo form: https://form.jotform.com/73091187351961 

    Feel free to test it and clone it.  

  • Molsen66
    Replied on November 6, 2017 at 5:43 AM
    Ah thats a shame as a default location would solve the issue of asking each
    user if they want to have their location recorded.
    I plan on using the map as a search map more so than gathering knowledge of
    my users location so it really isn't necessary to grab their current
    location at all.
    Would any of the other widgets allow a default location and also offer a
    longitude and latitude value through substring widget?
    ...
  • Ashwin JotForm Support
    Replied on November 6, 2017 at 8:35 AM

    Have you checked our "Get Visitors Location" widget already as suggested by my colleague already? Do try it out and get back to us if you have any question.

    We have already created a feature request ticket and forwarded it to our backend team. We will get back to you as soon as we have any update from our backend team.

  • Molsen66
    Replied on November 9, 2017 at 10:43 PM
    Hi there,
    Unfortunately I still need a map window for the user to use so they can see
    their searched location visually which I can't see as an option with "Get
    visitors location".
    I'm back in my form at the minute and I've noticed that the search bar in
    (gps location) widget no longer works and every time I try to search an
    area I get an error message which I have attached.
    I can drag the location pin around and it will update to the correct
    address but I can not use the search feature.
    Is there a simple fix to this? It has been working fine for last week.
    https://form.jotform.co/72987593497885
    Cheers,
    Marty
    ...
  • BJoanna
    Replied on November 10, 2017 at 2:28 AM

    We are not able to see your attachment. Please note that the files that are attached inside of an email will not be shown here on the forum. You have to open this thread an upload your screenshot

    I tested the form you provided and the search field of GPS Location widget is working properly on my end. 

    1510298858search Screenshot 10

    Which browser and device are you using?

    If your form is embedded, please provide us the webpage URL.

  • Molsen66
    Replied on December 3, 2017 at 5:59 AM

    Hi there,

    My maps having been working well using GPS location and the sub string widgets as displayed above.

    I have noticed though that certain areas on the map don't display correctly in the longitude and latitude examples from above.

    For example if you use search for Sri lanka in your demo above you will see that the longitude sub string widget displays it as (0.77180) instead of (80.77180).

    This setup works all over the world except for just above the equator line where is misses the first value of the longitude.

    The easiest way to see what I'm talking about is to manually drag the map pointer to just above the equator line in your demo and you will see the widget getting confused.

    Would there be a fix to this?

    Cheers,


    Marty

  • Ashwin JotForm Support
    Replied on December 3, 2017 at 7:37 AM

    I did test the demo form which was shared earlier and I am able to replicate the issue you are having. It seems to be caused because of the incorrect Substring start value of the Substring widget in the demo form.

    I would suggest you to please test the following cloned form where I have corrected this and see if it works as expected:  https://form.jotform.com/73362998477981 

    Feel free to clone this form for a closer look. The following guide should help you in form cloning:  https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL 

    Hope this helps.

    Do get back to us if you have any questions.

  • Molsen66
    Replied on December 3, 2017 at 4:43 PM
    Thanks for looking into this for me.
    That's fixed the issue for locations close to the equator but has created another problem where it copies the comma into the longitude value for places like Antartica and Australia. Is there a way to remove this?
    Marty
    Sent from my iPhone
    ...
  • jonathan
    Replied on December 3, 2017 at 5:24 PM

    This is about a different feature and not related to the current issue originally reported.

    I created a separate thread for discussion here https://www.jotform.com/answers/1313385

    We will attend to it shortly.