olefirenko / vue-gmaps

Search places and address using Google Maps API

Home Page:https://ridermansb.github.io/vue-gmaps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vue-Gmaps

Search address and places using Google Maps API

Travis bitHound semantic-release Commitizen friendly

NPM

Demo

Installation

npm i -S vue-gmaps

And in your main.js ...

// main.js
import VueGmaps from 'vue-gmaps'
Vue.use(VueGmaps, {
  key: '<your api here>'
})

Basic usage

Add the directive v-gmaps-searchbox into your input

<input v-model=vm.searchPlace v-gmaps-searchbox=vm>

This will popule your vm.place object with details about selected place.

Features

Specify property

By default, vm.place is used, you can change this passing an argument to directive e.g :anotherProperty

<input v-gmaps-searchbox:myProperty=vm>

So vm.myProperty will be filled with details about selected place

Specify whats fields

All information about place is put is filled, to determinate whats fields should be use, you can specify a modifiers like this .name.website.formatted_address.geometry

<input v-gmaps-searchbox:myProperty.name.website.formatted_address.geometry=vm>

So your vm will set property myProperty like this

{
    myProperty: {
        name: <value_from_result>,
        website: <value_from_result>,
        formatted_address: <value_from_result>,
        geometry: <value_from_result>,
    }
}

Click here to subscribe and get more about Vue.js

About

Search places and address using Google Maps API

https://ridermansb.github.io/vue-gmaps

License:GNU Affero General Public License v3.0


Languages

Language:JavaScript 81.4%Language:Vue 13.9%Language:HTML 4.7%