jQuery(document).ready(function($){
var altz = jQuery(window).height();
var larg = jQuery(window).width();
$('#vogt_standorte_map').css({
height : altz - 159 - 23 - 23 - 14 - 59
});
var MY_MAPTYPE_ID = 'vogt_style';
var featureOpts = [
{
"stylers": [
{ "saturation": -100 },
{ "lightness": -10 },
{ "gamma": 0.4 }
]
},
{
"featureType": "road",
"elementType": "labels.icon",
"stylers": [
{ "visibility": "off" }
]
},
{
"featureType": "poi",
"stylers": [
{ "visibility": "off" }
]
}
];
var locations = [
['
', 47.4961324, 8.7190118, 1],
['
', 47.95491, 7.81875, 2],
['
', 47.2811796, 9.6759235, 3]
];
var map = new google.maps.Map(document.getElementById('vogt_standorte_map'), {
zoom: 8,
minZoom: 2,
maxZoom: 15,
center: new google.maps.LatLng(47.290408, 8.349609),
mapTypeControl: false,
mapTypeId: MY_MAPTYPE_ID,
streetViewControl: false,
scaleControl: true,
scrollwheel: true
});
var infowindow = new google.maps.InfoWindow();
var styledMapOptions = {
name: 'VP Style'
};
var customMapType = new google.maps.StyledMapType(featureOpts, styledMapOptions);
map.mapTypes.set(MY_MAPTYPE_ID, customMapType);
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
icon: 'https://vogtpartner.eu/pin.png',
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
var bounds = new google.maps.LatLngBounds();
var myPlace1 = new google.maps.LatLng(47.4961324, 8.7190118);
bounds.extend(myPlace1);
var myPlace2 = new google.maps.LatLng(47.95491, 7.81875);
bounds.extend(myPlace2);
var myPlace3 = new google.maps.LatLng(47.2811796, 9.6759235);
bounds.extend(myPlace3);
map.fitBounds(bounds);
});
jQuery(window).resize(function() {
var altz = jQuery(window).height();
var larg = jQuery(window).width();
jQuery('#vogt_standorte_map').css({
height : altz - 159 - 23 - 23 - 14 - 59
});
});