New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

v-maps

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v-maps

[![Build Status](https://travis-ci.org/FelipeBohnertPaetzold/v-maps.svg?branch=master)](https://travis-ci.org/FelipeBohnertPaetzold/v-maps) <img src="https://img.shields.io/npm/dm/v-maps.svg" alt

latest
Source
npmnpm
Version
4.0.2
Version published
Weekly downloads
86
82.98%
Maintainers
1
Weekly downloads
 
Created
Source

v-maps

Build Status Downloads Version License

A simple Google Maps component for Vue

Live Demo

Install

run:

yarn add v-maps

or:

npm install v-maps --save

Usage

  • Globally registration:

      import Vue from 'vue'
      import VMaps from 'v-maps'
      
      // { key: string, version?: string, libraries?: Array<string> }
      const googleApiOptions = { key: 'YOUR_GOOGLE_MAPS_API_KEY' }
      Vue.use(VMaps, googleApiOptions)
    
    • using global registration in component
    <template>
      <v-map :center="{ lat: -23.4070511, lng: -51.9428867 }" />
    </template>
    
    • using global registration map with markers
    <template>
      <v-map :center="center">
        <v-marker :position="center" />
      </v-map>
    </template>
    
    <script>
      export default {
        computed: {
          center() {
            return { lat: -23.4070511, lng: -51.9428867 }
          }        
        }
      }
    </script>
    
    • using global registration map with polygon
    <template>
      <v-map :center="center">
        <v-polygon :paths="polygonPaths" />
      </v-map>
    </template>
    
    <script>
      export default {
        data() {
          return { polygonPaths: [] }
        },
    
        computed: {
          center() {
            return { lat: -23.4070511, lng: -51.9428867 }
          }        
        }
      }
    </script>
    
    • using global registration map with polyline
    <template>
      <v-map :center="center">
        <v-polyline :path="polylinePath" />
      </v-map>
    </template>
    
    <script>
      export default {
        data() {
          return { polylinePath: [] }
        },
    
        computed: {
          center() {
            return { lat: -23.4070511, lng: -51.9428867 }
          }        
        }
      }
    </script>
    
  • Locally registration

    <template>
      <v-map :center="center" api-key="YOUR_GOOGLE_MAPS_API_KEY">
        <v-marker :position="center" />
        <v-polygon :paths="polygonPaths" />
        <v-polyline :path="polylinePath" />
      </v-map>
    </template>
    
    <script>
      import { VMap, VMarker, VPolygon, VPolyline } from 'v-maps'
    
      export default {
        data() {
          return { polygonPaths: [], polylinePath: [] }
        },
    
        computed: {
          center() {
            return { lat: -23.4070511, lng: -51.9428867 }
          }        
        },
        components: { VMarker, VMap, VPolygon, VPolyline }
      }
    </script>
    

Props

  • v-map

    PropertyRequiredTypeDefaultDescription
    centeryesObjectThe center position for map { lat: -45.2121, lng: -43.2131 }
    api-keynoStringYour api key for google maps
    api-optionsnoObject{}Options to configure your google, libraries, version ...
    zoomnoNumber4The zoom level
    map-idnoStringmapID of the div on which the map will be mounted
    optionsnoObject{}Options for map (https://developers.google.com/maps/documentation/javascript/tutorial#MapOptions)
  • v-marker

    PropertyRequiredTypeDefaultDescription
    positionyesObjectThe marker position { lat: -45.2121, lng: -43.2131 }
    optionsnoObject{}Options for marker (https://developers.google.com/maps/documentation/javascript/markers)
    info-windownoStringInfo view popup for marker (https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple)
  • v-polygon

    PropertyRequiredTypeDefaultDescription
    pathsyesArrayArray of objects [{ lat: -23.407056, lng: -51.9428867}]
    draggablenoBooleanfalseAllows to drag polygon
    editablenoBooleanfalseAllows to edit polygon's vertexes
    strokeColornoString#00ff00Polygon's stroke color
    fillColornoString#00ff00Polygon's inner color
    optionsnoObject{}Other options for polygons (https://developers.google.com/maps/documentation/javascript/reference/polygon#PolygonOptions)
  • v-polyline

    PropertyRequiredTypeDefaultDescription
    pathyesArrayArray of objects [{ lat: -23.407056, lng: -51.9428867}]
    draggablenoBooleanfalseAllows to drag polyline
    editablenoBooleanfalseAllows to edit polyline's vertexes
    strokeColornoString#00ff00Polyne's stroke color
    optionsnoObject{}Other options for polyline (https://developers.google.com/maps/documentation/javascript/reference/polygon#PolylineOptions)
  • v-heatmap

    Important: To use the heat map it is necessary to include the visualization library when registering the library.

    global:

      const googleApiOptions = { key: 'YOUR_GOOGLE_MAPS_API_KEY', libraries: ['visualization'] }
      Vue.use(VMaps, googleApiOptions)
    

    or locally:

      <template>
        <v-map :center="center" api-key="YOUR_GOOGLE_MAPS_API_KEY" :apiOptions="{ libraries: ['visualization']}">
          <v-heatmap :points="points" />
        </v-map>
      </template>
    
    PropertyRequiredTypeDefaultDescription
    pointsnoArray[]Array of objects [{ lat: -23.407056, lng: -51.9428867, weight?: 2}]
    optionsnoObject{}Other options for polyline (https://developers.google.com/maps/documentation/javascript/heatmaplayer?#overview)

Events

  • v-map(for more details check the google documentation in https://developers.google.com/maps/documentation/javascript/events)

    Vue EventParamsNative google map event
    bounds-changedmap, eventbounds_changed
    center-changedmap, eventcenter_changed
    clickmap, eventclick
    double-clickmap, eventdblclick
    dragmap, eventdrag
    drag-endmap, eventdragend
    drag-startmap, eventdragstart
    heading-changedmap, eventheading_changed
    idlemap, eventidle
    map-type-id-changedmap, eventmaptypeid_changed
    mouse-movemap, eventmousemove
    mouse-outmap, eventmouseout
    mouse-overmap, eventmouseover
    projection-changedmap, eventprojection_changed
    resizemap, eventresize
    right-clickmap, eventrightclick
    tiles-loadedmap, eventtilesloaded
    tilt-changedmap, eventtilt_changed
    zoom-changedmap, eventzoom-changed
  • v-marker

    Vue EventParamsInfo
    clickNoneThis only works if the marker has no info window
  • v-polygon

    Vue EventParamsNative google map event
    path-changedCurrent paths of polygon
  • v-polyline

    Vue EventParamsNative google map event
    path-changedCurrent paths of polyline

Keywords

vue

FAQs

Package last updated on 24 Jun 2020

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