Is there a way to restrict geometry editing and only allow attribute edits?

613
8
09-26-2011 10:38 AM
MattMiley
Occasional Contributor
Is there a way to restrict geometry editing and only allow attribute edits? I know you can limit what fields are editable, but is there a way you can restrict geometry editing? So the users can only query and update attribute fields?

Thanks
0 Kudos
8 Replies
NimeshJarecha
Esri Regular Contributor
Are you using popups? if yes, you can set AGSPopupInfo::allowEditGeometry to FALSE. Here is the editing sample with popups.

Regards,
Nimesh
0 Kudos
MattMiley
Occasional Contributor
I'm not a dev, can I disable geometry edits within the json text file?
0 Kudos
NimeshJarecha
Esri Regular Contributor
NO..

Regards,
Nimesh
0 Kudos
DarrenMackiewicz
Occasional Contributor
It seems that this has been changed and that allowEditGeometry on the popup has been depricated.
How can I disable editing on the popup in the 2.3 API?
0 Kudos
NimeshJarecha
Esri Regular Contributor
AGSPopup's allowEditGeometry is NOT deprecated.

Regards,
Nimesh
0 Kudos
DarrenMackiewicz
Occasional Contributor
But, we're using AGSPopupsContainerViewController, as is the sample you referenced.

Again - to outline the goal here -
When the graphic button is clicked, and the attributes are put into the new popup window, next to the attachment icon is the edit geometry icon. We (I) want to "disable" or "hide" the editgeometry icon.



-(void)mapView:(AGSMapView *)mapView didClickCalloutAccessoryButtonForGraphic:(AGSGraphic *)graphic{
   
    self.activeFeatureLayer = (AGSFeatureLayer*) graphic.layer;
    //Show popup for the graphic because the user tapped on the callout accessory button
    self.popupVC = [[[AGSPopupsContainerViewController alloc] initWithWebMap:self.webmap forFeature:graphic usingNavigationControllerStack:NO] autorelease];
    self.popupVC.delegate = self;
    self.popupVC.modalTransitionStyle =  UIModalTransitionStyleFlipHorizontal;
    //If iPad, use a modal presentation style
    if([[UIDevice currentDevice] isIPad])
        self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet;
    [self presentModalViewController:self.popupVC animated:YES];

}
0 Kudos
NimeshJarecha
Esri Regular Contributor
You should change your code if you want to control that....

-(void)mapViewAGSMapView *)mapView didClickCalloutAccessoryButtonForGraphicAGSGraphic *)graphic{

self.activeFeatureLayer = (AGSFeatureLayer*) graphic.layer;
//Show popup for the graphic because the user tapped on the callout accessory button

AGSPopupInfo *popupInfo = [self.webMap popupInfoForFeatureLayer:self.activeFeatureLayer];
AGSPopup *popup = [AGSPopup popupWithGraphic:graphic popupInfo:popupInfo];
popup.allowEditGeometry = FALSE;
self.popupVC = [[AGSPopupsContainerViewController alloc]initWithPopups:@[popup]];

//self.popupVC = [[[AGSPopupsContainerViewController alloc] initWithWebMap:self.webmap forFeature:graphic usingNavigationControllerStack:NO] autorelease];

self.popupVC.delegate = self;
self.popupVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
//If iPad, use a modal presentation style
if([[UIDevice currentDevice] isIPad])
self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:self.popupVC animated:YES];

}
0 Kudos
DarrenMackiewicz
Occasional Contributor
Got it, with a couple small tweaks. Thanks!
0 Kudos