Discussion:
Printing Polylines in FF
B***@gmail.com
2007-09-11 18:37:44 UTC
Permalink
I know about the issues FF (and other browsers) when printing semi-
transparent PNG's. However, is there a way to work around it?

i've tried putting PolyLines using:
piPoly = new GPolyline(points, "#0000FF", 2, 1);

so it wouldn't have an alpha channel but that doesn't work.

Any thoughts... or am I SOL?
Garthan
2007-09-11 20:37:44 UTC
Permalink
Firefox uses SVG for rendering polylines so that wont work.
I think I recall seeing an example of a page where they looped
through the svg elements and made a css style change
to allow them to print.
Post by B***@gmail.com
I know about the issues FF (and other browsers) when printing semi-
transparent PNG's. However, is there a way to work around it?
piPoly = new GPolyline(points, "#0000FF", 2, 1);
so it wouldn't have an alpha channel but that doesn't work.
Any thoughts... or am I SOL?
B***@gmail.com
2007-09-11 20:40:42 UTC
Permalink
So there's no way in telling google maps to render the lines like they
would in ie eh? :P
Post by Garthan
Firefox uses SVG for rendering polylines so that wont work.
I think I recall seeing an example of a page where they looped
through the svg elements and made a css style change
to allow them to print.
Post by B***@gmail.com
I know about the issues FF (and other browsers) when printing semi-
transparent PNG's. However, is there a way to work around it?
piPoly = new GPolyline(points, "#0000FF", 2, 1);
so it wouldn't have an alpha channel but that doesn't work.
Any thoughts... or am I SOL?
B***@gmail.com
2007-09-11 20:41:59 UTC
Permalink
Wish there was an edit option...

On a side note, FireFox does print SVG's: http://www.croczilla.com/svg/samples/arcs1/arcs1.svg

It must be how Google is rendering them.
Post by B***@gmail.com
So there's no way in telling google maps to render the lines like they
would in ie eh? :P
Post by Garthan
Firefox uses SVG for rendering polylines so that wont work.
I think I recall seeing an example of a page where they looped
through the svg elements and made a css style change
to allow them to print.
Post by B***@gmail.com
I know about the issues FF (and other browsers) when printing semi-
transparent PNG's. However, is there a way to work around it?
piPoly = new GPolyline(points, "#0000FF", 2, 1);
so it wouldn't have an alpha channel but that doesn't work.
Any thoughts... or am I SOL?
Mike Williams [Maps API Guru]
2007-09-12 05:55:51 UTC
Permalink
When you click the print link in maps.google.com the printable minimaps
are not GMap()s with SVG lines on them, they're GIF images with the
lines painted onto the image. The Google "mapprint" server takes the
polyline information, paints it onto a GIF image and returns that to the
client, like this:
http://tinyurl.com/yt39qq
All compatible browsers print GIF images correctly, so that works in all
environments.

When you enable "Show original map view" in maps.google.com print, then
the original view *is* a GMap() with SVG polylines, but when you print
the map the lines in that view do not print.

We don't have permission to use the "mapprint" server.

[If you did want to use the "mapprint", which I know you wouldn't
without permission, the parameters are
c lat,lng of map centre * 1000000
r size of generated GIF image in pixels
z 17 - zoom (i.e zoom level in APIv1 format)
l lat,lng of a waypoint *1000000
p pixel-encoded polyline information
(not the same as a normal Encoded Polyline)
(which encodes the lat/lngs)]
--
http://econym.googlepages.com/index.htm
The Blackpool Community Church Javascript Team
bryce
2007-09-12 14:08:08 UTC
Permalink
Hello,

Yes, I think you can make polyline/polygon printable.

If you use protoptye.js, it's relatively simple. I use this code.

// To make polygons printable...
$$("div.gmnoprint").each( function (div, index) {
div.removeClassName('gmnoprint');
});

gmnoprint is a CSS class name Google Maps uses for polygons (not sure
for polylines) which as the name suggests makes polygons non-printable
(I guess it defines display:none in CSS).

So simply removing this class makes polygons printable.
Testes with FF2.0

Hope this gives you a clue.
Post by Garthan
Firefox uses SVG for rendering polylines so that wont work.
I think I recall seeing an example of a page where they looped
through the svg elements and made a css style change
to allow them to print.
Post by B***@gmail.com
I know about the issues FF (and other browsers) when printing semi-
transparent PNG's. However, is there a way to work around it?
piPoly = new GPolyline(points, "#0000FF", 2, 1);
so it wouldn't have an alpha channel but that doesn't work.
Any thoughts... or am I SOL?
dfd
2007-09-12 15:00:19 UTC
Permalink
Shure you can iterate thru the dom and remove the class, but printing
svg in ff is still unsatisfactorily - the "background" is not
transparent :-( Do you _really_ have printed out the map on paper? Or
(like me some month ago) just look to the print-preview?

Just a note, as its useless: gmnoprint is not a class assigned to a
svg - its assigned to the parent of the svg, which is a div. In your
case you make the controls printable, too. You should look for all svg
and then take the first parent ;-)

Regards, frank aka dfd
Post by bryce
Hello,
Yes, I think you can make polyline/polygon printable.
If you use protoptye.js, it's relatively simple. I use this code.
// To make polygons printable...
$$("div.gmnoprint").each( function (div, index) {
div.removeClassName('gmnoprint');
});
gmnoprint is a CSS class name Google Maps uses for polygons (not sure
for polylines) which as the name suggests makes polygons non-printable
(I guess it defines display:none in CSS).
So simply removing this class makes polygons printable.
Testes with FF2.0
Hope this gives you a clue.
Post by Garthan
Firefox uses SVG for rendering polylines so that wont work.
I think I recall seeing an example of a page where they looped
through the svg elements and made a css style change
to allow them to print.
Post by B***@gmail.com
I know about the issues FF (and other browsers) when printing semi-
transparent PNG's. However, is there a way to work around it?
piPoly = new GPolyline(points, "#0000FF", 2, 1);
so it wouldn't have an alpha channel but that doesn't work.
Any thoughts... or am I SOL?
B***@gmail.com
2007-09-12 16:04:45 UTC
Permalink
Thanks for the info guys.

The free API doesn't allow us to use the mapprint server... does
anyone know if the enterprise version does?
Post by dfd
Shure you can iterate thru the dom and remove the class, but printing
svg in ff is still unsatisfactorily - the "background" is not
transparent :-( Do you _really_ have printed out the map on paper? Or
(like me some month ago) just look to the print-preview?
Just a note, as its useless: gmnoprint is not a class assigned to a
svg - its assigned to the parent of the svg, which is a div. In your
case you make the controls printable, too. You should look for all svg
and then take the first parent ;-)
Regards, frank aka dfd
Post by bryce
Hello,
Yes, I think you can make polyline/polygon printable.
If you use protoptye.js, it's relatively simple. I use this code.
// To make polygons printable...
$$("div.gmnoprint").each( function (div, index) {
div.removeClassName('gmnoprint');
});
gmnoprint is a CSS class name Google Maps uses for polygons (not sure
for polylines) which as the name suggests makes polygons non-printable
(I guess it defines display:none in CSS).
So simply removing this class makes polygons printable.
Testes with FF2.0
Hope this gives you a clue.
Post by Garthan
Firefox uses SVG for rendering polylines so that wont work.
I think I recall seeing an example of a page where they looped
through the svg elements and made a css style change
to allow them to print.
Post by B***@gmail.com
I know about the issues FF (and other browsers) when printing semi-
transparent PNG's. However, is there a way to work around it?
piPoly = new GPolyline(points, "#0000FF", 2, 1);
so it wouldn't have an alpha channel but that doesn't work.
Any thoughts... or am I SOL?
bryce
2007-09-12 18:54:18 UTC
Permalink
Yeah, polygons are not transparent. I printed it on a sheet of paper.

My application creates a kind of a print version where no controls/
navigation bar are added (and copying polygons/markers from the screen
version). So my code works except polygons are not transparent... Not
necessarily "useless."
Post by dfd
Shure you can iterate thru the dom and remove the class, but printing
svg in ff is still unsatisfactorily - the "background" is not
transparent :-( Do you _really_ have printed out the map on paper? Or
(like me some month ago) just look to the print-preview?
Just a note, as its useless: gmnoprint is not a class assigned to a
svg - its assigned to the parent of the svg, which is a div. In your
case you make the controls printable, too. You should look for all svg
and then take the first parent ;-)
Regards, frank aka dfd
Post by bryce
Hello,
Yes, I think you can make polyline/polygon printable.
If you use protoptye.js, it's relatively simple. I use this code.
// To make polygons printable...
$$("div.gmnoprint").each( function (div, index) {
div.removeClassName('gmnoprint');
});
gmnoprint is a CSS class name Google Maps uses for polygons (not sure
for polylines) which as the name suggests makes polygons non-printable
(I guess it defines display:none in CSS).
So simply removing this class makes polygons printable.
Testes with FF2.0
Hope this gives you a clue.
Post by Garthan
Firefox uses SVG for rendering polylines so that wont work.
I think I recall seeing an example of a page where they looped
through the svg elements and made a css style change
to allow them to print.
Post by B***@gmail.com
I know about the issues FF (and other browsers) when printing semi-
transparent PNG's. However, is there a way to work around it?
piPoly = new GPolyline(points, "#0000FF", 2, 1);
so it wouldn't have an alpha channel but that doesn't work.
Any thoughts... or am I SOL?
Loading...