The company I work for uses OneTrust to handle GDPR. I have the task to make a google map show up. I have had issues making the https://maps.googleapis.com/maps/api
script tag to work as I wanted to use a library. Anyway I got it working by adding the attribute data-ot-ignore
to the script
tag. But now the maps thing is not calling my back end to get the layers I need to put on top of the map. I have an API that I call and it works fine in a local, contrived sample but once it’s on the full blown test environment it just won’t call my API to get the layers
The way google maps retrieves the layers is by calling the function in the ImageMapTyle object we have to define:
new google.maps.ImageMapType({
getTileUrl(coord, zoom): string {
return `${coverage_rest_root}/tiles/service/gmaps?layers=${layerProps[overlayRev].apiName}&zoom=${zoom}&x=${coord.x}&y=${coord.y}&format=image/png`;
},
tileSize: new google.maps.Size(TILE_SIZE, TILE_SIZE),
opacity: layerProps[overlayRev].opacity,
name: overlayRev,
});
which makes me not be able to add neither a class nor an attribute, which are the two ways to tell OneTrust to ignore the script