[OpenLayers-Users] ZoomToExtent works in Firefox, Safari and IE7, but not in IE6

Adam Eskreis aeskreis at gmail.com
Wed May 27 01:57:39 EDT 2009


IE6 compatibility is a mess, no matter what you are dealing with.

I feel your pain.

My first suggestion would be to try to convince your client that IE6
compatibility is unnecessary.

If that fails, try to find something that works with IE6.  Anything.  Do
whatever you can to get it to work.

Then put in a browser test in the javascript.  If the browser is IE6, use
the compatible code.  Otherwise, use the default code.

-Adam

On Tue, May 26, 2009 at 4:51 AM, sendeman <martijnsendenspam at gmail.com>wrote:

>
> Hi All,
>
> Does anybody have any ideas that might be of help for the problem I
> described previously? Thanks a lot in advance for any help.
>
> If I didn't explain the problem well enough, please let me know, so I can
> clarify it.
>
> Best regards,
> Martijn Senden.
>
>
>
> sendeman wrote:
> >
> > Hi all,
> >
> > I'm trying to make a 'fluid' layout, in which the viewport of the map
> > changes with changes in the size of the browser window. I have some html
> > and css worked out that do this without javascript in IE6. The only
> > problem I have is that the initial zoom level doesn't work in IE 6. IE 6
> > zooms in to the maximum level. Other browsers (IE7, FF, Safari, Chrome)
> do
> > set the zoom level correctly.
> >
> > I set the zoom level as follows:
> >
> > map.zoomToExtent(new
> >
> OpenLayers.Bounds(3.27392578125,50.69471783819287,7.294921875,53.67068019347264));
> >
> > What is it that makes IE 6 go wrong?
> >
> > Any help would be greatly appreciated!
> >
> > Below is the entire code of my test-site.
> >
> > Best regards,
> > Martijn Senden.
> >
> > ____________________________
> > __________</CODE>__________
> > ____________________________
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> >         "http://www.w3.org/TR/html4/strict.dtd">
> > <html lang="NL">
> >  <head>
> >
> >    <title>minOpenLayers.aspx</title>
> >
> >    <script type="text/javascript"
> src="javascript/OpenLayers.js"></script>
> >
> >     <!--[if lt IE 8]>
> >       <script type="text/javascript"
> > src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js<http://ie7-js.googlecode.com/svn/version/2.0%28beta3%29/IE8.js>
> "></script>
> >     <![endif]-->
> >
> >    <script type="text/javascript">
> >
> >        var map, layer;
> >
> >        function init(){
> >
> >            map = new OpenLayers.Map( 'map' );
> >
> >            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
> > "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
> >
> >            map.addLayer(layer);
> >
> >            map.zoomToExtent(new
> >
> OpenLayers.Bounds(3.27392578125,50.69471783819287,7.294921875,53.67068019347264));
> >        }
> >    </script>
> >
> >    <style type="text/css">
> >
> >
> >
> >            #map
> >
> >            {
> >
> >                background-color: Red;
> >
> >                position: absolute;
> >
> >             width: 100%;
> >
> >                height: 100%;
> >
> >            }
> >
> >
> >
> >            #mapWrapper {
> >
> >             position: absolute;
> >
> >             background-color: Blue;
> >
> >             top: 76px;
> >
> >             bottom: 0px;
> >
> >             left: 0px;
> >
> >             right: 0px;
> >
> >            }
> >
> >        </style>
> >
> >
> >
> >  </head>
> >
> >
> >
> >  <body onload="init()">
> >
> >    <div id="mapWrapper"><div id="map" class="smallmap"></div></div>
> >
> >  </body>
> >
> > </html>
> > ____________________________
> > __________</CODE>__________
> > ____________________________
> >
>
> --
> View this message in context:
> http://n2.nabble.com/ZoomToExtent-works-in-Firefox%2C-Safari-and-IE7%2C-but-not-in-IE6-tp2969934p2973551.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090527/be536283/attachment.html


More information about the Users mailing list