If an anonymous user visits a Drupal web site that has User Location turned on, Device Geolocation should provide the users location data such that Views and other features which use the Users Location will take the user's location from Device Geolocation. Example:

1. User visits web site anonymously on a mobile device
2. User is prompted "Website wants to use your location"
3. User says "Allow"
4. Web site has a view that integrates with User Location
* Web site displays content specific to the anonymous users location. Wow!

-alternately-

Expose Device Geolocation data to Views to support a scenario as above.

Fantastic module, by the way!

Comments

tronathan’s picture

I was able to hack this into Views for Sorting using the following:

Origin: Use PHP code for latitude, longitude:

return array('latitude' => $_SESSION['smart_ip']['location']['latitude'], 'longitude' => $_SESSION['smart_ip']['location']['longitude']);

Only local images are allowed.

http://img.skitch.com/20101227-q58t3ny2ni5y9te5j3fd3d37c5.jpg

arpeggio’s picture

Status: Active » Postponed (maintainer needs more info)

Yes, we can use that code with the Views and Location modules installed. Thank you for sharing.
BTW, you refer a "User Location" in your first post. Is "User Location" a module? I have searched Drupal and I can't find "User Location" project...

jenna.tollerson’s picture

User Locations is dependent on Location and is included with the Location module download.

arpeggio’s picture

@jenna.tollerson thank you for the info. Some useful links related to this thread:
http://drupal.org/node/944284#comment-4392574
#1253460: Smart ip patch for views location proximity fitler

ankit.goyal5’s picture

Hi tronathan,

I am not able to locate the link where i need to past this code.
I have smart ip, location module enabled.
I am getting the value of location of user through ip but, it depends on the user.
Once the user come to my site as per Smart Ip module it will ask user to share his location.
once he will do that and refresh the page the local weather will come.
but i want to fetch user location dynamically, i dont want to ask for share location.

at the time user come to see site the local weather needs to come

Please help me...

arpeggio’s picture

Status: Postponed (maintainer needs more info) » Fixed

Hi agoyal5, the Smart IP/Device Geolocation has a feature where you can list pages that will not ask to share user's location. At your Smart IP admin page there is textarea with label "Ask user's geolocation on specific Drupal native pages", you can list the pages that you don't want to ask to share user's location. Thanks.

ankit.goyal5’s picture

Thanks Arpeggio.
i have seen that admin page looks promising.. but
will it take location automatically then.... my server is in maintenance up to some days, so i cant check it.

on the pages where is no sharing and if it will take it automatically then it solve my problem...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.