Merge pull request #864 from LaureCh/feature/geoportail-openstreetmap

Add Geoportail-OpenstreetMap embed iframe services
This commit is contained in:
Amauri CHAMPEAUX 2022-02-06 11:31:14 +01:00 committed by GitHub
commit 1af27b6d66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 60 additions and 0 deletions

View File

@ -2089,6 +2089,66 @@ tarteaucitron.services.googlemapsembed = {
} }
}; };
// openstreetmap embed iframe
tarteaucitron.services.openstreetmap = {
"key": "openstreetmap",
"type": "api",
"name": "Openstreetmap Embed",
"uri": "https://wiki.osmfoundation.org/wiki/Privacy_Policy#Cookies",
"needConsent": true,
"cookies": ['apisid', 'hsid', 'nid', 'sapisid', 'sid', 'sidcc', 'ssid', '1p_jar'],
"js": function () {
"use strict";
tarteaucitron.fallback(['openstreetmap'], function (x) {
var width = tarteaucitron.getElemWidth(x),
height = tarteaucitron.getElemHeight(x),
url = x.getAttribute("data-url");
return '<iframe src="' + url + '" width="' + width + '" height="' + height + '" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" allowfullscreen></iframe>';
});
},
"fallback": function () {
"use strict";
var id = 'openstreetmap';
tarteaucitron.fallback(['openstreetmap'], function (elem) {
elem.style.width = tarteaucitron.getElemWidth(elem) + 'px';
elem.style.height = tarteaucitron.getElemHeight(elem) + 'px';
return tarteaucitron.engage(id);
});
}
};
// geoportail embed iframe
tarteaucitron.services.geoportail = {
"key": "geoportail",
"type": "api",
"name": "Geoportail maps Embed",
"uri": "https://www.ign.fr/institut/gestion-des-cookies",
"needConsent": true,
"cookies": ['apisid', 'hsid', 'nid', 'sapisid', 'sid', 'sidcc', 'ssid', '1p_jar'],
"js": function () {
"use strict";
tarteaucitron.fallback(['geoportail'], function (x) {
var width = tarteaucitron.getElemWidth(x),
height = tarteaucitron.getElemHeight(x),
url = x.getAttribute("data-url");
return '<iframe src="' + url + '" width="' + width + '" height="' + height + '" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" sandbox="allow-forms allow-scripts allow-same-origin" allowfullscreen></iframe>';
});
},
"fallback": function () {
"use strict";
var id = 'geoportail';
tarteaucitron.fallback(['geoportail'], function (elem) {
elem.style.width = tarteaucitron.getElemWidth(elem) + 'px';
elem.style.height = tarteaucitron.getElemHeight(elem) + 'px';
return tarteaucitron.engage(id);
});
}
};
// google tag manager // google tag manager
tarteaucitron.services.googletagmanager = { tarteaucitron.services.googletagmanager = {
"key": "googletagmanager", "key": "googletagmanager",