🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

gridsome-source-gmaps-geocode

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gridsome-source-gmaps-geocode

Geocode data from your Gridsome sources using the Google Maps Geocoding API.

1.0.3
latest
Source
npm
Version published
Weekly downloads
63
12.5%
Maintainers
1
Weekly downloads
 
Created
Source

gridsome-source-gmaps-geocode

Install

yarn add gridsome-source-gmaps-geocode

Or

npm install --save gridsome-source-gmaps-geocode

Usage

Configure the plugin in your gridsome.config.js

module.exports = {
  ...
  plugins: [
    {
      use: '@gridsome/source-filesystem',
      options: {
        path: '_content/**/*.md',
        typeName: 'Office'
      }
    },
    {
      use: 'gridsome-source-gmaps-geocode',
      options: {
        apiKey: 'your-gmaps-geocode-api-key-here',
        sourceTypeName: 'Office',
        sourceTypeField: 'address'
      }
    },
  ]
}

You will then be able to use access the gecode result for the value of the address field on each Office node via the geocode field on Office nodes:

{
  allOffice {
    edges {
      node {
        geocode {
          lat
          lng
        }
      }
    }
  }
}

Keywords

gridsome

FAQs

Package last updated on 07 Dec 2019

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