I have a page that is a template, that I load upon clicking a link.
This page has various tabs in a scrollable tabbar.
One of this tabs has a div with an ID that serves as the div where I want to put a google map on.
Thing is, when I call the method document.getElementById it does not bring any element. But If I call $$(element_id), it does bring it allright.
Does it has to do with the fact that this div is in a template that is loaded?
Im calling this function on pageInit event in the template.
function InitMapClienteUbicacion()
{
var mapOptions = {
center: new google.maps.LatLng(0, 0),
zoom: 6,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var mapeldoc = document.getElementById("mapaRouteToCliente"); //brings null
var mapel = $$("#mapaRouteToCliente"); //brings element OK
mapMenuCliente = new google.maps.Map( mapel , mapOptions );
directionsRendererMenuCliente.setMap(mapMenuCliente);
marker = new google.maps.Marker({
position: ClienteLatLng, // inicializado cuando entra al page en menu_cliente.js
draggable: false
});
marker.setMap(mapMenuCliente);
mapMenuCliente.setZoom(15);
mapMenuCliente.setCenter( marker.getPosition() );
}