[OpenLayers-Users] Automatic or dynamic mapsize

CLAY.LINC CLAY.LINC at flsenate.gov
Wed Aug 27 16:00:32 EDT 2008


Hello List,

Here is a sample JavaScript function that resizes the map based on dragging the lower right.  The 30 and 90 are simply constants that happened to work with my simple map layout taken from an OpenLayers example (in real life they should be declared constants or calculated by getting the dimensions of other layout elements).

  function resize() {
    var agt = navigator.userAgent.toLowerCase();
    if (agt.indexOf('msie') > -1) {
      document.getElementById('map').style.width = document.body.clientWidth - 30;
      document.getElementById('map').style.height = document.body.clientHeight - 90;
    }
    else {
      document.getElementById('map').style.width = window.innerWidth - 30;
      document.getElementById('map').style.height = window.innerHeight - 90;
    }
  }

This function is referenced by using the HTML <BODY> tag.

  <body onload="init()" onresize="resize()">

I hope this is helpful.

-Linc

-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On Behalf Of Semantica
Sent: Wednesday, August 27, 2008 2:31 PM
To: users at openlayers.org
Subject: Re: [OpenLayers-Users] Automatic or dynamic mapsize


Hi Carsten,

See this example for full screen demo:

http://openlayers.org/dev/examples/fullScreen.html

If you get a resizable map window working please post your results as I am
sure many would use it.



Dipl. Inf. Carsten Eider wrote:
> 
> Hi folks,
> 
> I am looking for an example where
> 
>    1. the size of the map depending on the screen-resolution is detected
>       automatically
>    2. the map can be resized by dragging the lower right corner
> 
> Thx Carsten
> 
> -- 
> Mit freundlichen Grüßen / Yours faithfully
> Carsten Eider
> 
> Dipl. Inf. (FH)
> 
> Kompetenzzentrum für Innovative Informationssysteme
> 
> c/o Fachhochschhule Bingen / University of applied sciences Bingen
> 
> Berlinstraße 109
> 55411 Bingen
> 
> Tel: +49 (0) 6721 / 409-179
> Fax: +49 (0) 6721 / 409-158
> email: eider at fh-bingen.de
> Internet: iis.fh-bingen.de 
> 
> 
> begin:vcard
> fn:Carsten Eider
> n:Eider;Carsten
> org:Fachhochschule Bingen;Kompetenzzentrum innovative Informationssysteme
> adr;quoted-printable:;;berlinstra=C3=9Fe 109;Bingen;RLP;55411;Deutschland
> email;internet:eider at fh-bingen.de
> title:Dipl.-Inf.
> tel;work:067214090179
> x-mozilla-html:TRUE
> url:iis.fh-bingen.de
> version:2.1
> end:vcard
> 
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Automatic-or-dynamic-mapsize-tp780753p787756.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users


More information about the Users mailing list