[OpenLayers-Users] maxExent is Null.

Eric Lemoine eric.lemoine at camptocamp.com
Mon May 18 18:32:46 EDT 2009


On Tuesday, May 19, 2009, Nicholas Efremov-Kendall
<n.e.kendall at gmail.com> wrote:
> Hi All,

Hi

> Again, newbie issues, but maybe someone can suggest something for clarity. I'm trying to set up a map in Epsg:22332 (utm 32n). However, I'm getting a firebug error maxExtent is null.
> here is the short version of my code
>
>  <script type="text/javascript">
> var lon = 675833.7195
>         var lat = 3740782.6657
>         var zoom = 10;
>         var map, layer
>         var options = {
>         maxResolution: 'auto',
>         maxExtent: new OpenLayers.Bounds(568446.75, 3565307.25, 813860.25, 3781736.25),
>         projection: new OpenLayers.Projection("EPSG:22332"),
>         units: "meters"
>         };
>    function init(){
>            map = new OpenLayers.Map('map', options)
>         var jerbaSites = new OpenLayers.Layer.GML("Jerba_sites", "sites.gml");
>          map.addLayer(jerbaSites);
>  map.addControl( new OpenLayers.Control.LayerSwitcher());
>             map.addControl( new OpenLayers.Control.MousePosition());
>             map.addControl( new OpenLayers.Control.OverviewMap());
>             map.addControl( new OpenLayers.Control.ScaleLine());
>             map.addControl(new OpenLayers.Control.Permalink());
>             map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
>
> Controls.
>
> Any suggestions?

You have no base layer set in your map. Try setting isBaseLayer:true
in your GML layer options. Or if you use trunk or 2.8 RC you can set
allOverlays:true in the map options instead.

Cheers,

>

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list