Simplifies the basic use of Google Maps.
- Embed a map.
- Center it to the user's location.
- Add markers.
- Filter the markers.
Install the library by running: bower install donde.js --save
.
Once you have included the script in your markup, you can run:
new Donde({
container: 'js-map'
, zoom: 15
, defaultPosition: {
latitude: -34.8937720817105
, longitude: -56.1659574508667
}
, markers: [
{
icon: 'img/marker-1.png'
, type: 'A'
, position: {
latitude: -34.790626820565095
, longitude: -56.352119473107685,
}
}
, {
icon: 'img/marker-2.png'
, type: 'B'
, position: {
latitude: -34.79742147359551
, longitude: -56.24659744591109
}
}
]
});
container
is the id of the DOM element where the map will be rendered.zoom
is the map's default zoom value.defaultPosition
is where the map will be centered and the user's marker positioned in case geolocation is unavailable.- Markers
icon
is the path to the markers image.type
is used for the filtering of markers.position
is the geolocation where the marker should be placed.