2

I am able to point the marker on the map and it is visible on the browser. But when I print the same, the marker isn't visible on the map. Please help.

<button class="map-print" ng-click="mapprint();">print</button>
[enter image description here][1]<script>
function mapprint(){
    var content = document.getElementById('map_div'); //has to be first. 
    content.style.position = "relative"; 
    content.style.height = contents.firstChild.offsetHeight + "px"; 
    content.style.width = contents.firstChild.offsetWidth + "px"; 
    var win = window.open(); 
    win.document.write(content.innerHTML);
    win.print();
    win.close();    
}

I got print of the map. But canot load the map marker

this is my web view

This is my Map print view

  • 5
    Possible duplicate of [How to print Google Map markers](https://stackoverflow.com/questions/3730767/how-to-print-google-map-markers) – Deep 3015 Jun 06 '17 at 09:45

1 Answers1

1

The printing is not supported by Google Maps JavaScript API. Have a look at the following answer in the official FAQ

https://developers.google.com/maps/faq#print

Printing from the JavaScript API is not supported. This is because printing support is inconsistent across commonly used browsers. We recommend using the Static Maps API for printing purposes.

xomena
  • 31,125
  • 6
  • 88
  • 117