Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nagoos/google-maps-autocomplete-vuetify

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nagoos/google-maps-autocomplete-vuetify

Vuetify autocomplete component for google places. Easy to link to a google map component!

  • 1.0.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@nagoos/google-maps-autocomplete-vuetify

A component to allow users to lookup places, and see their selected place on a map. Uses the google maps places API, Vuetify, and vue2-google-maps.

See working demo

Installation

yarn add @nagoos/google-maps-autocomplete-vuetify

Setup

This component requires two main libraries to work: Vuetify, and vue2-google-maps

This component won't work until you setup the vue2-google-maps library with your google maps api key:

import Vue from "vue";
import * as VueGoogleMaps from "vue2-google-maps";

Vue.use(VueGoogleMaps, {
  load: {
    key: "<your google api key>",
    libraries: "places"
  }
});

This component relies on the Maps JavaScript API, Places API, and the Geocoding API which you can enable from your google cloud console.

Usage

  1. Import the library into your component:
import GoogleMapsAutocomplete from "@nagoos/google-maps-autocomplete-vuetify";
  1. Add to your VueJS component's components section:
components: {
    GoogleMapsAutocomplete,
    ...
},
  1. Use in your component's template:
<GoogleMapsAutocomplete
    v-model="address"
    :restrict-to-countries="['jp']"
    @initialized="mapsLoaded = true"
    class="ma-1"
    placeholder="Enter a business name"
/>

API

v-model

When a user selects a place, the v-model is updated with a json object representing the selected place.

Example:

{
  "name": "WAGYUMAFIA THE BUTCHER’S KITCHEN",
  "address": "WAGYUMAFIA THE BUTCHER’S KITCHEN, 1 Chome-14-16 Nishiazabu, Minato City, Tokyo, Japan",
  "placeId": "ChIJz55I6XqLGGARpI3NfnSQINk",
  "location": {
    "lat": 35.6611479,
    "lng": 139.72333349999997
  }
}

restrict-to-countries

Pass an array of countries to limit the Places results to those countries.

initialized

The component will emit an initialized event once the Google Maps libraries are ready, and it has prepared itself. Once this event has been emitted, you know it is safe to load a google map.

placeholder

Pass a placeholder to the component's autocomplete input. This lets you display a message when the input is blank.

noResultsFoundMessage

Pass a message to be displayed when the Google Places API couldn't find any results.

Keywords

FAQs

Package last updated on 10 Jun 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc