Skip to content

Polyline (gm-polyline)


In addition to rectangles, polygons, and circles you can also create polylines on a map.

Simple Use (demo)

html
<template>
  <div style="height: 500px">
    <gm-map>
      <gm-polyline :path="[{ lat: -28, lng: 125 }, { lat: -25, lng: 130 }, { lat: -32, lng: 120 }]" />
    </gm-map>
  </div>
</template>

<script setup lang="ts">
import { gmMap, gmPolyline } from 'v3-gmaps';
</script>

Props

PropsTypeDefaultDescription
draggablebooleanfalseWhether this Polyline can be dragged over the map.
editablebooleanfalseWhether this Polyline can be edited by dragging the control points shown at the vertices and on each edge.
pathGmPosition[]-The ordered sequence of coordinates of the Polyline.
visiblebooleantrueWhether this Polyline is visible on the map.
optionsgoogle.maps.PolylineOptions-Google Maps PolylineOptions interface

Events

EventTypeDescription
clickGmPositionThis event is fired when the DOM click event is fired on the Polyline.
contextmenuGmPositionThis event is fired when the DOM contextmenu event is fired on the Polyline.
dblclickGmPositionThis event is fired when the DOM dblclick event is fired on the Polyline.
dragGmPositionThis event is repeatedly fired while the user drags the Polyline.
dragendGmPositionThis event is fired when the user stops dragging the Polyline.
dragstartGmPositionThis event is fired when the user starts dragging the Polyline.
mountedgoogle.maps.PolylineOn mounted the component will emit the Google Maps object it represents.
mousedownGmPositionThis event is fired for a mousedown on the Polyline.
mousemoveGmPositionThis event is fired for a mousemove on the Polyline.
mouseoutGmPositionThis event is fired for a mouseout on the Polyline.
mouseoverGmPositionThis event is fired for a mouseover on the Polyline.
mouseupGmPositionThis event is fired for a mouseup on the Polyline.
path_changedGmPosition[]This event is fired when the Polyline's path is changed.
rightclickGmPositionThis event is fired for a rightclick on the Polyline.
unmountedgoogle.maps.PolylineOn unmounted the component will emit the Google Maps object it represents.

Released under the MIT License.