Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/447.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用内部画布打印谷歌地图_Javascript_Google Maps_Canvas_Google Maps Api 3_Printing - Fatal编程技术网

Javascript 使用内部画布打印谷歌地图

Javascript 使用内部画布打印谷歌地图,javascript,google-maps,canvas,google-maps-api-3,printing,Javascript,Google Maps,Canvas,Google Maps Api 3,Printing,我试图打印一个div,其中包含一个谷歌地图,其中包含一条路线和一些标记,以及一个包含一些信息的表格。当我打印那张地图时,除了路线和标记外,一切都正常。他们只是不愿意用地图打印。因为我读到这篇文章是因为路线和标记在画布中,但我无法让它工作。有人能帮我改变我使用的逻辑吗?。代码如下: HTML: {{labelbotomstrar}} 疫苗 Exportar a KML Exportar a GPX 不正当 新即兴 {{tituloMapa | |'''}} # 名义 霍拉里奥酒店 霍拉里奥酒

我试图打印一个div,其中包含一个谷歌地图,其中包含一条路线和一些标记,以及一个包含一些信息的表格。当我打印那张地图时,除了路线和标记外,一切都正常。他们只是不愿意用地图打印。因为我读到这篇文章是因为路线和标记在画布中,但我无法让它工作。有人能帮我改变我使用的逻辑吗?。代码如下:

HTML:


{{labelbotomstrar}}
疫苗
  • Exportar a KML
  • Exportar a GPX
  • 不正当
  • 新即兴
{{tituloMapa | |'''}} # 名义 霍拉里奥酒店 霍拉里奥酒店 霍拉里奥酒店 {{$index+1}} {{Parada.Nombre} {{Parada.Horario1 | formatTime} {{Parada.Horario2 | formatTime} {{Parada.Horario3 | formatTime}
Javascript:

scope.printNuevo = function (elem) {
                Popup($(elem).html());
            }

            function Popup(data) {
                var mywindow = window.open('', 'my div', 'height=400,width=600');
                mywindow.document.write('<html><head><title>my div</title>');
                /*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
                mywindow.document.write('</head><body >');
                mywindow.document.write(data);
                mywindow.document.write('</body></html>');

                mywindow.print();
                mywindow.close();

                return true;
            }
scope.printNuevo=函数(elem){
弹出($(elem.html());
}
功能弹出窗口(数据){
var mywindow=window.open(“”,'my div','height=400,width=600');
mywindow.document.write('mydiv');
/*可选样式表*///mywindow.document.write(“”);
mywindow.document.write(“”);
mywindow.document.write(数据);
mywindow.document.write(“”);
mywindow.print();
mywindow.close();
返回true;
}

我试着打印一张谷歌地图,在预览中显示了所有标记和路线。我的示例代码没有出现这种情况。请看我在这篇文章中的答案。
scope.printNuevo = function (elem) {
                Popup($(elem).html());
            }

            function Popup(data) {
                var mywindow = window.open('', 'my div', 'height=400,width=600');
                mywindow.document.write('<html><head><title>my div</title>');
                /*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
                mywindow.document.write('</head><body >');
                mywindow.document.write(data);
                mywindow.document.write('</body></html>');

                mywindow.print();
                mywindow.close();

                return true;
            }