Skip to main content

Circle

GmvCircle wraps google.maps.Circle. It imports the Google Maps maps library internally, creates the circle on the resolved map, binds supported props and events, exposes circleShapePromise, and removes the circle from the map on unmount.

The component is exported as Circle from @gmap-vue/v3/components and registered by the plugin as GmvCircle.

Props

PropTypeDefaultDescription
centergoogle.maps.LatLng | google.maps.LatLngLiteralundefinedCircle center.
clickablebooleantrueWhether the circle handles mouse events.
draggablebooleanfalseWhether users can drag the circle.
editablebooleanfalseWhether users can edit the circle.
fillColorstringundefinedFill color.
fillOpacitynumberundefinedFill opacity from 0 to 1.
radiusnumberundefinedCircle radius in meters.
strokeColorstringundefinedStroke color.
strokeOpacitynumberundefinedStroke opacity from 0 to 1.
strokePositiongoogle.maps.StrokePositiongoogle.maps.StrokePosition.CENTER or 0Stroke position.
strokeWeightnumberundefinedStroke width in pixels.
visiblebooleantrueWhether the circle is visible.
zIndexnumberundefinedStacking order.
circleKeystringundefinedPromise key used by useCirclePromise(key).
mapKeystringundefinedMap promise key used when the circle is not a direct descendant of GmvMap.
optionsRecord<string, unknown>undefinedFallback for Google Circle options not represented by explicit props. Spread after explicit props, so it can override them.

Events

Event
center_changed
click
dblclick
drag
dragend
dragstart
mousedown
mousemove
mouseout
mouseover
mouseup
radius_changed
rightclick

Exposed properties

PropertyTypeDescription
circleShapePromisePromise<google.maps.Circle | undefined>Resolves to the underlying Google Circle instance.

Composable

Use useCirclePromise(key?) from @gmap-vue/v3/composables. Without a key it uses the default circle promise; with multiple circles, pass the same value as circle-key.

export function useCirclePromise(
key: string | InjectionKey<Promise<google.maps.Circle | undefined>> = $circleShapePromise,
): Promise<google.maps.Circle | undefined>;