Openlayers : unable to print / export pdf's with google maps while osm works

131 views Asked by At

I am able to print the pdf while refering to the openlayers export to pdf example, https://openlayers.org/en/latest/examples/export-pdf.html, when open street map is set as background is working fine but when I set google map as background it doesn't work it gives an empty canvas.

I have a google map created like this

const mapProperties = {
      center: new google.maps.LatLng(41.902782, 12.496366),
      zoom: 5,
      tilt: 0,
      mapTypeId: google.maps.MapTypeId.SATELLITE,
      maxZoom: 80,
      minZoom: 1,
      disableDefaultUI: true
     };
    this._googleMap = new google.maps.Map(mapsElement, mapProperties);
    var query = ".ol-layer canvas,.tiff,.**google_map**";
    Array.prototype.forEach.call(document.querySelectorAll(query),

using openlayers example I'm trying printing the google map using the class name but it is not rendered maybe because of the cross origin, now the question is how to set cross origin anonymous in the google maps.

0

There are 0 answers