ArcPad Custom Toolbar - Listing Editable Layers

2460
4
03-22-2012 03:44 PM
JoelCrawford
New Contributor
Hi,

I would like to create a toolbar with an "Add Feature" button that would follow a work flow like this:

1. Click Add Feature button that would be like an Add Point from GPS type button
2. This brings up a listing of all editable layers
3. Choose layer you are adding point to
4. This calls up the layers Edit Form for adding attributes


My understanding is that this would be an Applet with a script.

Does someone have the script for something like this? Or some code to start?

Thanks again!!

Joel.
Tags (3)
0 Kudos
4 Replies
GarethWalters
Occasional Contributor III
Hi Joel,

I would suggest that you create an applet with a toolbar, tool and a form.

On the form put a listbox or a combobox.

From the onClick event of the button SHOW the form.

On the PageSetActive event run your script:

dim n, layerCount, myControl
n = 1
set layerCount = Map.Layers.Count
myControl = Application.Applets("yourApplet").Forms("FORM1").Pages("PAGE1").Controls("JoelsControl")

While n <= layerCount
myControl.AddItem Map.Layers(n).name, Map.Layers(n).name
n = n + 1
Wend

As you are working only with points:

On the PageValidate event make sure you are selecting a value from the control and set editLayer = myControl.value
On the form ok event make map.layers(editLayer).editable = true

See how that goes and let me know where you get to.

Cheers,

Gareth
0 Kudos
RolfBroch
Occasional Contributor II
Maybe I am missing something but is this not default functionality?

Using the Edit Toolbar
  Click the Start/Stop Editing tool which brings up the editable layers in your map as a drop down list
  Select the layer unless it is already selected
  Add the feature using GPS or by clicking in the map
  Edit form pops up to be filled in

Remember to set the readonly attribute to true in the .apl for the layers you don't want to edit as in the example below.

<LAYER name="Forest" transparency="0.8" identify="true" edit="false" quickcapture="false" quickdraw="1" readonly="true">


Rolf
0 Kudos
JoelCrawford
New Contributor
Hey Gareth, I ended up going with a different workflow, but thanks for this code - the loop and additem to control was perfect!

I guess this thread is closed but I now have a new and scary issue with Low Memory!!

http://forums.arcgis.com/threads/55203-LOW-MEMORY-Issue-arises-as-features-collected


Thanks for all your help!
0 Kudos
JoelCrawford
New Contributor
Hi again!

This sounds a lot like my issue, as it happens with AXF and not SHP....

http://forums.arcgis.com/threads/45432-Arc-Pad-10-Virtual-memory?p=189851#post189851
0 Kudos