sg

Çarşamba, Aralık 14, 2005

Re: making overlays topmost in z order.


Wasn't it (nospam)dave@dbws.net(nospam) who wrote:
>
>So they're moving the whole outer div itself, not the children
>individually..
>
>That screws everything up then if we want to attach our elements as
>children..
>
>I suppose an option is to remove and re-add our child whenever there is
>a zoom or pan...

Good idea.

You don't need to remove it and re-add it, you just need to change its
.style.left and .style.top values. They have to be calculated relative
to the position of the moving map.div, and the information on that is
held in map.dragObject. (You could look in map.div.style.left, but then
you'd have to remove the "px" and convert it from string to integer.)

Here it is working. I've placed my object in the map.mapPane (where the
map tiles are) and given it zindex 2, so that it's sure to be above the
tiles. The map.mapPane layer is underneath the map.shadowPane, so the
marker shadows are also on top of my object.

http://www.econym.demon.co.uk/googlemaps/opp/control4.htm

The fact that it's under the map.mapTargetPane means that clicks on my
object are counted as map clicks. If you want to capture clicks on your
object you'd have to put it above the map.mapTargetPlane, but that would
also put it above the marker shadows.

I've relied on the fact that a "zoom" event also throws a "move" event,
and not bothered to add a separate "zoom" listener.

Note that all this is *seriously* dependent on undocumented internal
features of the API. It will all fall apart when Google make any changes
in this area.

--
The Blackpool Community Church API Tutorial
http://www.econym.demon.co.uk/googlemaps/

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık