I'm making a Map Visualization which requires an overlay that shows the light/dark patterns across the planet (like this). I accomplished this by building a simple image layer that loads an image with a cosine wave shaded black on the top half (I'm not worried about seasonal adjustments yet). I can set the extent on the according to the current time to get a map that shows the light patterns in real time. However, I can't figure out how to move the Image Layer without moving the base Layer to show the light/dark overlay in the past or future.
My first inclination was to use some sort of move() method, but I couldn't find it in the API. So I tried to adjust the Layer's extent on each change like this:
sunLayer({extent : new OpenLayers.Bounds(newLong, -90, newLong+360, 90)});
sunLayer.redraw();
But nothing happens. I was thinking that maybe I need to build a Vector Layer with just one Feature (the image), and then tie the dimensions of the graphic to the dimensions of the map and move the feature around, but this approach feels wrong to me.
Has anyone else done something like this (where you entirely decouple an Image Layer from the base layer)?