-(void)zoomToGeometry:(AGSGeometry*)geometry withPadding:(CGFloat)padding animated:(BOOL)animated; doesn't zoom to geometry when the map is rotated , it works fine when the map rotation angle is 0.
Hi Roshna Dsouza,
I just tried it and it works for me. Can you share your code or explain what you are trying to do?
Gagan
I have to check if the geometry is zoomed to a particular resolution It should be visible to the user/
This code below works perfectly fine when maps rotating angle is 0. but when rotating angle is other than 0 ,
[self.mapView zoomToGeometry:[self.editLayerManager geometry] withPadding:[defaultScale floatValue] animated:YES];
doesn't zoom to exact geometry with padding.
AGSMutableEnvelope *visibleAreaEnvelope = [self.mapView.visibleArea.envelope mutableCopy];
float zoomFactor = [levelScale doubleValue]/self.mapView.resolution;
[visibleAreaEnvelope centerAtPoint:[self.editLayerManager zoomToGeometryCenter]];
[visibleAreaEnvelope expandByFactor:zoomFactor];
if (![visibleAreaEnvelope containsEnvelope:[self.editLayerManager geometryEnvelope]]) {
}
} else {
[self.mapView zoomToResolution:[levelScale doubleValue] withCenterPoint:[self.editLayerManager zoomToGeometryCenter] animated:YES];
Can you provide a demo project as a way to reproduce the issue? It will help us in debugging the problem, if there is one.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.