npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

magnet-google-maps

2.0.0 • Public • Published

Usage

All api should refer Google Maps

Basic

import magnet from 'magnet-core';
import Config from 'magnet-config';
import Logger from 'magnet-bunyan';
import Koa from 'magnet-koa';
import Session from 'magnet-session';
import Router from 'magnet-router';
import GoogleMaps from 'magnet-google-maps';

let app = await magnet([Config, Logger, Koa, Session, Router, GoogleMaps]);

server/controllers/user.js

export default function user({ router, googleMaps }) {
  router

  .get('/users', async function (ctx) {
    ctx.body = await googleMaps.placesAutoComplete({
        location: [0, 0],
        radius: 20000000,
        type: '(cities)',
        input: 'Gotham'
      }).asPromise()
  });
}

install

npm i magnet-google-maps

Downloadsweekly downloads

52

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability