|
POST
|
hi, just installed the new 3.0 API because I need that for some new functionality, but, unless I'm mistaken, it appears that the Toolbar object is no longer there. In my coding, I'm getting the message "The name Toolbar does not exist in the namespace http://schemas.esri.com/arcgis/client/2009" and it doesn't appear in the list of ESRI objects that comes up when I try to type it in. It's also not in the samples anymore. I've been using this in previous sites and I want to continue using it. I'm not sure why it would be taken out but if this is the case, is there a way to have the present application I'm building use the previous API? Thank much! Dan The toolbar has been removed from the 3.0 API http://resources.arcgis.com/en/help/silverlight-api/concepts/index.html#//0166000000m9000000 You can not mix the APIs in a application, you either use 3.0 or you use 2.x, so if you want the new features you will need to remove the toolbar code
... View more
07-19-2012
09:03 PM
|
0
|
0
|
2181
|
|
POST
|
One way that should work would be to create a GraphicsLayer and add all the features to it
private void QueryTask_ExecuteCompleted(Object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs args)
{
FeatureSet featureSet;
featureSet = args.FeatureSet;
GraphicsLayer graphicsLayer = new GraphicsLayer();
if ( featureSet.Features.Count > 0 )
{
graphicsLayer.GraphicsSource = featureSet.Features;
MyMap1.ZoomTo(graphicsLayer.FullExtent);
}
else
{
MessageBox.Show("No f returned from query");
}
}
I think this would still work even though the GraphicsLayer is not added to the map
... View more
07-19-2012
07:25 AM
|
0
|
0
|
715
|
|
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
|
1086
|
|
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
|
2392
|
|
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
|
520
|
|
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
|
2392
|
|
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
|
1610
|
|
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
|
818
|
|
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
|
959
|
|
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
|
1058
|
|
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
|
745
|
|
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
|
1218
|
|
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
|
2903
|
|
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
|
679
|
|
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
|
2903
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-11-2026 09:07 AM | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
4 weeks ago
|