@resconet/google-maps
v1.1.0
Published
[](https://badge.fury.io/js/%40resconet%2Fgoogle-maps) [](https://opensource.org/licenses/MIT)
Readme
google-maps
A JavaScript library encapsulating the Google Maps implementation of map interfaces defined in the @resconet/map-interfaces library.
Description
This library encapsulates the Google Maps implementation of map interfaces defined in the @resconet/map-interfaces library.
Installation
npm
npm install @resconet/google-mapsyarn
yarn add @resconet/google-mapsUsage
Basic Example
import { createGoogleMapView } from "@resconet/google-maps";
const mapView = await createGoogleMapView(mapElement, {
apiKey: options.apiKey,
mapId: options.mapId,
});Functions
createGoogleMapView
Creates a map control implementing MapView interface from @resconet/map-interface library.
| Function | Type |
| --------------------- | ------------------------------------------------------------------------- |
| createGoogleMapView | (mapElement: HTMLElement, options: GoogleMapsOptions): Promise<MapView> |
Parameters:
mapElement: - An element used as a root for rendering the map component.options: - Additional options required for authenticating to Google Maps service.
Returns:
A promise that resolves to an instance of MapView interface.
