Printing custom markers - <img> vs background-image

549 views
Skip to first unread message

Sandy

unread,
Dec 18, 2009, 12:35:58 AM12/18/09
to Google Maps JavaScript API v3
We are working on a printable version of our map which has a custom
marker image. The marker image is output as a DIV with a CSS
background image, so this image is not visible when printed out.

Is there a way to have the marker image inserted as an IMG so that it
will be visible on the printed map?

Ben Appleton

unread,
Dec 18, 2009, 1:39:35 AM12/18/09
to google-map...@googlegroups.com
To support IE6 we render PNGs as background images in a div.  Unfortunately many browsers drop the background image when printing.

You could try using a custom GIF for your markers.  See here for how to use custom icons:
http://code.google.com/apis/maps/documentation/v3/overlays.html#SimpleIcons
Here are a couple of icons you could try:
http://maps.gstatic.com/mapfiles/markerie.gif
http://maps.gstatic.com/mapfiles/markerff.gif

Failing that, you could use the Static Maps API to make a map that can be printed in all browsers:
http://gmaps-samples.googlecode.com/svn/trunk/simplewizard/makestaticmap.html

Good luck!

- Ben


--

You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.



pete

unread,
Dec 22, 2009, 5:37:14 PM12/22/09
to Google Maps JavaScript API v3
Changing the icon to a GIF instead of a PNG does not fix this.
It seems the API is rendering all markers as "backgrounds" regardless
of their file format.

Any other suggestions? I have a similar issue


On Dec 18, 5:39 pm, Ben Appleton <apple...@google.com> wrote:
> To support IE6 we render PNGs as background images in a div.  Unfortunately
> many browsers drop the background image when printing.
>
> You could try using a custom GIF for your markers.  See here for how to use

> custom icons:http://code.google.com/apis/maps/documentation/v3/overlays.html#Simpl...
> Here are a couple of icons you could try:http://maps.gstatic.com/mapfiles/markerie.gifhttp://maps.gstatic.com/mapfiles/markerff.gif


>
> Failing that, you could use the Static Maps API to make a map that can be

> printed in all browsers:http://gmaps-samples.googlecode.com/svn/trunk/simplewizard/makestatic...
>
> Good luck!
>
> - Ben


>
> On Fri, Dec 18, 2009 at 4:35 PM, Sandy <sandipto...@gmail.com> wrote:
> > We are working on a printable version of our map which has a custom
> > marker image. The marker image is output as a DIV with a CSS
> > background image, so this image is not visible when printed out.
>
> > Is there a way to have the marker image inserted as an IMG so that it
> > will be visible on the printed map?
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps JavaScript API v3" group.
> > To post to this group, send email to
> > google-map...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2Bunsu...@googlegroups.com>

pete

unread,
Jan 3, 2010, 11:47:39 PM1/3/10
to Google Maps JavaScript API v3
Bump

On Dec 23 2009, 9:37 am, pete <petejun...@gmail.com> wrote:
> Changing the icon to a GIF instead of a PNG does not fix this.

> It seems the API is rendering allmarkersas "backgrounds" regardless


> of their file format.
>
> Any other suggestions? I have a similar issue
>
> On Dec 18, 5:39 pm, Ben Appleton <apple...@google.com> wrote:
>
> > To support IE6 we render PNGs as background images in a div.  Unfortunately
> > many browsers drop the background image whenprinting.
>

> > You could try using a custom GIF for yourmarkers.  See here for how to use
> > custom icons:http://code.google.com/apis/maps/documentation/v3/overlays.html#Simpl...
> > Here are a couple of icons you could try:http://maps.gstatic.com/mapfiles/markerie.gifhttp://maps.gstatic.com/...

Ben Appleton

unread,
Jan 5, 2010, 6:49:09 PM1/5/10
to google-map...@googlegroups.com
Please add this to the issue tracker.  We prioritize feature requests by popularity.

To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages