The angular-ready wrapper for the native google.maps.Circle
class.
overlays/modules/circle/google-maps-circle.ts
Properties |
Methods |
|
constructor(map: IGoogleMap, api: GoogleMapsApiService, native: any)
|
||||||||||||
Parameters:
|
||||||||||||
Public map |
Type: IGoogleMap
|
Inherited from
GoogleMapsDrawableOverlay
|
The map to which this overlay should be added.
|
Public Readonly type |
Type: OverlayType
|
Inherited from
GoogleMapsDrawableOverlay
|
The type of overlay this wrapper holds. Used by the `OverlayTracker` to distinguish between types.
|
Public custom |
Type: any
|
Inherited from
GoogleMapsNativeObjectWrapper
|
Public Readonly native |
Type: TNative
|
Inherited from
GoogleMapsNativeObjectWrapper
|
The instantiated native object to be wrapped.
|
Public getCenter |
getCenter()
|
Returns:
google.maps.LatLngLiteral
|
Public setCenter | ||||||
setCenter(element: BoundsLike)
|
||||||
Decorators :
@OutsideAngular()
|
||||||
Parameters:
Returns:
void
|
||||||
setClickable | ||||||
setClickable(clickable: boolean)
|
||||||
Parameters:
Returns:
void
|
||||||
setFillColor | ||||||
setFillColor(fillColor: string)
|
||||||
Parameters:
Returns:
void
|
||||||
setFillOpacity | ||||||
setFillOpacity(fillOpacity: number)
|
||||||
Parameters:
Returns:
void
|
||||||
setStrokeColor | ||||||
setStrokeColor(strokeColor: string)
|
||||||
Parameters:
Returns:
void
|
||||||
setStrokeOpacity | ||||||
setStrokeOpacity(strokeOpacity: number)
|
||||||
Parameters:
Returns:
void
|
||||||
setStrokePosition | ||||||
setStrokePosition(strokePosition: google.maps.StrokePosition)
|
||||||
Parameters:
Returns:
void
|
||||||
setStrokeWeight | ||||||
setStrokeWeight(strokeWeight: number)
|
||||||
Parameters:
Returns:
void
|
||||||
setZIndex | ||||||
setZIndex(zIndex: number)
|
||||||
Parameters:
Returns:
void
|
||||||
Public attach | ||||||||
attach(map: IGoogleMap)
|
||||||||
Inherited from
GoogleMapsDrawableOverlay
|
||||||||
Assigns the overlay to the specified map. If possible, prefer using the appropriate
Parameters:
Returns:
void
|
||||||||
Public detach |
detach()
|
Inherited from
GoogleMapsDrawableOverlay
|
Removes the overlay from the map it is attached to. If possible, prefer using the
Returns:
void
|
Public Abstract getBounds |
getBounds()
|
Inherited from
GoogleMapsDrawableOverlay
|
Returns:
google.maps.LatLngBounds
|
Public clearListeners |
clearListeners()
|
Inherited from
GoogleMapsNativeObjectEmittingWrapper
|
Unregisters all handlers of any previously registered native event.
Returns:
void
|
Public listenTo | ||||||||||||
listenTo(eventName: string, handleEvent: (args: any[]) => void)
|
||||||||||||
Inherited from
GoogleMapsNativeObjectEmittingWrapper
|
||||||||||||
Registers a handler to a specific event of the native object and takes care of executing the handler inside angular's zone.
Parameters:
Returns:
void
An function for unregistering the handler from the event. |
||||||||||||
Public stopListeningTo | ||||||||
stopListeningTo(eventName: string)
|
||||||||
Inherited from
GoogleMapsNativeObjectEmittingWrapper
|
||||||||
Unregisters all handlers previously registered to handle a specific event.
Parameters:
Returns:
void
|
||||||||
Public setCustom | ||||||
setCustom(custom: any)
|
||||||
Inherited from
GoogleMapsNativeObjectWrapper
|
||||||
Parameters:
Returns:
void
|
||||||
import { NativeObjectWrapper, OutsideAngular, GoogleMapsApiService, IGoogleMap, Delegation, BoundsLike } from '@bespunky/angular-google-maps/core';
import { GoogleMapsDrawableOverlay } from '../../abstraction/base/google-maps-drawable-overlay';
import { OverlayType } from '../../abstraction/base/overlay-type.enum';
import { IGoogleMapsCircle, WrappedCircleFunctions } from './i-google-maps-circle';
/** Extends intellisense for `GoogleMapsCircle` with native circle functions. */
export interface GoogleMapsCircle extends WrappedCircleFunctions { }
/**
* The angular-ready wrapper for the native `google.maps.Circle` class.
*
* @export
* @class GoogleMapsCircle
* @extends {GoogleMapsDrawableOverlay<google.maps.Circle>}
* @implements {IGoogleMapsCircle}
*/
// @dynamic
@NativeObjectWrapper<GoogleMapsCircle>({
getMap: Delegation.Exclude,
setMap: Delegation.Exclude
})
export class GoogleMapsCircle extends GoogleMapsDrawableOverlay<google.maps.Circle> implements IGoogleMapsCircle
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor(map: IGoogleMap, api: GoogleMapsApiService, native: any /* See super for docs on `any` */)
{
super(OverlayType.Circle, map, api, native);
}
public getCenter(): google.maps.LatLngLiteral
{
return this.api.geometry.toLiteralCoord(this.native.getCenter());
}
@OutsideAngular
public setCenter(element: BoundsLike): void
{
this.native.setCenter(this.api.geometry.centerOf(element));
}
setClickable (clickable: boolean) : void { this.setOptions({ clickable }); }
setFillColor (fillColor: string) : void { this.setOptions({ fillColor }); }
setFillOpacity (fillOpacity: number) : void { this.setOptions({ fillOpacity }); }
setStrokeColor (strokeColor: string) : void { this.setOptions({ strokeColor }); }
setStrokeOpacity (strokeOpacity: number) : void { this.setOptions({ strokeOpacity }); }
setStrokePosition(strokePosition: google.maps.StrokePosition): void { this.setOptions({ strokePosition }); }
setStrokeWeight (strokeWeight: number) : void { this.setOptions({ strokeWeight }); }
setZIndex (zIndex: number) : void { this.setOptions({ zIndex }); }
}