Im trying to add some callback to my code, so when clicking on a picture outside the map, the maps get centered to the position that image contains, so I try this.
Gmaps4Rails.callback = function() {
var event = document.getElementsByClassName("link-s");
event.onclick = showEvent;
function showEvent(pos) {
var pos = -25.363882,131.044922;
Gmaps4Rails.map.setCenter(pos.latLng);
};
};
it doesnt throw any error, im using “pos” for testing purposes, but i cant make it work.
It’s just a question of javascript: