|
POST
|
Also is it possible to make Point and Polyline features visible which are put under or beneath the polygon. If theres some way that wud be great. ~Saurabh. The Graphics draw in order, so you need to rearrange the Graphics collection to draw in an order that puts what you want on top.
... View more
06-18-2012
08:10 PM
|
0
|
0
|
2742
|
|
POST
|
Not sure why you are so sure that it is not Graphics (i.e., Elements). There is nothing special about that 'Sub-Selection' other than its color. A SelectionSet is nothing more than a collections of Features which you have the ability to query and are drawn in a different color on the screen. You could just as easily create your own collection of Features
List<IFeature> subSelection = new List<IFeature>();
and draw these Features as IElements (setting Locked=true so the user cannot modify them) in a color that signifies what they are. Using Linq you could even make you own class that inherits for List<IFeature> and give it similar query abilities to what the SelectionSet provides. I am just not sure I understand what you think is so special about the Features that ArcMap highlights in the situation you describe and why just using your own collection and highlighting them yourself does not accomplish the goal you are trying to achieve. Good Luck
... View more
06-18-2012
08:00 PM
|
0
|
0
|
891
|
|
POST
|
Julie, Sorry but I really don't know much more about it than what is in the article that you found. I just kind of set it up to see how it worked, but have not done anything with it other than that. Wish I could be more help, but I just don't know anything more Good Luck
... View more
06-18-2012
09:31 AM
|
0
|
0
|
1246
|
|
POST
|
You may want to try esriSpatialRelEnum.esriSpatialRelWithin instead of intersects Good Luck
... View more
06-18-2012
02:48 AM
|
0
|
0
|
1311
|
|
POST
|
OK I was not clear on everything when I wrote my description, it sounds like you are already selecting the feature. Then you don't want to use something like selection set you want to use exactly IFeatureSelection::SelectionSet :). You can call Search on the ISelectionSet to get the selected item and then using the previous code display all the fields values in your list Hope that helps
... View more
06-18-2012
02:30 AM
|
0
|
0
|
1801
|
|
POST
|
Thanks for all replies. But when I select a row (from selected rows) in attribute table of ArcMap, ArcMap highlights the feature on map. I want to do the same. If ArcMap has this functionality, I think it must be possible for custom application too. Am I wrong? The behavior you mention in your second post differs from what you are asking in your initial post. The behavior you describe above is simply ArcMap highlighting a feature you selected, this differs from having two distinct selection sets which is what your initial post seems to be asking about. What is happening in the case above is basically a highlight graphic is being drawn with the same shape as the feature. This is certainly something that could be done. You could keep you selection and sub-selection set as collections withing your application and draw your own graphics using the shape of the features and these graphics could differ. To me this seems like it would accomplish your goal, it is different though from having two SelectionSets for the same FeatureLayer Good Luck
... View more
06-17-2012
09:44 PM
|
0
|
0
|
891
|
|
POST
|
A cursor is not indexed it only allows you to loop through the features to get access to an individual feature. What I would suggest for what you are trying to accomplish is to create an object which holds the attributes of the Feature (or the feature itself). You could load something like a listbox or tree with a collection of those features. When the user selects a feature from your list it then populates the edit list. Look at the Identify tool, that would be a good example of a UI like what I mean, but there are other ways for the user to enter what feature he wants. Something along these lines is what I mean
List<MyFeature> _myFeatures = new List<MyFeature>();
private void LoadTree(object sender, EventArgs e)
{
//do stuff to get your cursor
IFeature feature = cursor.NextFeature();
while ( feature != null )
{
MyFeature myFeature = new MyFeature();
myFeature.Feature = feature;
myFeature.Name = feature.Value[(feature.Fields.FindField("displayFieldName"))].ToString();
myFeature.ObjectId = feature.OID;
_myFeatures.Add(myFeature);
feature = cursor.NextFeature();
}
treeView.AfterSelect += TreeNodeSelected;
TreeNode parentNode = treeView.Nodes.Add("Features");
foreach ( var myFeature in _myFeatures )
{
TreeNode child = parentNode.Nodes.Add(myFeature.ObjectId.ToString(), myFeature.Name);
}
}
private void TreeNodeSelected(object sender, TreeViewEventArgs e)
{
MyFeature myFeature = _myFeatures.FirstOrDefault(f => f.ObjectId.ToString() == e.Node.Name);
//loop through field on myFeature.Feature like before
}
}
public class MyFeature
{
public int ObjectId { get; set; }
public string Name { get; set; }
public IFeature Feature { get; set; }
}
The above code is meant to give an idea of an approach, it is not tested code Hope that helps
... View more
06-17-2012
08:20 PM
|
0
|
0
|
1801
|
|
POST
|
If you want them to be able to enter multiple criteria than you do not want the query run on the click event of the check box. You want a button in there the runs the query after all the appropriate checkboxes are selected. If it is on the chekbox click it will run before they complete all of their selections <StackPanel x:Name="CheckBoxPanel" Orientation="Vertical" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="3" AllowDrop="True"> <TextBlock x:Name="QueryData" Text="Do you have any special needs for your trip?" Foreground="White" FontSize="20" FontWeight ="ExtraBold" Grid.Row="0" Margin="15,5,15,1" HorizontalAlignment="Center" > </TextBlock> <CheckBox x:Name="OxygenTank" Content="Oxygen Tank" Tag="OxyygenTank"/> <CheckBox x:Name="ServiceAnimal" Content="Service Animal" Tag="ServiceAnimal"/> <CheckBox x:Name="Walker" Content="Walker" Tag="Walker"/> <CheckBox x:Name="Wheelchair" Content="Wheelchair" Tag="Wheelchair"/> <CheckBox x:Name="Scooter" Content="Scooter" Tag="Scooter"/> <Button Height="30" Width="60" Content="Search" Click="Button_Click"/> </StackPanel> Also in the code in the post above, the statements are all in the form of if {} else if {} else if {}. This means that as soon as something is found to be true (a checkbox is checked) none of the other statements are evaluated, which is definitely not the goal. (Aside: As a general rule, else if {} is not a good construct) Just for fun I threw in a bit of a trick that could help reduce the amount of code. I added a Tag to each button that contains the field name. Tag is basically a property that is on every control to have some place to put some extra info if you wanted. Also I named the StackPanel so that it can be used in the code as a parent container of all our checkboxes To build the Where clause a variable is introduced to hold the Where string as all the checkboxes are looked at, creatively this was named where 🙂 private void Button_Click(object sender, RoutedEventArgs e) { //Setup stuff from before.... string where = null; //This uses a foreach with a little Linq, it will look at every Child of the StackPanel and if it is a CheckBox that is Checked then go into the loop foreach (CheckBox checkBox in CheckBoxPanel.Children.OfType<CheckBox>().Where(checkBox => checkBox.IsChecked == true)) { AppendWhere(ref where, checkBox); } query.Where = where; queryTask.ExecuteAsync(query); } private void AppendWhere(ref string where, CheckBox checkBox) { string checkBoxQuery = checkBox.Tag + " = '" + checkBox.Content + "'"; if ( where == null ) { where = checkBoxQuery; } else { where += " OR " + checkBoxQuery; } } The main part is building the Where clause in AppendWhere. The existing where is passed in (as a reference), if it is null than no query condition has been added to the query so it just starts it out with fieldname = fieldvalue. If the value of where is not null, that means a condition has been added and so an OR needs to be added before the next condition. Also using the little trick with the Tag and Content properties the entire string does not need to be written out. I am a terrible typer so believe that reducing the amount of code that needs to be written to accomplish a task is good Good luck
... View more
06-15-2012
08:49 PM
|
0
|
0
|
617
|
|
POST
|
There is a CompleteDraw() method on the Draw object. Just call that on your second click and it will fire off the Draw.Complete event.
... View more
06-15-2012
09:48 AM
|
0
|
0
|
426
|
|
POST
|
It has been a little since I have done much with flex viewer. But you could write a pretty straight forward widget with a combo box perhaps and a button and let the user select the service to load. Adding a service at run time is simply Map.Layers.Add(myLayer);
... View more
06-15-2012
02:02 AM
|
0
|
0
|
456
|
|
POST
|
Without knowing the data model it is pretty much impossible to give specific advice on setting up queries. The way you have things written below it seems you have an individual fields in your table called OxygenTank, ServiceAnimal, Walker. I would think you would have one FeatureClass for your points (hospitals I am guessing) and a related table for facilities or accessibility. But that is a data modeling exercise. If I where setting up queries in the manner you are describing I would more likely use CheckBoxes not RadioButtons. CheckBoxes would allow the user to choose multiple things and then query based on all those criteria, RadioButtons are choose only on of these which does not seem to be what you want. Also make sure you are using the correct SQL clause either AND or OR. It seems like you might want to be using AND (the facility both has oxygen tanks and allows access to service animals) as opposed to OR (the facility either has oxygen tanks, allows service animals, or both) One way would be to setup a form with Checkboxes for the user to choose the criteria they desire and then respond to a button click and build the query based on what has been selected. Hope that helps -Joe
... View more
06-14-2012
09:13 PM
|
0
|
0
|
617
|
|
POST
|
Thanks, it may take me a bit to fully understand the Zip method calls, but this is just what I need. I have an identify tool that works very similar to the desktop tool, so when they click on the result in the tree it displays the locator lines from the four sides and I wanted it to hit the midpoint on lines which was giving me troubles. Always enjoy learning some more linq much appreciated -joe
... View more
06-14-2012
09:36 AM
|
0
|
0
|
3125
|
|
POST
|
Try it without any Height and Width set and without the Alignment settings <esri:Map x:Name="edmsMap" Grid.RowSpan="2" ExtentChanged="edmsMap_ExtentChanged" IsLogoVisible="False" Margin="0,5,0,5" >
... View more
06-14-2012
05:54 AM
|
0
|
0
|
584
|
|
POST
|
I am setting up something what I want to draw a line to the middle point of another line. I have gone about a few approaches to finding that Midpoint none of which are returning the proper result. Using GetCenter on the bounding envelope, works good with small lines, but for large lines works very poor as the envelope may not even be on the line Trying to just grab the middle point (i.e., polyline.Paths[0][polyline.Paths[0].Count/2]). Better because at least it is always on the line, but with long lines usually not near the center because a curved section will have so many points compared to a straight section. I am stuck thinking I need to compute the length of the line and find the point closest to the center of that length. Calling a GeometryService is out of the question because this needs to work quickly, responding to a user event immediately. I am having fears of high school trigonometry as I think about calculating the length of each individual line segment and adding them all up. Anyone have a simpler approach that I am missing? Thanks -Joe
... View more
06-14-2012
03:04 AM
|
0
|
2
|
7618
|
|
POST
|
Your welcome, and feel free to give points for any helpful post by clicking the up arrow 🙂
... View more
06-14-2012
12:03 AM
|
0
|
0
|
775
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-23-2025 12:16 PM | |
| 1 | 10-19-2022 01:08 PM | |
| 1 | 09-03-2025 09:25 AM | |
| 1 | 04-16-2025 12:37 PM | |
| 1 | 03-18-2025 12:17 PM |
| Online Status |
Offline
|
| Date Last Visited |
12-04-2025
04:12 PM
|