Description

Represents the functionality that a map wrapper should provide.

Extends

IGoogleMapsNativeObjectEmittingWrapper

Index

core/modules/map/i-google-map.ts

Properties
Methods

Methods

fitBounds
fitBounds(elements: BoundsLike[], padding?: number | google.maps.Padding)

Calculates the bounds of the given element(s) and fits them all in the screen.

Parameters:
Name Type Optional Description
elements BoundsLike[] No

The element(s) to fit.

padding number | google.maps.Padding Yes

(Optional) Padding to add to the calculated bounds.

Returns: void
getMapType
getMapType()
Returns: string | google.maps.MapTypeId
panTo
panTo(position: Coord)
Parameters:
Name Type Optional
position Coord No
Returns: void
panToBounds
panToBounds(elements: BoundsLike[], padding?: number | google.maps.Padding)

Calculates the bounds of the given element(s), then pans and zooms the map to fit them all in the screen.

Parameters:
Name Type Optional Description
elements BoundsLike[] No
padding number | google.maps.Padding Yes

(Optional) Padding to add to the calculated bounds.

Returns: void
setCenter
setCenter(center: Coord)
Parameters:
Name Type Optional
center Coord No
Returns: void
setMapType
setMapType(type: string | google.maps.MapTypeId)
Parameters:
Name Type Optional
type string | google.maps.MapTypeId No
Returns: void

Properties

superpowers
superpowers: ISuperpowers
Type: ISuperpowers

The superpowers charged for the current map instance.

import { IGoogleMapsNativeObjectEmittingWrapper } from '../../abstraction/base/i-google-maps-native-object-emitting-wrapper';
import { WrappedNativeFunctions                 } from '../../abstraction/types/abstraction';
import { Coord, BoundsLike                      } from '../../abstraction/types/geometry.type';
import { ISuperpowers                           } from './superpowers/i-superpowers';

/** A type for the native functions of a map which should be wrapped. Used along with the extension interface for the wrapper.  */
export type WrappedGoogleMapFunctions = WrappedNativeFunctions<google.maps.Map, 'getMapTypeId' | 'setMapTypeId' | 'fitBounds' | 'panToBounds'>;

/**
 * Represents the functionality that a map wrapper should provide.
 *
 * @export
 * @interface IGoogleMap
 * @extends {IGoogleMapsNativeObjectEmittingWrapper<google.maps.Map>}
 * @extends {WrappedGoogleMapFunctions}
 */
export interface IGoogleMap extends IGoogleMapsNativeObjectEmittingWrapper<google.maps.Map>, WrappedGoogleMapFunctions
{
    /**
     * The superpowers charged for the current map instance.
     *
     * @type {ISuperpowers}
     */
    readonly superpowers: ISuperpowers;

    setCenter(center: Coord): void;

    /**
     * Calculates the bounds of the given element(s) and fits them all in the screen.
     *
     * @param {BoundsLike[]} elements The element(s) to fit.
     * @param {(number | google.maps.Padding)} [padding] (Optional) Padding to add to the calculated bounds.
     */
    fitBounds(elements: BoundsLike[], padding?: number | google.maps.Padding): void;
        
    /**
     * Calculates the bounds of the given element(s), then pans and zooms the map to fit them all in the screen.
     *
     * @param {BoundsLike[]} elements
     * @param {(number | google.maps.Padding)} [padding] (Optional) Padding to add to the calculated bounds.
     */
    panToBounds(elements: BoundsLike[], padding?: number | google.maps.Padding): void;
    
    panTo(position: Coord): void;
        
    getMapType(): string | google.maps.MapTypeId;
    
    setMapType(type: string | google.maps.MapTypeId): void;
}

results matching ""

    No results matching ""