The angular-ready wrapper for the native google.maps.Polyline
class.
overlays/modules/polyline/google-maps-polyline.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 getBounds |
getBounds()
|
Inherited from
GoogleMapsDrawableOverlay
|
Returns:
google.maps.LatLngBounds
|
Public getPath |
getPath()
|
Returns:
google.maps.LatLngLiteral[]
|
setClickable | ||||||
setClickable(clickable: boolean)
|
||||||
Parameters:
Returns:
void
|
||||||
setGeodesic | ||||||
setGeodesic(geodesic: boolean)
|
||||||
Parameters:
Returns:
void
|
||||||
Public setPath | ||||||
setPath(path: Path)
|
||||||
Decorators :
@OutsideAngular()
|
||||||
Parameters:
Returns:
void
|
||||||
setStrokeColor | ||||||
setStrokeColor(strokeColor: string)
|
||||||
Parameters:
Returns:
void
|
||||||
setStrokeOpacity | ||||||
setStrokeOpacity(strokeOpacity: number)
|
||||||
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 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, Path } from '@bespunky/angular-google-maps/core';
import { GoogleMapsDrawableOverlay } from '../../abstraction/base/google-maps-drawable-overlay';
import { OverlayType } from '../../abstraction/base/overlay-type.enum';
import { IGoogleMapsPolyline, WrappedPolylineFunctions } from './i-google-maps-polyline';
/** Extends intellisense for `GoogleMapsPolyline` with native polyline functions. */
export interface GoogleMapsPolyline extends WrappedPolylineFunctions { }
/**
* The angular-ready wrapper for the native `google.maps.Polyline` class.
*
* @export
* @class GoogleMapsPolyline
* @extends {GoogleMapsDrawableOverlay<google.maps.Polyline>}
* @implements {IGoogleMapsPolyline}
*/
// @dynamic
@NativeObjectWrapper<GoogleMapsPolyline>({
getMap: Delegation.Exclude,
setMap: Delegation.Exclude
})
export class GoogleMapsPolyline extends GoogleMapsDrawableOverlay<google.maps.Polyline> implements IGoogleMapsPolyline
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor(map: IGoogleMap, api: GoogleMapsApiService, native: any /* See super for docs on `any` */)
{
super(OverlayType.Polyline, map, api, native);
}
public getBounds(): google.maps.LatLngBounds
{
return this.api.geometry.definePathBounds(this.getPath());
}
public getPath(): google.maps.LatLngLiteral[]
{
return this.api.geometry.toLiteralMultiPath(this.native.getPath())[0];
}
@OutsideAngular
public setPath(path: Path): void
{
this.native.setPath(this.api.geometry.toLiteralMultiPath(path)[0]);
}
setClickable (clickable: boolean) : void { this.setOptions({ clickable }); }
setStrokeColor (strokeColor: string) : void { this.setOptions({ strokeColor }); }
setStrokeOpacity (strokeOpacity: number) : void { this.setOptions({ strokeOpacity }); }
setStrokeWeight (strokeWeight: number) : void { this.setOptions({ strokeWeight }); }
setZIndex (zIndex: number) : void { this.setOptions({ zIndex }); }
setGeodesic (geodesic: boolean) : void { this.setOptions({ geodesic }); }
}