🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@loadsmart/utils-geolocation

Package Overview
Dependencies
Maintainers
20
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loadsmart/utils-geolocation

useful functions for dealing with geolocation data

latest
Source
npmnpm
Version
0.3.1
Version published
Maintainers
20
Created
Source

BundlePhobia BundlePhobia

utils-geolocation

useful functions for dealing with geolocation data

Install via NPM

$ npm i @loadsmart/utils-geolocation --save

Install via yarn

$ yarn add @loadsmart/utils-geolocation

Usage

import React from 'react'
import {
  isValidGeoSuggestion
} from '@loadsmart/utils-geolocation'

export default ({geoData}) => (
  <div>
    { isValidGeoSuggestion(geoSuggestionData) ? <Map data={geoData} /> : <Error /> }
  </div>
)

Available Functions

These are the functions available at this library:

gMapsToAddressComponentsObject(gmaps, config)

Converts a gmaps object containing the adress_components field to an object in the form:

{
  "city": "City Name",
  "state": "ST",
  "country": "CT",
  "zipcode": "00000"
}

isValidGeoSuggestion(geoSuggestion)

Checks if the passed geoSuggestion is a valid geo suggestion object, containing all required fields (location, gmaps, and description), returns a boolean.

Keywords

geolocation

FAQs

Package last updated on 23 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts