Skip to content

Instantly share code, notes, and snippets.

@fchristant
Last active February 25, 2017 20:44
Show Gist options
  • Save fchristant/03c3ec11d06efeb2927cdb69cf88822d to your computer and use it in GitHub Desktop.
Save fchristant/03c3ec11d06efeb2927cdb69cf88822d to your computer and use it in GitHub Desktop.
Silva.JS GoogleMap client-side
window.addEventListener('app.onReady',function() {
app.components.load("GoogleMap").then(function(GoogleMap) {
var newComp = document.createElement('div');
newComp.innerHTML = '<div class="c_google-map__map"></div>';
newComp.setAttribute('data-component','');
newComp.setAttribute('data-component-init','');
newComp.setAttribute('data-module','GoogleMap');
newComp.setAttribute('data-zoom','1');
newComp.setAttribute('id','map2');
newComp.classList += 'c_google-map';
document.querySelector('.clientDiv').appendChild(newComp);
var com2 = new GoogleMap("#map2");
com2.zoom = 2;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment