Google Maps
View codeUse
Note! you now must pass an API key to access Google Maps API. More details here.
HTML
<rg-map></rg-map>
JavaScript
var tags = riot.mount('rg-map', {
map: {
apikey: [YOUR_API_KEY],
center: { lat: 37.7577, lng: -122.4376 },
zoom: 8
}
})
tags[0].on('loaded', function (map) { ... })
Everything that is available via standard Google Maps options is available through this tag.
For information on what is available head over Google Maps API docs
If you specify no options the map will still generate, but will default to predefined settings.
Be sure to style your map to that it appears on the page, give some height and width.
To gain access to the map object created on initialize use the loaded event. Useful for adding markers etc.