In the "old" SDK for iOS and probably also for Android you're able to set a max envelop on the map view to define a panning area for the map.
How do I do that in the 100 SDK for Android? Can't find any method like that in the MapView class.
Well answered my own question above regarding getting current extent of a map view in 100.4. Kind of convoluted and not well documented. Hope this helps others...
Viewpoint vp = mMapView.getCurrentViewpoint(Viewpoint.Type.BOUNDING_GEOMETRY); Geometry extent = vp.getTargetGeometry();
Any news on enhancement: ENH-000104889.
Do you have any timeline when it will be released?
I too am hoping this makes it into the runtime. In the meantime this hack as per Alex's suggestion is working pretty well...
mMapView.addViewpointChangedListener(viewpointChangedEvent -> { try { Viewpoint vp = mMapView.getCurrentViewpoint(Viewpoint.Type.BOUNDING_GEOMETRY); Geometry curExtent = vp.getTargetGeometry(); if(curExtent!=null) { LinearUnit miles = new LinearUnit(LinearUnitId.MILES); Geometry expandedMapExtent = GeometryEngine.bufferGeodetic(curExtent, 0.5, miles, Double.NaN, GeodeticCurveType.GEODESIC); boolean intersectsGDB = GeometryEngine.intersects(expandedMapExtent, s1Map.getBasemap().getBaseLayers().get(0).getFullExtent()); if (!intersectsGDB) { mMapView.setViewpointCenterAsync(s1Map.getBasemap().getBaseLayers().get(0).getFullExtent().getCenter()); mMapView.setViewpointGeometryAsync(s1Map.getBasemap().getBaseLayers().get(0).getFullExtent()); } } } catch (Exception e) { e.printStackTrace(); } });