Bitcoin Forum
June 16, 2024, 11:02:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Google maps on check out to determine customer location  (Read 640 times)
weedo84 (OP)
Full Member
***
Offline Offline

Activity: 145
Merit: 100


View Profile
July 04, 2015, 05:46:09 AM
Last edit: July 04, 2015, 08:13:17 PM by weedo84
 #1

Hi everyone,

I'd really appreciate if someone has any idea how to integrate Google maps to determine customer location upon checkout.

Customer pays --> customer clicks "allow share location" --> we deliver to customer.



Need your help with this one. Thank you.
NyeFe
Hero Member
*****
Offline Offline

Activity: 699
Merit: 500


View Profile
July 04, 2015, 06:40:22 AM
 #2

We trailed this idea on one of our tests. It worked out great  Wink

You can find it HERE the code is written using JavaScript I.e. It's open-source [...]

MicroDApp.com—Smart Contract developers. Lets build a decentralized future!
weedo84 (OP)
Full Member
***
Offline Offline

Activity: 145
Merit: 100


View Profile
July 04, 2015, 06:58:34 AM
 #3

Hi- Thanks,

Do you mean the example is on the "settings" of your platform?
NyeFe
Hero Member
*****
Offline Offline

Activity: 699
Merit: 500


View Profile
July 04, 2015, 07:27:35 AM
Last edit: July 04, 2015, 07:46:48 AM by NyeFe
 #4

Hi- Thanks,

Do you mean the example is on the "settings" of your platform?


That's correct. Copy, paste and adjust this code to meet your demands. It's all you need.


Download and insert the script /js/helpers/gmaps.min.js to your site


Quote
function loadLocationWrong() {    buttonWrong.style.visibility = 'hidden';    retry.style.visibility = 'visible';    //.removeAttribute("readonly");     if (address.value != '') {        address.removeAttribute("readonly");    }    if (city.value != '') {        city.removeAttribute("readonly");    }    if (region.value != '') {        region.removeAttribute("readonly");    }    if (country.value != '') {        country.removeAttribute("readonly");    }    //enable other button... location-text-address-retry   // $("location-text-address").attr("readonly", false);} function loadLocation() {     //location-text-state-city    //location-text-country      buttonWrong.style.visibility = 'visible';     if (navigator.geolocation) {         var iscoords = true;        navigator.geolocation.getCurrentPosition(function(position){            loadPosition(position, true);        });      } else {    //ask to upgrade browser.    }  } function loadPosition(position, iscoords) {     if (iscoords === true) {        geocoder.geocode({ 'address': position.coords.latitude + "," + position.coords.longitude }, function (data, status) {             sortAddress(data);         });    } else if (iscoords === false) {         retry.style.visibility = 'hidden';        address.readOnly = true;        city.readOnly = true;        region.readOnly = true;        country.readOnly = true;          geocoder.geocode({ 'address': address.value + ", " + city.value + ", " + region.value + ", " + country.value }, function (results, status) {             sortAddress(results);         });      }    /*   state.value = position.coords.latitude;         country.value = position.coords.longitude;    */ }


-----------------------------------------Additional--Items-----------------------------------------


View source


Focus on functions:

loadLocation
loadPosition
loadLocationWrong


MicroDApp.com—Smart Contract developers. Lets build a decentralized future!
weedo84 (OP)
Full Member
***
Offline Offline

Activity: 145
Merit: 100


View Profile
July 04, 2015, 08:15:32 PM
 #5

Hi- Thanks,

Do you mean the example is on the "settings" of your platform?


That's correct. Copy, paste and adjust this code to meet your demands. It's all you need.


Download and insert the script /js/helpers/gmaps.min.js to your site


Quote
function loadLocationWrong() {    buttonWrong.style.visibility = 'hidden';    retry.style.visibility = 'visible';    //.removeAttribute("readonly");     if (address.value != '') {        address.removeAttribute("readonly");    }    if (city.value != '') {        city.removeAttribute("readonly");    }    if (region.value != '') {        region.removeAttribute("readonly");    }    if (country.value != '') {        country.removeAttribute("readonly");    }    //enable other button... location-text-address-retry   // $("location-text-address").attr("readonly", false);} function loadLocation() {     //location-text-state-city    //location-text-country      buttonWrong.style.visibility = 'visible';     if (navigator.geolocation) {         var iscoords = true;        navigator.geolocation.getCurrentPosition(function(position){            loadPosition(position, true);        });      } else {    //ask to upgrade browser.    }  } function loadPosition(position, iscoords) {     if (iscoords === true) {        geocoder.geocode({ 'address': position.coords.latitude + "," + position.coords.longitude }, function (data, status) {             sortAddress(data);         });    } else if (iscoords === false) {         retry.style.visibility = 'hidden';        address.readOnly = true;        city.readOnly = true;        region.readOnly = true;        country.readOnly = true;          geocoder.geocode({ 'address': address.value + ", " + city.value + ", " + region.value + ", " + country.value }, function (results, status) {             sortAddress(results);         });      }    /*   state.value = position.coords.latitude;         country.value = position.coords.longitude;    */ }


-----------------------------------------Additional--Items-----------------------------------------


View source


Focus on functions:

loadLocation
loadPosition
loadLocationWrong


Thank you for your work, and info here.
xmaxbit
Full Member
***
Offline Offline

Activity: 196
Merit: 100



View Profile
July 05, 2015, 08:09:07 PM
 #6

Locations are based on Ip addresses and ip addresses may be different because people use vpn or proxies . How are you guys integrating google maps to track them up accurately ? Well this is a nice idea by the way .
NyeFe
Hero Member
*****
Offline Offline

Activity: 699
Merit: 500


View Profile
July 05, 2015, 09:11:54 PM
 #7

Locations are based on Ip addresses and ip addresses may be different because people use vpn or proxies . How are you guys integrating google maps to track them up accurately ? Well this is a nice idea by the way .

Well Google, kindly collects massive amounts of geodata, physically,  which span over a period of years. With the use of geolocation, we can use the MAC address and siganl, which were all gathered by Google, to accurately locate a user as close as street levels. Normally we were limited to City level when using IP address for tracking, but with the use of MAC address well [...]
In addition, since we're using GPS to determine the location, the results are not impacted on, no matter how the user accesses the website I.e. using proxy or vpn unlike IP-based geolocation methods [...]

MicroDApp.com—Smart Contract developers. Lets build a decentralized future!
kolloh
Legendary
*
Offline Offline

Activity: 1736
Merit: 1023


View Profile
July 06, 2015, 12:46:42 AM
 #8

Seems like this wouldn't be 100% accurate all the time. Seems better to just request the user's address lol. How are you gonna know specifically which house they are at? Wouldn't the location only be an approximation?
TheButterZone
Legendary
*
Offline Offline

Activity: 3010
Merit: 1031


RIP Mommy


View Profile WWW
July 06, 2015, 02:01:00 AM
 #9

Seems like this wouldn't be 100% accurate all the time. Seems better to just request the user's address lol. How are you gonna know specifically which house they are at? Wouldn't the location only be an approximation?

Not to mention multi-family dwellings, it can't tell which apartment number, or if you're in an apartment building complex within a street address number range, like 2000-2500 Broadway. I'd say it's only useful as specific as split directional streets like North Broadway vs South Broadway if the customer forgets to put the directional, or gross numerical errors like the customer is at 350 Broadway but they put 3500. Also, you'd have to put in an override for "this is a gift, ship directly to recipient" so the GPS is ignored.

Saying that you don't trust someone because of their behavior is completely valid.
NyeFe
Hero Member
*****
Offline Offline

Activity: 699
Merit: 500


View Profile
July 06, 2015, 05:27:14 AM
Last edit: July 06, 2015, 06:55:03 AM by NyeFe
 #10

Seems like this wouldn't be 100% accurate all the time. Seems better to just request the user's address lol. How are you gonna know specifically which house they are at? Wouldn't the location only be an approximation?

Not to mention multi-family dwellings, it can't tell which apartment number, or if you're in an apartment building complex within a street address number range, like 2000-2500 Broadway. I'd say it's only useful as specific as split directional streets like North Broadway vs South Broadway if the customer forgets to put the directional, or gross numerical errors like the customer is at 350 Broadway but they put 3500. Also, you'd have to put in an override for "this is a gift, ship directly to recipient" so the GPS is ignored.

The purpose would be to fill-in most of the address for the user [...] We needed to stick to a strict format because two or more users could write the same address, for different houses in the same street, two or more different ways and it would still lead to the same location. Since we used the data for mapping-out locations on our map, which is also used by our wallet, app, shopping, exchanges and SMS services for authentication, it meant every address must follow a special format [...] Address name, postcode, locality, street, administrative level 1 (up to administrative level 5) country name, ISO code, and longitude & latitude.
As you can see, this is a pritty large amount of data to easily input, edit and get correct, for each user (especially the coordinates) which would obviously cause stressfulness to our users [...] The part which is normally incorrect, as you've pointed out (which is also visible on the script above) is the house number. All the user has to do, after clicking a button, would be to check if the No. Is correct. If it's not, they can simple adjust it (which is also visible if you tried the test) [...]

Since every address or coordinate is processed by Google, it would be as simple as finding an address using their map I.e. it would be able to correct 'typos,' and detect the correct house and No. 99% of the time [...]
The only time our testers had to change their No, was when they used a wireless connection, this meant they simply had to change their house No. to complete the process. This method allowed us to add a 1 or 2 step system (click and check house No.) which would obtain users address components using a strict format that is followed by everyone.

You can read more about geocoding, and reverse geocoding, which our systems use, here and here

MicroDApp.com—Smart Contract developers. Lets build a decentralized future!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!