On Sep 15, 2010, at 5:53 PM, ext P Kishor wrote:

> When I ask OL to fetch WMS layers, they get stuffed into automatically
> generated divs with ids like "OpenLayers.Layer.WMS_283" and
> "OpenLayers.Layer.WMS_285" and so on. The numbers at the end seem to
> be increasing by 2, but what number they start with doesn't seem to be
> predictable. Layers drawn before these specific layers have 35, 37,
> 39, 41 tacked on the end.

It is actually somewhat predictible -- IDs are monotonically increasing,
so each time we call getUniqueId(), we get one number more. Layers actually
create multiple elements, which is why the increase of 2.

> 
> The aforementioned div, one per layer, has another div with no id or
> name, and within that div is the actual img with an id like
> "OpenLayersDiv293" (the image 293 is inside div 283). Here is the
> strange thing... there are actually two images within that numbered
> div. It actually looks like so (easier to show the code than to
> describe it)

I guess your'e creating a single tile WMS with a transitioneffect?
one of these images is presumably disabled... I dunno, this particular
setup seems either incomplete or odd.

> <div id="OpenLayers.Layer.WMS_283">
>    <div><img id="OpenLayersDiv293" src="..?layers=one"></div>
>    <div><img id="OpenLayersDiv347" src="..?layers=one"></div>
> </div>
> 
> <div id="OpenLayers.Layer.WMS_285">
>    <div><img id="OpenLayersDiv303" src="..?layers=two"></div>
>    <div><img id="OpenLayersDiv345" src="..?layers=two"></div>
> </div>
> 
> and so on.
> 
> Questions:
> 
> - Can I get these div ids programmatically?
> - Even better, can I specify what these div ids should be?

No, and the fact that you want to makes me think that you actually want 
something
else :)

> - Can I get the image ids programmatically, or, even better, specify
> my own (of course, ensuring they are unique)?

Possibly, and no, but the fact that you want to makes me think that you actually
want something else.

> - Can I draw them in a single div like so (this is reaaaaly far-fetched)?

No. Visibility of layers is controlled by changing the visibility of the
parent layer, so this would mean that you would turn off visibility of
both layers. But you can set layers: 'one,two' in the code to request
them together.

> <div id="OpenLayers.Layer.WMS_283">
>    <div><img id="OpenLayersDiv293" src="..?layers=one"></div>
>    <div><img id="OpenLayersDiv303" src="..?layers=two"></div>
>    ..
> </div>
> 
> Objective -- I am trying to overlay a bunch of georeferenced images on
> a map div, within a known div.

I don't understand what you mean by this statement. More information might
help.

> 
> -- 
> Puneet Kishor
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to