mapView.currentLevel = 4;
set the currentLevel property on the AGSMapView object to 4.mapView.currentLevel = 4;
[mapView.gps start]; mapView.gps.autoPan = YES; mapView.gps.zoomLevel = 6;
AGSEnvelope *myEnvelope = [[AGSEnvelope alloc] initWithXmin:2232848.00 ymin:2232843.00 xmax:233167.00 ymax:251425.00 spatialReference:mapView.spatialReference]; [mapView zoomToEnvelope:myEnvelope animated:YES]; [myEnvelope release];
[mapView setZoomScale:4.0]; [mapView setZoomScale:4.0 animated:YES];
int levelToZoomTo = 4; AGSLOD* lod = [tiledLayer.mapServiceInfo.tileInfo.lods objectAtIndex:levelToZoomTo]; float zoomFactor = lod.resolution/self.mapView.resolution; AGSMutableEnvelope *newEnv = [AGSMutableEnvelope envelopeWithXmin:self.mapView.envelope.xmin ymin:self.mapView.envelope.ymin xmax:self.mapView.envelope.xmax ymax:self.mapView.envelope.ymax spatialReference:self.mapView.spatialReference]; [newEnv expandByFactor:zoomFactor]; [self.mapView zoomToEnvelope:newEnv animated:YES];
AGSEnvelope *envelopeGPS = [AGSEnvelope envelopeWithXmin:mapView.gps.currentPoint.x ymin:mapView.gps.currentPoint.y xmax:mapView.gps.currentPoint.x max:mapView.gps.currentPoint.x spatialReference:self.mapView.spatialReference]; [mapView zoomToEnvelope:envelopeGPS animated:YES];
This is what i use , without forming an envelope[self.mapView centerAtPoint: ((AGSPoint *)(graphic.geometry)) animated:YES]; NSArray * lodsArray = self.worldTopoMapService.tileInfo.lods ;//topomap service is AGSTiledMapServicelayer AGSLOD * finalLOD = [lodsArray objectAtIndex:5] ;// 5 is the tile level to zoom to while (self.mapView.mapScale >= finalLOD.scale) { [self.mapView zoomIn:YES] ; } [self.mapView showCalloutAtPoint: (AGSPoint *) graphic.geometry forGraphic:graphic] ;
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.