1148
| <![CDATA[<script type="text/javascript">//<![CDATA[
var tstPhocaMap = document.getElementById('phocaMap');
var tstIntPhocaMap;
var mapPhocaMap;
var markersmapPhocaMap = [];
var phocaDirDisplay;
var phocaDirService;
function CancelEventPhocaMap(event) {
var e = event;
if (typeof e.preventDefault == 'function') e.preventDefault();
if (typeof e.stopPropagation == 'function') e.stopPropagation();
if (window.event) {
window.event.cancelBubble = true; /* for IE */
window.event.returnValue = false; /* for IE */
}
}
function CheckPhocaMap() {
if (tstPhocaMap) {
if (tstPhocaMap.offsetWidth != tstPhocaMap.getAttribute("oldValue")) {
tstPhocaMap.setAttribute("oldValue",tstPhocaMap.offsetWidth);
if (tstPhocaMap.getAttribute("refreshMap")==0) {
if (tstPhocaMap.offsetWidth > 0) {
clearInterval(tstIntPhocaMap);
getPhocaMap();
tstPhocaMap.setAttribute("refreshMap", 1);
}
}
}
}
}
function getPhocaMap(){
if (tstPhocaMap.offsetWidth > 0) {
var phocaLatLng = new google.maps.LatLng(-19.638949872057182, -43.89381408691406);
var phocaOptions = {
zoom: 12,
center: phocaLatLng,
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DEFAULT },
navigationControl: true,
navigationControlOptions: {style: google.maps.NavigationControlStyle.DEFAULT},
scaleControl: true,
scrollwheel: 1,
disableDoubleClickZoom: '',
styles: '',
mapTypeId: google.maps.MapTypeId.ROADMAP
};
mapPhocaMap = new google.maps.Map(document.getElementById('phocaMap'), phocaOptions);
var phocaImagedefault5 = new google.maps.MarkerImage('/media/com_phocamaps/images/istar/image.png',
new google.maps.Size(26,26),
new google.maps.Point(0,0),
new google.maps.Point(15,30));
var phocaImageShadowdefault5 = new google.maps.MarkerImage('/media/com_phocamaps/images/istar/shadow.png',
new google.maps.Size(39,26),
new google.maps.Point(0,0),
new google.maps.Point(15,30));
var phocaImageShapedefault5 = {
coord: [13,0,13,1,13,2,14,3,14,4,15,5,15,6,15,7,21,8,25,9,25,10,23,11,22,12,21,13,20,14,19,15,19,16,19,17,19,18,19,19,19,20,20,21,20,22,20,23,20,24,19,25,6,25,5,24,5,23,5,22,5,21,5,20,5,19,6,18,6,17,6,16,6,15,5,14,4,13,3,12,2,11,0,10,0,9,4,8,9,7,9,6,10,5,10,4,11,3,11,2,12,1,12,0],
type: 'poly'
};
var phocaPoint5 = new google.maps.LatLng(-19.635554646539532, -43.897247314453125);
var markerPhocaMarker5 = new google.maps.Marker({
title:"Lagoa Santa / MG",
icon:phocaImagedefault5,
shadow:phocaImageShadowdefault5,
shape:phocaImageShapedefault5,
position: phocaPoint5,
map: mapPhocaMap
});
var infoPhocaWindow5 = new google.maps.InfoWindow({
content: '<div style="font-size:120%;margin: 5px 0px;font-weight:bold;">Lagoa Santa / MG</div><div><p>CEP: 33.400-000</p></div>'
});
google.maps.event.addListener(markerPhocaMarker5, 'click', function() {
infoPhocaWindow5.open(mapPhocaMap, markerPhocaMarker5 );
});
phocaDirService = new google.maps.DirectionsService();
phocaDirDisplay = new google.maps.DirectionsRenderer();
phocaDirDisplay.setMap(mapPhocaMap);
phocaDirDisplay.setPanel(document.getElementById("phocaDir"));
google.maps.event.addDomListener(tstPhocaMap, 'DOMMouseScroll', CancelEventPhocaMap);
google.maps.event.addDomListener(tstPhocaMap, 'mousewheel', CancelEventPhocaMap); }
}
function setPhocaDir(fromPMAddress, toPMAddress) {
var request = {
origin: fromPMAddress,
destination: toPMAddress,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
phocaDirService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
pPI = document.getElementById('phocaMapsPrintIcon');
pPI.style.display='block';
var from64 = Base64.encode(fromPMAddress).toString();
var to64 = Base64.encode(toPMAddress).toString();
pPI.innerHTML = '<div class="pmprintroutelink"><a href=\u0022/turismo-cultura-cidade/localizacao/route/4-lagoa-santa?tmpl=component&print=1&from='+from64+'&to='+to64+'&lang=pt-br\u0022 rel=\u0022nofollow\u0022 onclick=\u0022window.open(this.href,\'phocaMapRoute\',\'width=640,height=480,menubar=yes,resizable=yes,scrollbars=yes,resizable=yes\'); return false;\u0022 >Mostrar Rota</a></div><div style="clear:both"></div>';
phocaDirDisplay.setDirections(response);
} else if (google.maps.DirectionsStatus.NOT_FOND) {
alert("Um dos locais especificados na origem, destino ou rota pedidos não puderam ser georreferenciados.");
} else if (google.maps.DirectionsStatus.ZERO_RESULTS) {
alert("Nenhuma rota encontrada entre a origem e o destino.");
} else if (google.maps.DirectionsStatus.MAX_WAYPOINTS_EXCEEDED) {
alert("Muitas Rotasforam fornecidas no pedido Direção");
} else if (google.maps.DirectionsStatus.OVER_QUERY_LIMIT) {
alert("Webpage enviou muitas solicitações dentro do prazo permitido.");
} else if (google.maps.DirectionsStatus.INVALID_REQUEST) {
alert("A Directions Request fornecido é inválido.");
} else if (google.maps.DirectionsStatus.REQUEST_DENIED) {
alert("Página da Web não tem permissões para usar o serviço de rotas.");
} else if (google.maps.DirectionsStatus.UNKNOWN_ERROR) {
alert("A rota pedida não pôde ser processada devido a um erro no servidor. O pedido pode ser bem sucedido se você tentar novamente.");
} else {
alert("A rota pedida não pôde ser processada devido a um erro no servidor. O pedido pode ser bem sucedido se você tentar novamente.");
}
});
}
function initMap() {
tstPhocaMap.setAttribute("oldValue",0);
tstPhocaMap.setAttribute("refreshMap",0);
tstIntPhocaMap = setInterval("CheckPhocaMap()",500);
}
function initMaps() {
initMap();
}
//]]></script>]]>
|