vanilla-es6-jspm

API Docs for: 0.10.3
Show:

services.geolocation.geolocation

Summary

Item Index

Methods

Methods

geolocation

Syntax

geolocation

(
  • [ipAddress]
)
Promise

Summary

Very simple geolocation method based on https://freegeoip.net free geoip service (may not be the most accurate nor the most fast or available, but it's only to have some xhr in the code example).

Example:

geolocation()
                      .then((result) => {
                        console.log(result);//there you are
                      })
                      .catch(e => {
                        console.error(e);
                      });
                    

Parameters:

  • [ipAddress] String optional

    You can pass a specific IP address to geoloc if you want.

Returns: