Skip to main content

Workflow - selecting features from map

Comments

11 comments

  • Permanently deleted user

    This is absolutely possible.

    First, use CaptureGeometry -- this takes a geometry type and lets the user input it on the map.

    Then you can take the output of this (the geometry the user drew) and use it as the input to the QueryTask. This will return a featureset that you can then select, or do whatever you want with.

    0
  • Permanently deleted user

    So how do I set up the query task?  I've created a Geometry variable called SelectedGeometry - do I use that in the Geometry attribute of the query task?  What would go into the Where atrribute?  Are there any examples that use Capture Geometry that I could look at?  Thanks.

     

    0
  • Permanently deleted user

    Yes, your geometry variable goes in the box where the Query task requests a geometry. If you have a geometry, you do not need a where clause, although you can still use one if you want to refine a query within a geometry.

    But if you just have a geometry, send that off in the query and you will get back the featureset of all the features that intersect that geometry.

    0
  • Permanently deleted user

    I seem to have put the prior post in too soon.  It does look like my capture geometry step is working, though there is something else not working correctly.  I'm starting from an example to create Mail labels by first selecting a parcel ID.  I took out the auto-complete for the PID on the first form.  I put the CaptureGeometry task next, and then fed that into the existing Query Parcel Layer.  When I tried it in SL, there was nothing to tell the user to draw a polygon, but it was possible to do so.  I did that, and the parcels within the polygon that I drew showed up yellow, but the buffer that showed up was a buffer for just one of the parcels, and the report looks like it was from this buffer.  I'm assuming that there is no way to input geometry when using the simulator...?

    0
  • Permanently deleted user

    You'll need to provide your own user prompts when using CaptureGeometry.

    To buffer for all the features in a featureset they need to be put through the Union Task first, so that there is a single geometry to buffer. There is a discussion on this and posted examples here:

    http://support.geocortex.com/Forums/Thread.aspx?pageid=0&mid=2&ItemID=20&thread=45619

    For debugging purposes I would suggest hardcoding a feature or features into your workflow so that it can run in the simulator, and then replace this with a CaptureGeometry when you are sure everything else works.

     

    0
  • Permanently deleted user

    So, it seems to be doing the union and set map extent okay, but when I try to tie it back into the rest of my previous workflow, it is hanging.  How do I go about hard-coding a polygon instead of doing the CaptureGeometry?

    0
  • Permanently deleted user

    So, looking further, it looks like the Union is creating a geometry, not a feature set, so do I need to change my buffer operation from a Buffer Task to a Buffer Geometry?  If so, will that affect things further down the workflow?

    0
  • Permanently deleted user

    It really depends on your workflow, but generally you should be able to convert whatever you have to whatever you need, as long as they are compatible sorts of things.

    Depending on what you need to do, you might not even need to use the Buffer Task etc... Assuming you have a geometry variable named 'geometry' then geometry.Extent.Expand(expandPercentage) will get you a buffered extent in one line.

    The ESRI Silverlight API reference is definitely your friend in these matters:

    http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client.html

    0
  • Permanently deleted user

    Do I need to do anything special in this case to convert it, or should I just be able to direct the results of the union and set extent to the old buffer task? 

    Also, when using variables, and in particular one of type geometry - should I just have one geometry type variable and use it to hold whatever my current geometry is, are there times where you might want multiple geometry variables?  Maybe if you were working with multiple layers?

    Also, each time that I run the routine, I'm getting new parcels added to my selection instead of replacing my selection - should I be doing some kind of an un-select operation?  Likewise with the buffer graphic...

    0
  • Permanently deleted user

    You can use the 'Run External Commands' feature to run some Silverlight Viewer commands that might help you:

    "ClearMarkup" and "ClearSelection" 

    Neither of these take a command parameter. Also, you can use as many variables of as many types as makes sense to you for your application. There are no limits imposed -- but you'll want to keep things clear and readable at all times, so don't use more than you need.

     

    0
  • Permanently deleted user

    I am trying to create a workflow that select the adjacent properties based on an user mouse click?

    Would somebody be able to explain the steps to get the "CaptureGeometry" Task to prompt the user to click on the map?  Thanks.

    0

Please sign in to leave a comment.