Hi Jugang-
Here's a response from the engineering team:

"It will probably be very difficult to implement dragging for our own
overlays.
However, if he wants to implement custom dragging for his own overlay, it
should be fairly straightforward.

He needs to have two objects in his implementation - the object he wants to
drag (child) and its manager/parent.

The manager/parent should be a custom overlay derived from OverlayBase
class.
The manager/parent should be added to one of the panes of the map and the
child (object he wants to drag) should be added to the manager/parent.
The manager/parent should always be positioned at the top left corner of the
pane, i.e. at (0, 0) and should not move with the map.
Everytime IOverlay.positionOverlay method is called on the manager object,
the manager object should calculate the coordinate of the child using
IPane.fromLatLngToPaneCoords method and position the child at the
appropriate coordinate within the parent/manager object (as opposed to
repositioning the manager/parent object within the pane).

That way he can move his own custom objects around in the way he finds most
appropriate.
He needs to make sure that his child object should be derived from
UIComponent if he is using Flex or from Sprite if he is using pure Flash.

FYI, Wrapper objects are the sort of beasts that should not be played with
or things will start falling apart."

Hope that helps.

- pamela

On Tue, Jul 28, 2009 at 10:05 AM, Juguang XIAO <[email protected]> wrote:

> Me again.
>
> For this issue, I thought it over last night. I found the solution for my
> drag-and-drop issue. (As I always helped others to find workaround on Maps
> API, I found myself too). While wrapper is still my question, I have another
> one.
>
> I thought I understood some of design issues on Maps API for Flash,
> especially on Pane. I took it as assumption that:
>
> - logically, Map is a container of pane. Pane is a container of overlays
> and controls, which I call it component here. You can add marker into map
> directly in your code, but what really goes is marker is added to a
> specified pane.
>
> - physically, in the term of display list in AS3, these two containment
> relationships are same as logical. However, what we can find in API is that
> there are at least 3 classes extending flash.display.Sprite: Map,
> OverlayBase, and ControlBase. (there may be more, but I did not find them
> yet maybe). The concept of Pane does not exist in API, even there must be
> one and it is hidden (for good reasons) from the developers. I was totally
> fine with that, until now.
>
> If I want to operate fully on 2 overlays in the same pane, the only common
> ancestor of them, as we can find in API, is Map. It should be a closer one,
> which is the physical pane DisplayObject that overlays sit on. I want to
> interact with this pane, rather than Map. Working with global or
> bigger-than-necessary-scope objects smells very bad to me in design.
>
> What do you think?
>
> Juguang
>
>
> On Mon, Jul 27, 2009 at 6:19 PM, Juguang XIAO <[email protected]> wrote:
>
>> Hello, Google guys.
>>
>> IWrapper and its relatives are myth to me. I did not touch this concept,
>> until recently I have to. In asdocs, it says "IWrappable is the base
>> interface for all objects that provide AS3 cross-domain scripting
>> functionality. " This does not explain to me why overlays' parent is of
>> com.google.maps.wrappers.WrappableComponent, which its parent is in turn
>> another something of the same type. It seems endlessly deep, so I stopped
>> hacking in debug mode. My initial intention is to find the common parent of
>> two overlays in the same pane, as I am trying to implement overlay dragging
>> without using startDrag (which causes choppy drag) but mouse-following (If
>> you do not get what i mean, please read drag-and-drop section in Adobe
>> official doc. Anyway this is not my this email's point).
>>
>> Even I do not have problem now with drag-and-drop issue, which is not
>> directly related to Maps API, I would like to ask this Wrapper story later.
>> Can someone enlighten me?
>>
>> Thanks.
>>
>> Juguang
>>
>> --
>> =============
>> Juguang XIAO
>> Beijing, China
>>
>>
>
>
> --
> =============
> Juguang XIAO
> Beijing, China
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-maps-api-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to