Description

Provides the base functionality for all native Google Maps object wrappers.

Implements

IGoogleMapsNativeObjectWrapper

Index

core/abstraction/base/google-maps-native-object-wrapper.ts

Properties
Methods

Constructor

constructor(api: GoogleMapsApiService, native: TNative)

Creates an instance of GoogleMapsNativeObjectWrapper.

Parameters:
Name Type Optional Description
api GoogleMapsApiService No

The instance of the api service.

native TNative No

The instantiated native object to be wrapped.

Properties

Public custom
Type: any
Public Readonly native
Type: TNative
The instantiated native object to be wrapped.

Methods

Public setCustom
setCustom(custom: any)
Parameters:
Name Type Optional
custom any No
Returns: void
import { GoogleMapsApiService           } from '../../api/google-maps-api.service';
import { IGoogleMapsNativeObject        } from '../native/i-google-maps-native-object';
import { createNativeProxy              } from '../../utils/proxy-utils';
import { IGoogleMapsNativeObjectWrapper } from './i-google-maps-native-object-wrapper';

/**
 * Provides the base functionality for all native Google Maps object wrappers.
 * 
 * @abstract
 * @implements {IGoogleMapsNativeObjectWrapper<TNative>}
 * @template TNative The type of native object the wrapper will work with.
 */
export abstract class GoogleMapsNativeObjectWrapper<TNative extends IGoogleMapsNativeObject>
           implements IGoogleMapsNativeObjectWrapper<TNative>
{
    public custom: any;

    /**
     * Creates an instance of GoogleMapsNativeObjectWrapper.
     * 
     * @param {GoogleMapsApiService} api The instance of the api service.
     * @param {TNative} native The instantiated native object to be wrapped.
     */
    constructor(protected api: GoogleMapsApiService, public readonly native: TNative)
    {
        if (!native) throw new Error(`Native object must be defined.`);

        return createNativeProxy(this);
    }

    public setCustom(custom: any): void
    {
        this.custom = custom;
    }
}

results matching ""

    No results matching ""