Dead simple Google maps driver
Checkout the example
How to use:
Give a look at the examples folder.
const mapDriver = new MapDriver(google, '#map', { center: { lat: 51.473663, lng: -0.203287 }});
const marker = mapDriver.createMarker({
lat: 51.473663,
lng: -0.203287 ,
icon: 'http://example.com/icon.jpg'
});
mapDriver.moveMarker(marker, { lat: 51.579663, lng: -0.613287 });
mapDriver.moveMarker(marker, { lat: 51.579663, lng: -0.613287 }, 2500);
mapDriver.toLatLng('21 Heathmans Road, London, Uk')
.then(coord => {
const marker2 = mapDriver.createMarker({
lat: coords.lat,
lng: coords.lng,
});
});
const allMarkers = mapDriver.getMarkers();
mapDriver.focusMarkers(allMarkers);
mapDriver.destroyMarker(marker);
API
addMarker(marker)
getMarkers()
createMarker(config)
moveMarker(marker, destination, duration = 1000)
destroyMarker(marker)
focusMarkers(markers)
async toLatLng(address)