On Thu, Sep 16, 2010 at 3:05 PM, P Kishor <[email protected]> wrote:
> On Thu, Sep 16, 2010 at 12:38 PM,  <[email protected]> wrote:
>>
>> On Sep 16, 2010, at 2:04 AM, ext P Kishor wrote:
>>
>>> On Thu, Sep 16, 2010 at 12:36 AM,  <[email protected]> wrote:
>>>>
>>>> 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.
>>>
>>> Right, the increment is predictable, but the starting id is... what?
>>> Why didn't the ids just start at 0 or 1 and then move on forward,
>>> regenerating on every call (assuming statelessness and all that).
>>
>> WMS layers aren't the only things that use IDs. Pretty much every
>> element in an OpenLayers map uses one, as well as many things that
>> aren't elements. The reason I say they're predicible is that they're
>> based (almost) entirely on things that are done linearly, based on
>> the order of your code.
>>
>> Of course, if you change the order you add your layers in, all of a
>> sudden everything breaks :) So it's not designed to be usable externally.
>>
>>>>
>>>>>
>>>>> 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.
>>>
>>> No, no transition effect or any effect. These are the plain vanilla of 
>>> layers.
>>>
>>>            new OpenLayers.Layer.WMS(
>>>                "name,
>>>                wms_server,
>>>                {
>>>                    layers: name,
>>>                    format: "image/gif",
>>>                    transparent: true,
>>>                    isBaseLayer: false,
>>>                    reproject: true
>>>                },
>>>                {
>>>                    visibility: true,
>>>                    singleTile: true,
>>>                    sphericalMercator: true
>>>                }
>>>            );
>>
>> Weird. I see the same behavior. I can't explain it off the top of
>> my head.
>>
>>>>> <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.
>>>
>>> I am trying to set up a georeferenced animation. I have several options --
>>>
>>> 1. get MapServer to create the images for me, and composite them into
>>> one. But, I am not sure how or if I could create an animation out of
>>> them;
>>>
>>> 2. create the anim myself.
>>>
>>> So, #2.
>>>
>>> a. I create my images,
>>> b. georeference them by copying geo headers into them via geotifcp
>>> c. display them on the map
>>> d. animate them
>>>
>>> [a-c] above are easy. To do 'd,' I put them inside a div, and then
>>> create a "carousel" kinda application using jQuery. To make things
>>> even better, I have a jQuery slider that can control which image is
>>> being shown. This way, the user can "scrub" back and forth, looking at
>>> different frames of the anim, a lot better than creating a anim gif
>>> that can't be controlled.
>>
>> To me, the way I would handle this is just a set of Layer.Images or
>> Layer.WMSes? I mean, a singleTile layer isn't that heavy (though I guess
>> it is 50% heavier than i thought it was ;)) -- it's just 3 elements.
>> Adding a bunch of them, and then having your Javascript loop through
>> and turn them on and off, shouldn't be that expensive, and fits much
>> more in line with OpenLayers than anything else I can understand about
>> what your'e asking so far.
>>
>> Does that start to head in the right direction?
>
>
> Yes, it does, but I need to know the following then --
>
> 1. What is the way to turn a layer on or off programmatically?
>

Figured it out.

> 2. Can I do that with an external event? In my case, as I mentioned, I
> have a jQuery based slider. Every move of the slider (stepped
> increments) fires an event with a number for the position of the
> slider. I want to use that to turn on a layer while turning all other
> layers off. That way the user can move the slider back and forth and
> control the toggling of the layers.


Figured it out.

It actually works quite well. Soon as I figure out how to generate
layers dynamically with MS CGI, and test it out with my data, I will
set it up for others to take a gander. It looks quite good actually,
if I may say so myself.

Many thanks for your help.


>
> Oh, and by the way, I don't have only 3 layers... I have 100 layers
> (yearly output from a model for 100, perhaps even 500, years). I am
> not too concerned, right now at least, about the expense of doing so.
> A video would be just as expensive. I tested with a non-OL based set
> up where I had a slider with 100 stacked images (not georeferenced)
> that were controlled in an animation, and actually it worked quite
> well. If using GIFs, each layer is about 40 K, so 100 of them is about
> 4 MB, not quite unlike most YouTube crap that people routinely see.
>
> Of course, I have to also figure out how to create 100 layers in
> MapServer (with CGI) on the fly, but that is a question for the
> MapServer list.
>
> Many thanks,
>
>>
>> -- Chris
>>
>>
>
>
>
> --
> Puneet Kishor http://www.punkish.org
> Carbon Model http://carbonmodel.org
> Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
> Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
> Nelson Institute, UW-Madison http://www.nelson.wisc.edu
> -----------------------------------------------------------------------
> Assertions are politics; backing up assertions with evidence is science
> =======================================================================
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to