JavaScript for button to show the 3 word address for the user's current location
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
3words-button.js
LICENSE.txt
README.md
sample.html

README.md

what3words 3words-button

JavaScript for button to show the 3 word address for the user's current location

Get started

Get your API key at https://map.what3words.com/register?dev=true

Set your API in 3words-button.js

function show3WordAddress(location) {
    data = {
        key: 'YOUR-W3W-API-KEY',
        coords: location.coords.latitude + ',' + location.coords.longitude
    };

Then run the sample html file.

Warning: Modern browsers permits finding current location only over HTTPS.

Licensing

MIT