"use strict";
MapManager.registerAPICall(
"agencesVirtualys",
function(map, params) {
var settings = [
// Brest
{
point: { lat: 48.392355, lng: -4.479628 },
icon: {
off: {
url: "/bundles/virtualyssnsvirtualysskin/images/map/marker_brest.png",
size: new google.maps.Size(74, 30),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(15, 22)
},
on: {
url: "/bundles/virtualyssnsvirtualysskin/images/map/marker_brest.png",
size: new google.maps.Size(74, 30),
origin: new google.maps.Point(0, 30),
anchor: new google.maps.Point(15, 22)
}
},
content: "
Siège de la société
41 rue Yves Collet - 29200 BREST
\
Téléphone : +33 (0)2 98 05 29 71
Fax : +33 (0)2 98 05 59 19
Courriel : contact@virtualys.fr
"
},
// Bordeaux
{
point: { lat: 44.794073, lng: -0.623794 },
icon: {
off: {
url: "/bundles/virtualyssnsvirtualysskin/images/map/marker_bordeaux.png",
size: new google.maps.Size(102, 30),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(15, 22)
},
on: {
url: "/bundles/virtualyssnsvirtualysskin/images/map/marker_bordeaux.png",
size: new google.maps.Size(102, 30),
origin: new google.maps.Point(0, 30),
anchor: new google.maps.Point(15, 22)
}
},
content: "Agence de Bordeaux-Gradignan
Parc TechnoClub
\
Avenue de l'Hippodrome - 33170 Gradignan
\
Téléphone : +33 (0)5 57 21 56 19
Courriel : contact@virtualys.fr
"
}
];
var bounds = false,
paddingGeo = .25;
for (var i = 0; i < settings.length; ++i) {
var iconOn = settings[i].icon.on,
iconOff = settings[i].icon.off,
marker = new google.maps.Marker({
position: settings[i].point,
map: map,
animation: google.maps.Animation.DROP,
icon: iconOff
});
marker.addListener('mouseover', (function(marker, iconOn) {
return function() {
marker.setIcon(iconOn);
};
})(marker, iconOn));
marker.addListener('mouseout', (function(marker, iconOff) {
return function() {
marker.setIcon(iconOff);
};
})(marker, iconOff));
marker.addListener('click', (function(address) {
return function() {
$(".address_agency").html(address);
};
})(settings[i].content));
var pointBounds = new google.maps.LatLngBounds({
lat: settings[i].point.lat - paddingGeo,
lng: settings[i].point.lng - paddingGeo
},
{
lat: settings[i].point.lat + paddingGeo,
lng: settings[i].point.lng + paddingGeo
});
if (bounds) {
bounds.union(pointBounds);
}
else {
bounds = pointBounds;
}
}
return bounds;
}
);