[OpenLayers-Dev] [OpenLayers-Trac] [OpenLayers] #966: Add att ribution control to map by default

John Cole john.cole at uai.com
Wed Sep 12 11:31:00 EDT 2007


Christopher, 
  Yea, I was concerned that it would always be there :-)  Right now,
printing is a PITA, but I'm hoping to have time to work on a solution I
*think* might work.

  This involves making sure all controls and layers have an additional
'noprint' css class on their containers.  Then if a style sheet with a media
option for print is available, it can set the 'noprint' class display: none,
and that should remove all layers and controls.  The trick of course is to
have a base layer with the opposite true, it only gets turned on for the
printing style sheet.  

  I'm hoping that this scheme will allow users to simply hit 'print' from
their browsers and have the maps print out correctly with the rest of the
page, instead of having a separate page for printing.

John

-----Original Message-----
From: Christopher Schmidt [mailto:crschmidt at metacarta.com] 
Sent: Wednesday, September 12, 2007 10:11 AM
To: John Cole
Cc: dev at openlayers.org
Subject: Re: [OpenLayers-Dev] [OpenLayers-Trac] [OpenLayers] #966: Add att
ribution control to map by default

On Wed, Sep 12, 2007 at 10:03:07AM -0500, John Cole wrote:
> Christopher,
>   When we print maps, we are using OpenLayers, as it's still a WMS layer,
> but there is only one base layer.  When we create the OL map, we specify
no
> controls at all, because these can have issues with different browsers
print
> engines (sometimes the top control covers up the entire map, for whatever
> reason).  It would be nice if all the browsers behaved the similar when it
> came to printing, but to reduce the problems we strip the map down to just
> the un-tiled image and nothing else.
> 
>   I'd like to make sure that whenever I print, no other controls exist,
even
> if they are disabled.  I'm worried about an empty div section blocking the
> map during printing.  If the control has it's outer div set to
display:none,
> then I doubt it would interfere, but just an empty one may cause problems.

Ah, then your'e fine with this: this only adds it to the map by
*default* -- that is, if no  controls:[] option is specified on the map.
If you specify controls: [], then the control isn't added -- I think
this was Paul's question as well, which I hope I adequately responded to
there. 

This is *only* for the 'standard' default OL map -- if you want to
customize your map, we're not going to force you into a specific
direction. 

With that in mind, do you forsee a problem? or was your concern just
that it would be added to the map regardless of what was specified in
the map intializer control list? 

Regards,
-- 
Christopher Schmidt
MetaCarta

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.485 / Virus Database: 269.13.15/1003 - Release Date: 9/12/2007
10:56 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.485 / Virus Database: 269.13.15/1003 - Release Date: 9/12/2007
10:56 AM
 
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.



More information about the Dev mailing list