1.0.0-alpha.1 • Published 5 years ago
create-google-maps v1.0.0-alpha.1
Create Google Maps
Library for declarative creation of Google Maps
Work in progress. The API can be changed. You use it at your own risk.
API
Soon. If you want to use this library now, have a look at the code. It is not complicated
createMarker
createMarker: (config: MarkerOptions) => Markerconfig contains defaults marker options without map property because is is passed by class. Returns instance of Marker
removeMarkers
removeMarkers: () => voidRemoves all markers from the map
removeMarker
removeMarker: (marker: Marker) => voidRemoves passed marker from map.
fitBounds
fitBounds: (bounds?: MapLatLngBounds, padding?: MapPadding) => voidbounds- LatLngBounds | LatLngBoundsLiteralpadding- number | Padding
Sets the viewport to contain the given bounds. If the bounds argument is falsy, the bounds will fit to current markers' position.
removeBounds
removeBounds: (options: {
center?: MapOptions['center']
zoom?: MapOptions['zoom']
} = {}) => voidRemove bounds and set default center position and zoom from default options or params passed in options argument.
createInfoWindow
createInfoWindow: (marker: Marker, options: InfoWindowOptions) => voidCreates an info window with the given options.
removeInfoWindow
removeInfoWindow: (marker: Marker) => voidRemoves info window from marker passed as argument