Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Load google maps with privacy

License

NotificationsYou must be signed in to change notification settings

vanderb/vue-async-gmaps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Load google maps with privacy

Let your user decide to load google-maps by click

Notes

This package uses promised google-maps load based on article by Markus Oberlehnerhttps://markus.oberlehner.net/Article: https://markus.oberlehner.net/blog/using-the-google-maps-api-with-vue/

Installation

Install package

// via npmnpm install @vanderb/vue-async-gmaps --save// via yarnyarn add @vanderb/vue-async-gmaps

Implementation

importVueAsyncGmapsfrom'@vanderb/vue-async-gmaps'Vue.component('VueAsyncGmaps',VueAsyncGmaps)

Example

<vue-async-gmaps/>

Options

Api-Key

Insert your google-maps api-key viaapi-key-property

<vue-async-gmapsapi-key="YOUR_GOOGLE_MAPS_API_KEY"/>

Config

Insert your google-maps config via:config-property

<vue-async-gmaps...:config="{center: {lat: 50.935173, lng: 6.953101}, zoom: 11}"/>

Markers

To add markers just add markers-property with array of marker-objects

  • position = {lat: xxx, lng: xxx} (required)
  • icon = {} (optional)
    • url = Marker-Icon-Url
  • details = {} (optional)
    • title
    • description
    • address
    • zip
    • city
    • link
    • link_text
  • animation [DROP, BOUNCE] (optional, BOUNCE not fully supported yet)
<vue-async-gmaps...:markers="[{position: {lat: 50.935173, lng: 6.953101}, details: {title: 'My Marker'}}]"/>

Button

You can change button-text and class

<vue-async-gmapsbutton-text="Aye aye, sir"button-class="captains-button"/>

Slot

You can change the default content by slot. If you do you have to insert Button or trigger by yourself (click-handler included)

<vue-async-gmaps><!-- Default Slot (adding custom markup) --><span>Trolooloooo</span><!-- Trigger Slot (adding custom trigger) --><templatev-slot:trigger="{ initGoogleMaps }"><span@click="initGoogleMaps">Aye aye, sir</span></template></vue-async-gmaps>

About

Load google maps with privacy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp