Note that there are some explanatory texts on larger screens.

plurals
  1. POPrinting google maps in a webbrowser control - won't show directions line
    primarykey
    data
    text
    <p>Using IE 11, Windows 8.1.</p> <p>I'm plugging in the following into a windows form application: </p> <pre><code> var html = "&lt;iframe width=\"425\" height=\"350\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" " + "src=\"https://maps.google.com/maps?f=d&amp;amp;source=s_d&amp;amp;saddr=Oklahoma+City,+OK&amp;amp;daddr=texas&amp;amp;hl=en&amp;amp;" + "geocode=FSgxHQIddAQw-imB0vh-VIqthzGdOk_RdBKiMw%3BFVfN5wEdi54L-ilJMoILNnBAhjE83ggYjxzrFg&amp;amp;aq=t&amp;amp;sll=39.632471," + "-56.554076&amp;amp;sspn=61.466508,135.263672&amp;amp;mra=ls&amp;amp;ie=UTF8&amp;amp;t=m&amp;amp;z=7&amp;amp;output=embed\"&gt;" + "&lt;/iframe&gt;" + "&lt;br /&gt;&lt;small&gt;&lt;a href=\"https://maps.google.com/maps?f=d&amp;amp;source=embed&amp;amp;saddr=Oklahoma+City,+OK&amp;amp;daddr=texas" + "&amp;amp;hl=en&amp;amp;geocode=FSgxHQIddAQw-imB0vh-VIqthzGdOk_RdBKiMw%3BFVfN5wEdi54L-ilJMoILNnBAhjE83ggYjxzrFg&amp;amp;aq=t&amp;amp;" + "sll=39.632471,-56.554076&amp;amp;sspn=61.466508,135.263672&amp;amp;mra=ls&amp;amp;ie=UTF8&amp;amp;t=m&amp;amp;z=7\" style=\"color:#0000FF;" + "text-align:left\"&gt;View Larger Map&lt;/a&gt;&lt;/small&gt;"; webBrowser1.DocumentText = (html); </code></pre> <p>Now I want to print this as seen, but it doesn't show the directions lines when I got to printpreview</p> <pre><code> private void button1_Click(object sender, EventArgs e) { this.webBrowser1.ShowPrintPreviewDialog(); } </code></pre> <p>I have tried different browser emulations and still no way to print the direction lines in google maps. IE6 - 11 with no luck.</p> <pre><code> SetBrowserFeatureControlKey("FEATURE_BROWSER_EMULATION", fileName, GetBrowserEmulationMode()); public static UInt32 GetBrowserEmulationMode() { int browserVersion = 7; using (var ieKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer", RegistryKeyPermissionCheck.ReadSubTree, System.Security.AccessControl.RegistryRights.QueryValues)) { var version = ieKey.GetValue("svcVersion"); if (null == version) { version = ieKey.GetValue("Version"); if (null == version) throw new ApplicationException("Microsoft Internet Explorer is required!"); } int.TryParse(version.ToString().Split('.')[0], out browserVersion); } // Internet Explorer 10. Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode. Default value for Internet Explorer 10. UInt32 mode = 11000; switch (browserVersion) { case 7: // Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode. Default value for applications hosting the WebBrowser Control. mode = 7000; break; case 8: // Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode. Default value for Internet Explorer 8 mode = 8000; break; case 9: // Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode. Default value for Internet Explorer 9. mode = 9000; break; case 10: // Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode. Default value for Internet Explorer 9. mode = 10000; break; default: // use IE10 mode by default break; } return mode; } </code></pre> <p>Can anyone help me find out why this doesn't print the directions lines? Keep in mind, directly plugging in this html into a .html file and opening with IE, will show the directions lines. But they do not print.</p> <p><strong>Update</strong></p> <p>Using IE, you can plug in the following into a document with extension html.</p> <pre><code>&lt;iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=d&amp;amp;source=s_d&amp;amp;saddr=Mesa,+AZ+85201&amp;amp;daddr=85258&amp;amp;hl=en&amp;amp;geocode=FXkl_gEduWFV-Sm5aealKggrhzGuOvW7FLWhww%3BFQ8xAAIdIJBU-SmHMd6RyworhzFB0o03Vh1_HQ&amp;amp;aq=t&amp;amp;sll=34.168218,-111.930907&amp;amp;sspn=16.819377,33.815918&amp;amp;mra=ls&amp;amp;ie=UTF8&amp;amp;t=m&amp;amp;ll=33.511629,-111.898842&amp;amp;spn=0.100189,0.145912&amp;amp;z=12&amp;amp;output=embed"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;small&gt;&lt;a href="https://maps.google.com/maps?f=d&amp;amp;source=embed&amp;amp;saddr=Mesa,+AZ+85201&amp;amp;daddr=85258&amp;amp;hl=en&amp;amp;geocode=FXkl_gEduWFV-Sm5aealKggrhzGuOvW7FLWhww%3BFQ8xAAIdIJBU-SmHMd6RyworhzFB0o03Vh1_HQ&amp;amp;aq=t&amp;amp;sll=34.168218,-111.930907&amp;amp;sspn=16.819377,33.815918&amp;amp;mra=ls&amp;amp;ie=UTF8&amp;amp;t=m&amp;amp;ll=33.511629,-111.898842&amp;amp;spn=0.100189,0.145912&amp;amp;z=12" style="color:#0000FF;text-align:left"&gt;View Larger Map&lt;/a&gt;&lt;/small&gt; </code></pre> <p>This will print everything correctly in firefox. I have tested this out on multiple printers.</p> <p>This does not print correctly in IE. I have tried the following:</p> <p><a href="https://support.google.com/maps/answer/21849?hl=en" rel="nofollow">https://support.google.com/maps/answer/21849?hl=en</a></p> <p>Any ideas on how to get the lines to show up?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload