POST
|
I took out some of my code in the StartCollection Sub from above, but here I am querying and assigning variables: Private Sub StartCollection(ByVal featureType As FeatureType, ByVal itemArray As Object()) Me.CancelDataCollection() Me._featureType = featureType Me._feature = New Feature(Me._featureType, itemArray) Me._feature.BeginEdit() Dim fieldname As String = Me._featureType.Name.ToUpper If fieldname.Contains(faLayerName) Then Dim fdr As FeatureDataRow = _feature.FeatureDataRow 'populate all profile fields not the current survey to the new ground For Each dc As DataColumn In fdr.FeatureSource.Columns ' find the userid field, and populate current userID to this field If dc.ColumnName.ToUpper().IndexOf("MISSION") <> -1 Then fdr(dc.ColumnName) = _currentMission ElseIf dc.ColumnName.ToUpper().IndexOf("ACTIVITY") <> -1 Then fdr(dc.ColumnName) = "SURVEY" End If Next pageTitle = "Collect " & Me._featureType.Name Else Dim fdr As FeatureDataRow = _feature.FeatureDataRow For Each dc As DataColumn In fdr.FeatureSource.Columns ' find the SEQ_NR field, and populate current SEQ_NR to this field If dc.ColumnName.ToUpper().IndexOf("SITE_ID") <> -1 Then fdr(dc.ColumnName) = Me.SelectedSiteID End If Next pageTitle = "Collect " & Me._featureType.Name & " for Survey at " & Me.SelectedSiteID End If MobileApplication.Current.Transition(Me.EditFeatureAttributesPage) End Sub
... View more
03-15-2013
07:51 AM
|
0
|
0
|
248
|
POST
|
All projectextensions you get into within the OnOwnerInitialized Sub. Declare an EditFeatureAttributesPage property. On starting data collection make sure to assign your global feature. Public ReadOnly Property EditFeatureAttributesPage As EditFeatureAttributesPage Get Me._editAttributesPage = New EditFeatureAttributesPage(New EditFeatureAttributesViewModel(Me._feature)) Me._editAttributesPage.Title = pageTitle Me._editAttributesPage.Note = _collectFeaturesTask.Description Me._editAttributesPage.ImageSource = _collectFeaturesTask.ImageSource AddHandler Me._editAttributesPage.ClickOk, AddressOf _editFeatureAttributesPage_ClickOk AddHandler Me._editAttributesPage.ClickCancel, AddressOf _editFeatureAttributesPage_ClickCancel Return Me._editAttributesPage End Get End Property Private Sub StartCollection(ByVal featureType As FeatureType, ByVal itemArray As Object()) Me.CancelDataCollection() Me._featureType = featureType Me._feature = New Feature(Me._featureType, itemArray) Me._feature.BeginEdit() MobileApplication.Current.Transition(Me.EditFeatureAttributesPage) End Sub
... View more
03-13-2013
08:43 AM
|
0
|
0
|
248
|
POST
|
I have been working on this myself. I think my initial question, which I think I figured out, was a hook into the GeometryEditMethod. The EditFeatureAttributesViewModel requires a feature to be passed to it so you can't add this eventhandler within the OnOwnerInitialized Sub as there is no selected feature at this time. The CollectFeaturesTask seems very straight forward with the collectionstarted and collectionfinished which you can add no problem within the OnOwnerInitialized Sub. What I ended up doing was add an eventhandler to the manageeditstask.viewcollectedfeaturespage.EditFeatureClick event within the OnOwnerInitialized sub. Within the editfeatureclick eventhandler I added the eventhandler for creatinggeometryeditoperations. I can loop through and gett the current editoperations but when I loop through or try to add geometry collection methods none exist at this point and it won't add any either. Any input would be appreciated. Here is a code sample: Protected Overrides Sub OnOwnerInitialized() If Not MobileApplication.Current.Dispatcher.CheckAccess() Then MobileApplication.Current.Dispatcher.BeginInvoke(DirectCast(Sub() OnOwnerInitialized(), System.Threading.ThreadStart)) Return End If ' Find the Collect Features task _collectFeaturesTask = TryCast(MobileApplication.Current.Project.Tasks.GetFirstExtensionOfType(GetType(CollectFeaturesTask)), CollectFeaturesTask) If _collectFeaturesTask Is Nothing Then Return End If �?? If _collectFeaturesTask IsNot Nothing Then AddHandler _collectFeaturesTask.CollectionStarted, AddressOf _collectFeaturesTask_CollectionStarted AddHandler _collectFeaturesTask.CollectionCompleted, AddressOf _collectFeaturesTask_CollectionCompleted End If �?? �?? _manageEditsTask = TryCast(MobileApplication.Current.Project.Tasks.GetFirstExtensionOfType(GetType(ManageEditsTask)), ManageEditsTask) _ViewCollectedFeaturesPage = _manageEditsTask.ViewCollectedFeaturesPage If _manageEditsTask IsNot Nothing Then MessageBox.Show("Not nothing") AddHandler _manageEditsTask.ViewCollectedFeaturesPage.EditFeatureClick, AddressOf _manageEditsTask_ViewCollectedFeaturesPage_EditFeatureClick End If �?? �?? Dim viewMapTask As ViewMapTask = TryCast(MobileApplication.Current.FindTask(GetType(ViewMapTask)), ViewMapTask) If viewMapTask IsNot Nothing Then _homePage = viewMapTask.ViewMapPage End If End Sub Private Sub _manageEditsTask_ViewCollectedFeaturesPage_EditFeatureClick(sender As Object, e As FeatureEventArgs) �?? _editFeatureAttributesViewModel = New EditFeatureAttributesViewModel(e.Feature) _feature.BeginEdit() AddHandler _editFeatureAttributesViewModel.CreatingGeometryEditOperations, AddressOf _editFeatureAttributesViewModel_CreatingGeometryEditOperations _editFeatureAttributesPage = New EditFeatureAttributesPage(_editFeatureAttributesViewModel) AddHandler _editFeatureAttributesPage.ClickOk, AddressOf _editFeatureAttributesPage_ClickOk AddHandler _editFeatureAttributesPage.ClickCancel, AddressOf _editFeatureAttributesPage_ClickCancel _feature = _editFeatureAttributesViewModel.Feature Dim menuitem As MenuItem = New MenuItem menuitem.Header = "Add MGRS Location" menuitem.Command = AddLocationCommand2 _editFeatureAttributesPage.MenuItems.Add(menuitem) MobileApplication.Current.Transition(_editFeatureAttributesPage) End Sub Private Sub _editFeatureAttributesViewModel_CreatingGeometryEditOperations(sender As Object, e As CreatingGeometryEditOperationsEventArgs) _coordGeometryCollectionMethod = New MGRSGeometryCollectionMethod For Each method As GeometryEditMethod In e.GeometryEditMethods MessageBox.Show("edit method name is " & method.Name.ToString) MessageBox.Show(" method.GeometryCollectionMethods.Count " & method.GeometryCollectionMethods.Count.ToString) For Each gcm As GeometryCollectionMethod In method.GeometryCollectionMethods MessageBox.Show("geometry collection method name is " & method.Name.ToString) Next method.GeometryCollectionMethods.Add(_coordGeometryCollectionMethod) Next �?? End Sub
... View more
02-12-2013
06:26 AM
|
0
|
0
|
143
|
POST
|
I would like the ESRI Mobile Team to look at the fact that you can not create custom GeometryEditMethods or tie into edit method geomtry collection methods.
... View more
02-07-2013
01:20 PM
|
0
|
2
|
437
|
POST
|
Does the WPF API support projection to MGRS? I was told support would be coming in the next release of the WPF API. However, you can get MGRS support now by referencing the MGRS locator package and geocoding and reverse geocoding to get your MGRS conversion.
... View more
11-07-2012
04:30 AM
|
0
|
0
|
240
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|