Skip to content

MapView.setCurrentZoom(float zoom) working on Debug Mode but not on Run Mode #11

Description

@MrAlaboheme

Hi,

I copied the code used for the routeLayerActivity but my map is too big for the screen so it is too tiny. I decided to set a zoom in the OnCreate of the activity.

PointF target = null;
if(item.getItemMark() != null){
     target = new PointF(item.getItemMark().x, item.getItemMark().y);
     routeList = MapUtils.getShortestDistanceBetweenTwoPoints(marks.get(0), target, nodes, nodesContract);
     routeLayer.setNodeList(nodes);
     routeLayer.setRouteList(routeList);
     mapView.refresh();
}

mapView.setCurrentZoom(mapView.getCurrentZoom() * 4, 0, 300);
mapView.refresh();

On debug mode if I suspend the thread from my var target, the zoom method will be apply to the map but if I don't suspend the thread or I launch the activity with the run session zoom won't be apply.

Any idea ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions