GWT OpenLayers Drag a Marker to outside of the map

250 views
Skip to first unread message

JSNI NOOB

unread,
Feb 11, 2013, 11:27:52 AM2/11/13
to google-we...@googlegroups.com
I was using this the GWT-openlayers in a project.
And i need to drag a marker (for instance an image of a restaurant to an personal GWT widget that receives droppable images).
Is it possible?

My workaround is a little ugly, because i detected the mouse over in the marker and then i created a GWT popup and only then i make the drag.
What i want is to detect an click and drag in the marker and start a GWT drag action.

Thanks for the help.

code workaround

mark = new Marker(lonlat, new Icon(url,new Size(iconWidth, iconHeight)));

mark .getEvents().register("mouseover", cam, new org.gwtopenmaps.openlayers.client.event.EventHandler() {

fp = new image(url);
fp.getElement().setDraggable(Element.DRAGGABLE_TRUE);
pp = new PopupPanel();
pp.add(fp);

                fp.addDragStartHandler(new DragStartHandler(){ 
                    //addDomHandler(new DragStartHandler() {

                    @Override
                    public void onDragStart(DragStartEvent event) {
//do dragable action
}
}

Reply all
Reply to author
Forward
0 new messages