[OpenLayers-Dev] Null basemap?

Tim Schaub tschaub at openplans.org
Mon Dec 10 16:43:50 EST 2007

Jeff Yutzler wrote:
> In the past we've always been told that you must have a basemap to use 
> OpenLayers.  "So many things are keyed off of the base map, it must be 
> there or things just won't work."  However, I find this to be an awkward 
> constraint, particularly if you have an OGC context that you are 
> loading.  OGC contexts have no knowledge of the concept of base map - 
> everything is just a layer and the "basemap" is naturally the bottom 
> layer of the context.  To get around this, I developed a dummy "Null" 
> basemap class that always returns blank.gif.  Is this an acceptable 
> solution to the problem?  If so, would this be a worthwhile ticket/patch 
> to provide?

I agree that it is an awkward constraint.  My issue is more with the 
coupling of map.baseLayer and the layer.isBaseLayer property.

Ideally, we'd have a map.displaySRS or something.  Without this property 
set however, it is nice to have the map draw projection related 
information from somewhere.  The map.baseLayer currently serves that 
purpose.  The weird part (in my mind) is also having a layer.isBaseLayer 
property.  What we really want to know is "can this layer be displayed 
in a different SRS?"  The layer.isBaseLayer property sort of means "no" 
in response to this question - but it is a bit too broad.

My workarounds have been about making layers[0] act as a base layer.  If 
you want a dummy layer to serve this purpose, there are a bunch of 
options without patching the trunk.  An image layer with displayInLayer 
false sounds like an easy one to me.

I do like the idea of working towards a more flexible handling of the 
base layer concept.


> !DSPAM:4033,475da7b1165291961014482!
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
> !DSPAM:4033,475da7b1165291961014482!

More information about the Dev mailing list