|
POST
|
Just like any other user control set the Visibility to Visibility.Collapsed. You might want to do it with the parent container of the actual FeatureDataForm
... View more
07-19-2012
07:09 AM
|
0
|
0
|
552
|
|
POST
|
[LEFT]This comes from code that Jennifer Nery from ESRI posted once a while back. The SelectedItem on the data grid is not a Graphic is actually an internal object. It shows how you can use reflection to get from the AddedItem to the actual graphic it represents.
object obj = e.AddedItems[0];
//This bit of trickery is from a post that Jennifer made on the forum to convert the SelectedItem to a graphic using reflection
MethodInfo methodInfo = obj.GetType().GetMethod("GetGraphicSibling");
if ( methodInfo == null ) return;
Graphic g = methodInfo.Invoke(obj, null) as Graphic;
Good luck[/LEFT]
... View more
07-16-2012
08:01 AM
|
0
|
0
|
1088
|
|
POST
|
Jerry, My guess is something wrong when you try to get your GraphicsLayer,
[LEFT]GraphicsLayer graphicsLayer = this.CurrentPage.myMap.Layers["MySelectionGraphicsLayer"] as GraphicsLayer;[/LEFT]
are you sure that MySelectionGraphicsLayer is a layer in your map. I would add a check to make sure that graphicsLayer is not null
... View more
07-16-2012
05:34 AM
|
0
|
0
|
351
|
|
POST
|
If the geometry is a point ZoomTo really does not work so good, you want to expand the point into an envelope or use the ZoomToResolution. I assume you are only selecting one item at a time, because if multiple items are selected that could mess it up a bit because ZoomTo is called for each Graphic which it might not like
... View more
07-15-2012
07:46 AM
|
0
|
0
|
1088
|
|
POST
|
I would say pretty much 6 of one half dozen of the other from a performance standpoint. It may pretty much be the exact same rest call and then they hydrate the objects afterwards Really a very large portion of the entire API is wrapper for rest calls like what I showed http://servicesbeta2.esri.com/arcgis/sdk/rest/index.html. For anything that has a response method if you really wanted to you could build your own rest call and use the WebClient. Obviously, using the API is a much simpler approach.
... View more
07-15-2012
02:42 AM
|
0
|
0
|
1004
|
|
POST
|
I think the most standard way would be to setup an Enumerable with your LayerId array and loop through those
private void Button_Click_1(object sender, RoutedEventArgs e)
{
int[] layerIDs = new[] { 0, 1, 2, 3, 4, 8 };
foreach ( var layerId in layerIDs )
{
ToggleVisibility(layerId);
}
}
One kind of fun way to learn new things and do it nice and clean would be to setup an Extension method to do it
// class to hold extension method
public static class ExtensionMethods
{
public static void ToggleVisibility(this ArcGISDynamicMapServiceLayer layer, IEnumerable<int> layerIds)
{
foreach (var layerId in layerIds)
{
layer.SetLayerVisibility(layerId, !layer.VisibleLayers.Contains(layerId));
}
}
}
Then are button click could look like this
private void Button_Click_1(object sender, RoutedEventArgs e)
{
var westTexas = Map.Layers["West Texas"] as ArcGISDynamicMapServiceLayer;
if ( westTexas == null ) return;
var layerIDs = new[] { 0, 1, 2, 3, 4, 8 };
westTexas.ToggleVisibility(layerIDs);
}
Happy coding
... View more
07-13-2012
09:15 AM
|
0
|
0
|
388
|
|
POST
|
While using WCF is certainly a workable approach I really think you should take a look at using a Server Object Extension (SOE). This allows you to run an extension attached to the map service that runs in the server process and is accessible as a rest endpoint. So things like connecting to the server are not needed because it already is running in the server. Plus it has easy access to the data sources in your map service. You could use either the Java API or the .Net API for ArcObjects to develop the extension. I think a lot of the Java code you have already written would be re-usable with this approach. Good Luck
... View more
07-13-2012
06:25 AM
|
0
|
0
|
611
|
|
POST
|
Thanks much Joe. That does explain it.Now please tell me how to vote and mark the response as you request. This explains the process http://resources.arcgis.com/node/4617Thanks
... View more
07-12-2012
11:29 PM
|
0
|
0
|
581
|
|
POST
|
See http://forums.arcgis.com/threads/61555-How-to-get-polygon-all-coordinates?p=212755#post212755
... View more
07-12-2012
09:19 AM
|
0
|
1
|
425
|
|
POST
|
Miri, I pretty much always use the custom window as fixed size so I have not ever noticed that behavior. I was looking at the code I wrote to see if I could figure out what is going on. What I find especially strange is that it would return to the original Width since nothing it done with Width. What I think needs to be done (have not had time to try) in the SetupMinimizeButton method the DoubleAnimation for both minimize and maximize is setup based on the Height, which would be the initial height. What I am thinking is that instead of setting up the Maximize animation at startup it should be done when Minimize is called and the you could set the To = ActualHeight at the time Minimize is clicked I should not close it permanently I will take a closer look. I use another class to manage the dialogs in the application, but from what I see it just changes IsOpen = true and the dialog reappears Hope that helps and thank you
... View more
07-12-2012
09:04 AM
|
0
|
0
|
679
|
|
POST
|
I would put in a Failed handler and see if something comes back. Everything looks good, the only thing I can think is that something is missing in your Url, the Failed response might give a helpful response. You do have the proper LayerId in your Url? Also you can download a tool called Fiddler if you don't have it, this will show you the rest calls and you can use it to compare what comes out of your code to what comes out of the browser. Good Luck
... View more
07-11-2012
08:00 PM
|
0
|
0
|
1798
|
|
POST
|
It is not an issue, as you notice everything is fine once you compile, it is just Visual Studio not finding things because the libraries have not been built yet. I think part of the reason for this is that they don't use the default namespaces for the added Actions and Controls which Visual Studio does not like prior to the first compilation. This type of behavior happens in XAML at other times where it just does not pick up namespaces before the project is recompiled
... View more
07-11-2012
07:55 PM
|
0
|
0
|
432
|
|
POST
|
Have you tried a simple query from your browser just to see if that will return any results? Something like this but maybe play around with it in your browser and see if you get any return values
Where = "CNAME = 'CULBERSON'"
Good Luck
... View more
07-11-2012
08:43 AM
|
0
|
0
|
1798
|
|
POST
|
See if this works
Where = "CNAME IN ('CULBERSON', 'JEFF DAVIS', 'LOVING', 'REEVES', 'WARD', 'WINKLER')"
... View more
07-11-2012
07:29 AM
|
0
|
0
|
1798
|
|
POST
|
How I have it setup which you would have to do slightly different (but pretty similar) is have a private field to hold the relationship id (in my case OID) so in my ExecuteComplete of the spatial query
//The OID of the current related feature that the user selected
private int _currentLocationId;
private void SpatialQueryCompleted(object sender, QueryEventArgs e)
{
if ( e.FeatureSet.Features.Count() == 0 ) return;
Graphic graphic = e.FeatureSet.Features[0];
//Assign the location OID to internal field so can use when a new record is created
_currentLocationId = Convert.ToInt32(graphic.Attributes["OBJECTID"]);
RelationshipParameter parameter = new RelationshipParameter
{
ObjectIds = new[] { _currentLocationId },
RelationshipId = 0,
OutFields = new[] { "OBJECTID" }
};
_queryTask.ExecuteRelationshipQueryCompleted += RelationshipQueryCompleted;
_queryTask.ExecuteRelationshipQueryAsync(parameter);
}
Then in the code where a new record is added
private void ExecuteAdd()
{
//Create the new Graphic object and set the default values for the attributes
Graphic graphic = new Graphic();
...
graphic.Attributes.Add("LOCATION_OID", _currentLocationId);
_featureLayer.Graphics.Add(graphic);
//Set the bound GraphicsSource so the DataForm is loaded with the new record
GraphicSource = graphic;
}
in your case you would set the _currentLocationId to the attribute that you are using but other than that it is about the same. What I also do is not include that relationship field in the OutFields on the FeatureLayer, so while I am setting it and creating the relationship the user does not see it For a delete, I have not done this, but I think you would need to add a Delete button like the Add button and Remove from the FeatureLayer. Maybe something along these lines
private void DeleteButton_Click(object sender, System.Windows.RoutedEventArgs e)
{
_featureLayer.Graphics.Remove(MyFeatureDataGrid.SelectedGraphics[0]);
}
... View more
07-11-2012
07:23 AM
|
0
|
0
|
1268
|
| 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
|