Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Unable to catch dropped files on the map #83

Open
trixon opened this issue Jun 15, 2020 · 3 comments
Open

Unable to catch dropped files on the map #83

trixon opened this issue Jun 15, 2020 · 3 comments

Comments

@trixon
Copy link

trixon commented Jun 15, 2020

Is it possible to handle dropped files on the MapView?
I'm trying the following without any luck.

        mMapView.setOnDragOver(dragEvent -> {
            Dragboard board = dragEvent.getDragboard();
            if (board.hasFiles()) {
                dragEvent.acceptTransferModes(TransferMode.COPY);
            }
        });

        mMapView.setOnDragDropped(dragEvent -> {
            System.out.println(dragEvent);
        });

@sothawo
Copy link
Owner

sothawo commented Jun 15, 2020

I think that the browser / OpenLayers catch the drag event on the map view so that JavaFX does not get it. I am able to get the dragEneterd and dragExited events, but not the dragOver.

I'm not sure if it would make sense to catch a drag event in the javascript layer and pass it out to the java object. We would need to convert it to to a DragEvent with the dragboard and actual coordinates. Might be doable.

@trixon
Copy link
Author

trixon commented Jun 15, 2020

@sothawo Thanks, good to know that I'm not doing anything wrong then.

I'm mostly focused on the Swing based WorldWind but I'm working on getting the other "map engines" up to par, but this is not a big deal right now.

Thanks for making OpenLayers manageable in desktop apps.

@sothawo
Copy link
Owner

sothawo commented Jun 17, 2020

I'll leave this issue open, would be a nice addition to add when I find the time

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants