vue-google-maps-location-selector

A vuejs google maps component that allows latitude and longitude to be selected from a map interface.
3,828 9
Install
npm install vue-google-maps-location-selector
Latest Version:1.0.1
License:MIT
Last Updated:Apr 18, 2017
Links: GitHub  ·  npm
Maintainer: deckymcd

vue-google-maps-location-selector

A vuejs google maps component that allows latitude and longitude to be selected from a map interface.

Installation


##npm

npm install --save vue-google-maps-location-selector

Include the google maps script in the head of your index.html file and add your API key

<script src="https://maps.googleapis.com/maps/api/js?key=[YOUR_API_KEY_HERE]"></script>

Use the component by passing though an initial latitude and longitude. The locationUpdated event will fire as soon as the maps center_changed event fires.

<map-location-selector :latitude=[ADD_INITIAL_LATITUDE] :longitude=[ADD_INITIAL_LONGITUDE]
  @locationUpdated="locationUpdated">
</map-location-selector>

You can get the location in the callback function defined in the locationUpdated event.

methods:{
  locationUpdated(latlng) {
    this.latitude = latlng.lat;
    this.longitude = latlng.lng;
  }
}

Related Packages

@fawmi/vue-google-maps

Google Map components for Vue.js 3

1,032,990
vue-google-maps-community-fork

Google Maps components for VueJS 3 maintained by the community

257,783 102
vue3-google-address-autocomplete

A Vue 3 component for Google address autocomplete

142,319 6
vue3-google-autocomplete

Vue3 component to get organized payload of Place name, city, state, country and...

16,260 2
@appbaseio/vue-google-maps-community-fork

Google Maps components for VueJS 3 maintained by the community

2,652 102

Version History

Version Released License
1.0.1 MIT
1.0.0 MIT