Select to view content in your preferred language

Append a feature ID into a Popup

3584
1
04-26-2016 02:01 AM
ozcandurak
Deactivated User

In my application i need to connect all the Feature with the road to relate which feature belongs which road. There for in all feature i have a field called "YOLORTAHATTIID" and I m trying to fill this field with the road ID.

Here is the Scheme:

1. Click on any Feature on the map 

2. When popup comes, at the scene where YOLORTAHATTID is null and at this point we have no ID attached to YOLORTAHATTID

1. Select the road Icon. When we press on this button, we go back to map view and we select road feature
2. Then we get the ID attribute of the field, and return back to the popup with the "Road ID" filled into "YOLORTAHATTID"

3. and able to save it !

Here is my demonstration :

Roadmap copy.png

Thanks for the help to  : Gagandeep Singh

I have created a function to dismiss the popup when clicked on maps icon, and rest is mystery for now

func getTheID(){

        self.popupsVC.dismissViewControllerAnimated(true, completion: nil)

        self.popupsVC.startEditingCurrentPopup()

        self.toggleGeometryEditUI()

       

        if tappedFeatures.count > 0 {

            print(tappedFeatures)

        }

    }

Here is the sample application : GitHub - ozcan-durak/testApp

Regards.

0 Kudos
1 Reply
GagandeepSingh
Frequent Contributor

You don't really have to use the editing in popup for this. Simply use the setAttributeWithInteger:forKey:​ on the feature, to set the YOLORTAHATTID attribute for that feature. And the next time when you open the popups, the value should be updated.

0 Kudos