maps icon indicating copy to clipboard operation
maps copied to clipboard

MapView does not update prefCenter and prefZoom

Open ctipper opened this issue 3 years ago • 4 comments

In the course of trying to integrate this as a library it has become apparent that MapView updates BaseMap coordinate and zoom via the variables prefCenterLat, prefCenterLon and prefZoom exactly once and that these variables are never updated again as the user zooms and pans the MapView. Consequently a library user has no way of persisting the state of the map and it is not really suitable to be used as a library. There are other issues in particular the private InputEvent handlers which can be worked around with EventFilters, but currently this is not suitable for my purposes.

ctipper avatar May 14 '22 19:05 ctipper

The MapView.getMapPosition appears to return lon and lat but this is not clear from variable names. I might have to withdraw this issue, but it is frustrating that there is no access to underlying BaseMap from MapView, this would allow access to the BaseMap readOnlyProperties.

ctipper avatar May 15 '22 14:05 ctipper

MapView.getZoom returns BaseMap.prefZoom so still no way to retrieve last zoom level from MapView.

ctipper avatar May 15 '22 16:05 ctipper

I've examined the options and it seems I only need in MapView

public double getMapZoom() {
    return baseMap.zoom().get();
}

I don't know the likelihood of getting a PR accepted I've never done a pull request before.

ctipper avatar Jun 20 '22 09:06 ctipper

For the same project I've also had need of this function in MapView

public void moveMap(double x, double y) {
        baseMap.moveX(x);
        baseMap.moveY(y);
    }

ctipper avatar Nov 05 '22 19:11 ctipper