Reputation: 138
Codename One, Adding a DragFinishedListener
to the MapContainer
class does not receive any events. Adding MapListener
works as expected.
mapContainer.addDragFinishedListener(new ActionListener<ActionEvent>() {
@Override
public void actionPerformed(ActionEvent evt) {
System.out.println("Don't see this");
}
});
mapContainer.addMapListener(new MapListener() {
@Override
public void mapPositionUpdated(Component source, int zoom, Coord center) {
System.out.println("I see this");
}
});
Upvotes: 2
Views: 48
Reputation: 52770
That's a listener for drag and drop not for pan. If you drag a component e.g. a label onto a map that might be fired but it won't be fired for standard panning.
The best way is the map listener but you can also use pointer drag events and pointer release events.
Upvotes: 1