112
| <![CDATA[<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.3&appId=729585460503347";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>]]>
|
308
| <![CDATA[<script type='text/javascript'>
function callMapsApi(initWhat) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyAV0ka_NktwSWkKqpxfJFtl7qbq3B01N5M&callback='+initWhat;
document.body.appendChild(script);
}
function waitGoogleLoad(callback, numberCall){
numberCall++;
if (typeof google === 'undefined' || typeof google.maps === 'undefined') {
if(parseInt(numberCall) < 5){
setTimeout(
'waitGoogleLoad('+callback+','+numberCall+')',
1000
);
}
} else {
setTimeout(callback, 0);
}
}
var map1 = null;
function showMap1() {
latitude = -19.681132;
longitude = -44.889760;
zoom = 16;
//define configuração de latitude e longitude do mapa
var latLang1 = new google.maps.LatLng(
parseFloat(latitude),
parseFloat(longitude)
);
//configurações do mapa
var mapOptions1 = {
zoom:parseInt(zoom),
center: latLang1,
disableDefaultUI: false,
navigationControl: false,
mapTypeControl: false,
scrollwheel: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
//inicializa mapa
map1 = new google.maps.Map(
document.getElementById('mapa_setor'),
mapOptions1
);
//chama função de onresize para centralizar mapa
google.maps.event.trigger(map1, 'resize');
//cria markers
geocoder = new google.maps.Geocoder();
var latLangMarker1_0 = new google.maps.LatLng(
parseFloat(-19.681132),
parseFloat(-44.889760)
);
marker1_0 = new google.maps.Marker({
position: latLangMarker1_0,
map: map1,
icon: '',
title: '',
draggable:false
});
infoWindowOpened1_0 = false;
infowindow1_0 = new google.maps.InfoWindow(
{content:unescape(' <div style="width:350px;"> <div id="bodyContent"> <div class="col-md-12 col-xs-12"> <p style="margin-bottom:0px;"><strong>Casarão de Maria Tangará</strong></p><p style="margin-bottom:0px;">Rua Coronel Américo Bahia, 115 ; ; ;Bairro: São Francisco</p><p style="margin-bottom:0px;">Pitangui / MG</p><p style="margin-bottom:0px;">35650-000</p> </div> </div> </div> ')}
);
//abre infowindow
google.maps.event.addListener(
marker1_0,
'click',
function() {
if (!infoWindowOpened1_0) {
infowindow1_0.open(
map1,
marker1_0
);
infoWindowOpened1_0 = true;
} else {
infowindow1_0.close();
infoWindowOpened1_0 = false;
}
map1.setCenter(latLang1);
}
);
google.maps.event.addListener(
infowindow1_0,
'closeclick',
function() {
infoWindowOpened1_0 = false;
console.log(this.getPosition());
map1.setCenter(this.getPosition());
}
);
google.maps.event.addListener(
map1,
'click',
function() {
infowindow1_0.close();
infoWindowOpened1_0 = false;
}
);
//função para centralizar o mapa ao redimencionar a tela
google.maps.event.addDomListener(
window,
'resize',
function() {
center = map1.getCenter();
google.maps.event.trigger(map1, 'resize');
map1.setCenter(center);
}
);
}
function setMarkerPosition(marker, address) {
geocoder.geocode(
{'address': address},
function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
marker.setPosition(results[0].geometry.location);
}
}
);
}
$(function() {
if (typeof google !== 'undefined' && typeof google.maps !== 'undefined') {
showMap1();
} else {
callMapsApi('showMap1');
}
});
</script>]]>
|