i thought it would be great if the gmap.location module could also get location (apart from click) using the html5 way. here's a small modification to the locpick.js file, that will try and get location of the user. i suppose it would help in gathering data via mobile devices that are location aware.

and it still need some work..

Comments

patrickroma’s picture

Subscribe

patrickroma’s picture

Subscribe

youngelpaso’s picture

Subscribing

leewoodman’s picture

subscribing

podarok’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Needs work

all feature requests can be imported in 6.x version after committing em in major versions with backport afterwards
Can You make this ?

dercheffe’s picture

Issue summary: View changes

*push*. Nobody else interessted in this feature? Get the location field filled out via HTML 5 geolocation would be great if you have to add a new location and you don't know the address. especially great feature for mobile users with built in gps support.

leewoodman’s picture

This should be a standard feature of this module or am I missing a sub module which should be enabled? This feature is standard in GeoLocation module.

leewoodman’s picture

The above patch does ask if you want to allow the site to access your location but does not populate the relevant fields.

dercheffe’s picture

@leewoman: you're right with GeoLocation module.

@all:
If I want to "design" a user-friendly interface to store for example a hotel profile (and of course the location of a hotel) there're IMHO two ways to realise that:

  1. You can use the module combination of Address Field, Geofield, GeoPHP and Geocoder. Then you have geolocation. But in my opinion the adress field mask, is simply ugly. I think that a country specific adress field is not suitable for a hotel profile. It is suitable if you're have an online shop and you're shipping goods to your customers. Aside of this some countries aren't supported by address field
  2. You can use the location module in combination with the gmap module. It has a very intuitive user interface to store new locations. The only contra is, that you have no geolocation. In a time, where a lot of people use a mobile device and more and more drupal sites become responsive, this is a big restriction, for a user friedly drupal website.
leewoodman’s picture

Priority: Normal » Major

The ability to grab the location directly from the device is a must have for this module.

leewoodman’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
leewoodman’s picture

StatusFileSize
new724 bytes

Try this patch for the latest 7.x-2.x release

leewoodman’s picture

Status: Needs work » Needs review
podarok’s picture

Status: Needs review » Needs work
  1. +++ b/js/locpick.js
    @@ -72,6 +72,19 @@
    +               function (position) { // Success
    

    Do not use inline comments in such way, you are breaking Drupal coding standards

  2. +++ b/js/locpick.js
    @@ -72,6 +72,19 @@
    +               function (msg) { // Error
    

    Do not use inline comments in such way, you are breaking Drupal coding standards

  3. +++ b/js/locpick.js
    @@ -72,6 +72,19 @@
    +                 alert(msg);
    +               }
    

    This code looks like debugging code. Let's get rid of it
    If you really need this - just create a proper dialog window and do not use alerts. Thanks

dercheffe’s picture

@leewoodman: do we need the code podarok described in #15? What is it for? A commit-ready and standard compliant patch would be really great to improve this module. IMHO an essential feature. Thanks in advance :)