Socket
Book a DemoInstallSign in
Socket

vue-latlng-picker

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-latlng-picker

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

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

vue-latlng-picker

A Vue 2 google maps component that allows latitude and longitude to be selected from a map interface. Based on vue-google-maps-location-selector

Installation

npm

npm install --save vue-latlng-picker

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]&libraries=places"></script>

Use the component by passing though an initial latitude and longitude. You may also give it a zoom prop, the default is 12.
The locationUpdated event will fire as soon as the maps center_changed event fires.

<map-location-selector :zoom="15" :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;
  }
}

Keywords

vuejs

FAQs

Package last updated on 03 May 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.