Skip to content

Circle (gm-circle)


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

Simple Use (demo)

html
<template>
  <div style="height: 500px">
    <gm-map>
      <gm-circle :center="{ lat: -28, lng: 125 }" :radius="500000" />
    </gm-map>
  </div>
</template>

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

Props

PropsTypeDefaultDescription
centerGmPosition-The center of the Circle.
draggablebooleanfalseWhether this Circle can be dragged over the map.
editablebooleanfalseWhether this Circle can be edited by dragging the control points shown at the center and around the circumference.
radiusnumber-The radius in meters on the Earth's surface.
visiblebooleantrueWhether this Circle is visible on the map.
optionsgoogle.maps.CircleOptions-Google Maps CircleOptions interface

Events

EventTypeDescription
center_changedGmPositionThis event is fired when the circle's center is changed.
clickGmPositionThis event is fired when the DOM click event is fired on the Circle.
dblclickGmPositionThis event is fired when the DOM dblclick event is fired on the Circle.
dragGmPositionThis event is repeatedly fired while the user drags the Circle.
dragendGmPositionThis event is fired when the user stops dragging the Circle.
dragstartGmPositionThis event is fired when the user starts dragging the Circle.
mountedgoogle.maps.CircleOn mounted the component will emit the Google Maps object it represents.
mousedownGmPositionThis event is fired for a mousedown on the Circle.
mousemoveGmPositionThis event is fired for a mousemove on the Circle.
mouseoutGmPositionThis event is fired when the mouse leaves the area of the Circle.
mouseoverGmPositionThis event is fired when the mouse enters the area of the Circle.
mouseupGmPositionThis event is fired for a mouseup on the Circle.
radius_changednumberThis event is fired when the circle's radius is changed.
rightclickGmPositionThis event is fired for a rightclick on the Circle.
unmountedgoogle.maps.CircleOn unmounted the component will emit the Google Maps object it represents.

Notes

  • The circle is geodesic which means it projects itself on the map as if it is on a globe. You can see these effects by dragging a circle far North or South.

Released under the MIT License.