<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Eric,<br>
Thank you for this tip for a fake backgroundlayer<br>
<br>
<pre wrap="">var fake = new OpenLayers.Layer('fake', {displayInLayerSwitcher: false});
map.addLayer(fake);
</pre>
<br>
I added {isBaseLayer:true}<br>
<pre wrap="">var fake = new OpenLayers.Layer('fake', {isBaseLayer: true});
</pre>
<br>
Now (in the layerswitcher or otherwise) the backgroundlayer can be
selected as a backgroundlayer (if all real backgroundlayers must be out)<br>
<br>
Cheers, Huub<br>
<br>
<br>
On 6/25/2008 4:27 PM, Eric Lemoine wrote:
<blockquote
cite="mid:5ec103de0806250727n5315fb89m5cd8907d9d9ffc9@mail.gmail.com"
type="cite">
<pre wrap="">On Wed, Jun 25, 2008 at 2:36 PM, Christian Braun
<a class="moz-txt-link-rfc2396E" href="mailto:christian.braun@tudor.lu"><christian.braun@tudor.lu></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi List,
</pre>
</blockquote>
<pre wrap=""><!---->
Hello,
</pre>
<blockquote type="cite">
<pre wrap="">I am just starting with OpenLayers and I am a looser ;-) in Javascript,
so please be patient.
I want to overlay different png images in a rudimentary map. Therefore I
created the following code embedded in my standard html:
var map;
function init(){
map = new OpenLayers.Map ("map", {
controls:[
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.ScaleLine(),
],
numZoomLevels: 5,
maxExtent: new OpenLayers.Bounds(57500, 57500, 106600,
101800),
maxResolution: 'auto',
units: 'm',
projection: new OpenLayers.Projection("EPSG:2169")
} );
layer1 =
newOpenLayers.Layer.Image('LAN1','/lan_output/schedule_baseline_normal_weather/schedule_baseline_normal_weather_L_den.png',
new OpenLayers.Bounds(57500, 57500,
106600, 101800),
new OpenLayers.Projection("EPSG:2169"),
new OpenLayers.Size(491,443)
);
layer2 = new OpenLayers.Layer.Image(
'LAN2','/lan_output/schedule_baseline_normal_weather/schedule_baseline_normal_weather_L_day.png',
new OpenLayers.Bounds(57500, 57500,
106600, 101800),
new OpenLayers.Projection("EPSG:2169"),
</pre>
</blockquote>
<pre wrap=""><!---->
The third argument should be the size. Furthermore you don't need to
pass a projection object to the layer as it's already set in the map
options.
</pre>
<blockquote type="cite">
<pre wrap=""> new OpenLayers.Size(491,443)
);
map.addLayers([layer1, layer2]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
I want to show the images as overlays rather than with an "or" checkbox.
</pre>
</blockquote>
<pre wrap=""><!---->
So you don't want your image layers to be "baselayers", you want them
to be "overlays". To make them overlays you need to set the
isBaseLayer option to false:
layer2 = new OpenLayers.Layer.Image(
'LAN2',
'/lan_output/schedule_baseline_normal_weather/schedule_baseline_normal_weather_L_day.png',
new OpenLayers.Bounds(57500, 57500, 106600, 101800),
new OpenLayers.Size(491,443), {
isBaseLayer: false
}
);
That being said, it is to be noted that OpenLayers works with at least
one base layer. If you don't want really need one you can create a
fake one using:
var fake = new OpenLayers.Layer('fake', {displayInLayerSwitcher: false});
map.addLayer(fake);
</pre>
<blockquote type="cite">
<pre wrap="">Furthermore a need a flag to set transparency of some png's.
</pre>
</blockquote>
<pre wrap=""><!---->
It seems to me that either your png images are transparent or they
aren't. OpenLayers can't help you with that.
Hope this helps,
--
Eric
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@openlayers.org">Users@openlayers.org</a>
<a class="moz-txt-link-freetext" href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
=====================================
Geodan IT b.v.
Buitenhaven 27-A
5211 TP 's-Hertogenbosch (NL)
-------------------------------------
Tel: +31 (0)73 - 692 5151
Fax: +31 (0)73 - 692 5150
Mobiel:
-------------------------------------
Postadres / mailing address
President Kennedylaan 1
1079 MB Amsterdam (NL)
-------------------------------------
E-mail: <a class="moz-txt-link-abbreviated" href="mailto:huub.fleuren@geodan.nl">huub.fleuren@geodan.nl</a>
Website: <a class="moz-txt-link-abbreviated" href="http://www.geodan.nl">www.geodan.nl</a>
Disclaimer: <a class="moz-txt-link-abbreviated" href="http://www.geodan.nl/disclaimer">www.geodan.nl/disclaimer</a>
-------------------------------------
</pre>
</body>
</html>