0

Hot to print gmaps?

asked 2015-05-10 10:44:29 +0800

lramellavotta gravatar image lramellavotta flag of Italy
200 1 8

Hi, what is the best way to print a gmaps object?

I read this article but I do not like this methodology very much, though.

thanks for your help

Luca

delete flag offensive retag edit

7 Answers

Sort by ยป oldest newest most voted
0

answered 2015-05-10 11:09:45 +0800

Darksu gravatar image Darksu
1991 1 4

Hello lramellavotta,

You could print using the following javascript:

var content = document.getElementByID('mapMainCanvas'); //has to be first.
var win = window.open();
win.document.write(content);
win.print();
win.close();

Or you could open it in a new window, and print it with zk.

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2015-05-10 17:49:29 +0800

lramellavotta gravatar image lramellavotta flag of Italy
200 1 8

updated 2015-05-10 17:50:09 +0800

Hi Darksu,

        <button label="" image="/images/Stampa.png"  width="120px" height="45px">
            <attribute name="onClick">
                Clients.evalJavaScript("cmdPrint('" +gmaps.getUuid()+ "')");
            </attribute>
        </button>

        <script type="text/javascript">
        function cmdPrint(uuid)
        {       
            var content = zk.Widget.$("$gmaps");

            var win = window.open();
            win.document.write(content);
            win.print();
            win.close();
        }
    </script>

<gmaps version="3.9" id="gmaps" width="1100px" height="470px" showSmallCtrl="true" />

If I run this code I print a page with [object Object] and nothing other......

p.s. uuid is for other test

link publish delete flag offensive edit
0

answered 2015-05-11 17:29:59 +0800

lramellavotta gravatar image lramellavotta flag of Italy
200 1 8

updated 2015-05-11 17:33:53 +0800

This code print the map but without gmarker... ?!?!?

        <script type="text/javascript">
        function cmdPrint(uuid)
        {       
            var content = zk.Widget.$('$gmaps');                
            var win = window.open();
            win.document.writeln($(content).html());
            win.print();
            win.close();
        }
    </script>
link publish delete flag offensive edit
0

answered 2015-05-12 10:25:11 +0800

Nateno gravatar image Nateno
1
http://www.kredytomania.e...

that doesnt work with me!

link publish delete flag offensive edit
0

answered 2015-05-13 10:36:54 +0800

lramellavotta gravatar image lramellavotta flag of Italy
200 1 8

Hi Nateno, this my code (with zk 6.5.3)

            <button label="" image="/images/Stampa.png"  width="120px" height="45px">
                    <attribute name="onClick">
                        Clients.evalJavaScript("cmdPrint('" +gmaps.getUuid()+ "')");
                    </attribute>
            </button>

            <gmaps version="3.9" id="gmaps" width="1100px" height="470px" showSmallCtrl="true" />
link publish delete flag offensive edit
0

answered 2015-05-13 17:23:13 +0800

lramellavotta gravatar image lramellavotta flag of Italy
200 1 8

I read, from stackoverflow, a note related a "gmnoprint". This section lock printable markers. The I tried to remove....but without success... this is a wrong way

function cmdPrint(uuid)
        {               
            var content = zk.Widget.$('$gmaps');

            var custom = jq($(content)).clone();

            $(custom).find('.gmnoprint').remove('gmnoprint');
            $(custom).find('.gmnoprint').removeClass('gmnoprint');

            var win = window.open();
            win.document.write("<TITLE>Stampa cartina</TITLE>");

            win.document.write($(custom).html());

            //win.print();
            //win.close();
        }
link publish delete flag offensive edit
0

answered 2015-05-17 13:49:25 +0800

lramellavotta gravatar image lramellavotta flag of Italy
200 1 8

It surprises me that this problem it is so difficult to solve...

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2015-05-10 10:44:29 +0800

Seen: 20 times

Last updated: May 17 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More