Modif pour n'avoir qu'un seul appel à l'API GoogleMaps, si les modules Colissimo et MondialRelay sont tous deux actifs.
This commit is contained in:
@@ -151,7 +151,7 @@
|
||||
{/for}
|
||||
]
|
||||
};
|
||||
|
||||
/*
|
||||
function loadScript() {
|
||||
var script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
@@ -161,7 +161,7 @@
|
||||
script.async = true;
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
|
||||
*/
|
||||
function loadRelayMap() {
|
||||
var $relayInfo = $('#relay_info');
|
||||
|
||||
@@ -268,13 +268,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
if (typeof(google) === 'undefined') {
|
||||
loadScript();
|
||||
} else {
|
||||
mondialRelaySetup();
|
||||
}
|
||||
|
||||
*/
|
||||
function mondialRelaySetup() {
|
||||
// Google Map
|
||||
var MRData_mapOptions = {
|
||||
|
||||
@@ -443,7 +443,7 @@
|
||||
var script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.src = 'https://maps.googleapis.com/maps/api/js'
|
||||
+ '?callback=SoColissimoInitialize'
|
||||
+ '?callback=initMaps'
|
||||
+ '&key={config key="socolissimo_google_map_key"}';
|
||||
script.async = true;
|
||||
document.body.appendChild(script);
|
||||
@@ -452,9 +452,15 @@
|
||||
if (typeof(google) == 'undefined') {
|
||||
loadScript();
|
||||
} else {
|
||||
SoColissimoInitialize();
|
||||
initMaps();
|
||||
}
|
||||
|
||||
function initMaps() {
|
||||
if (typeof SoColissimoInitialize === "function") SoColissimoInitialize();
|
||||
if (typeof mondialRelaySetup === "function") mondialRelaySetup();
|
||||
}
|
||||
|
||||
|
||||
function SoColissimoInitialize() {
|
||||
if (typeof initialize_so == 'function') {
|
||||
initialize_so();
|
||||
|
||||
Reference in New Issue
Block a user