|
POST
|
This is related thread http://forums.arcgis.com/threads/13749-how-to-Zoom-to-point
... View more
11-09-2010
11:43 AM
|
0
|
0
|
272
|
|
POST
|
After the ArcGISDynamicMapServiceLayer has initialized, you can populate your list of LayerInfo. Your ComboBox could contain LayerInfo objects instead of hardcoding the Categories. In your SelectionChanged event, you can update the ArcGISDynamicMapServiceLayer's VisibleLayers property. This will show only the selected sub layer. Code-behind:
InitializeComponent();
this.SubLayerComboBox.ItemsSource = layers;
}
ObservableCollection<LayerInfo> layers = new ObservableCollection<LayerInfo>();
ArcGISDynamicMapServiceLayer dynamicLayer;
private void ArcGISDynamicMapServiceLayer_Initialized(object sender, EventArgs e)
{
dynamicLayer = sender as ArcGISDynamicMapServiceLayer;
foreach (var l in dynamicLayer.Layers)
layers.Add(l);
}
private void SubLayerComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
LayerInfo selected = this.SubLayerComboBox.SelectedItem as LayerInfo;
if (dynamicLayer == null || selected == null) return;
dynamicLayer.VisibleLayers = new int[] { selected.ID };
}
You can then update your ComboBox ItemTemplate so it can rely on Binding to the LayerInfo.Name. XAML-code:
<ComboBox x:Name="SubLayerComboBox" VerticalAlignment="Top" HorizontalAlignment="Center" SelectionChanged="SubLayerComboBox_SelectionChanged">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
... View more
11-09-2010
11:31 AM
|
0
|
0
|
1217
|
|
POST
|
I know this error, it is annoying 😛 Unfortunately, we have no control over this but we are trying to get some clarification from Microsoft regarding this issue. The error only appears in Design view. You can still run your application without problem. If you remove LayerIDs in your Legend, this error will go away. The only thing I can say is that our team is aware of this Design view error and we too are finding answers about how we can possibly get this issue resolved or atleast workaround so that our users can still see Design view without the annoying error popping up 😛
... View more
11-09-2010
10:07 AM
|
0
|
0
|
2117
|
|
POST
|
Like I said here, you cannot sequentially make Asynchronous calls, you need to wait for one to finish before you can call another. 🙂 Like I said in the other thread you started about
... View more
11-09-2010
10:00 AM
|
0
|
0
|
977
|
|
POST
|
The SL app did not fail with IE but failed in Google Chrome? Did IE also raise InitializedFailed event? Can you also add eventhandler for Initialized and see if FeatureLayer's InitializationFailure has a value? It's also good to use Fiddler or Firebug to know exactly where it failed during the webrequests. There should not be any difference in behavior with different web browsers. I just wonder if you were accessing a layer that is secured and maybe different web browsers handle authentication differently - that is a possibility.
... View more
11-09-2010
09:56 AM
|
0
|
0
|
2944
|
|
POST
|
Based on this documentation about ResouceDictionaries http://msdn.microsoft.com/en-us/library/cc903952%28VS.95%29.aspx, a ResrouceDictionary must only contain shareable objects (see "Objects For ResourceDictionary Usage" section) In trying to reproduce the issue, I got compile time error: "element is already the child of another element", which lead me to the documentation above. I got read of the compile time error by creating a Style for the Symbol instead setting it's Template property. However, I got run-time errors since Symbol does not have Style property. What I suggest you do then, is to add PictureMarkerSymbol resource in your UserControl, instead of as ResourceDictionary.
... View more
11-09-2010
09:44 AM
|
0
|
0
|
2431
|
|
POST
|
What I mean to say is that you sure can make multiple queries but keep in mind that you cannot make multiple asynchronous calls sequentially, you need to wait for one to complete before you can call another. In other words, this would fail: identifyTask.ExecuteAsync(identifyParams1);
identifyTask.ExecuteAsync(identifyParams2); So for example you have a list of url's to query on, you need to keep track on what has been queried and what has not been queried yet. After the QueryTask ExecultCompleted fires, that is the only time you can call another query.
... View more
11-09-2010
08:35 AM
|
0
|
0
|
1442
|
|
POST
|
Yup I think that should work. Another suggestion is that you can use !string.IsNullOrEmpty(layer.ID)
... View more
11-09-2010
08:30 AM
|
0
|
0
|
469
|
|
POST
|
You cannot do Async calls in one iteration. You need to make one Async call at a time, after the previous Async call has returned.
... View more
11-08-2010
02:29 PM
|
0
|
0
|
1442
|
|
POST
|
Sure. This was the code I copied from your post, except the image source is modified to point to my image.
xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.Resources>
<esri:PictureMarkerSymbol x:Key="AddressSearchMarkerSymbol" Source="Images/vehicles/policecarL.png" Height="30" Width="30">
<esri:PictureMarkerSymbol.ControlTemplate>
<ControlTemplate>
<Canvas>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="MouseOver">
<Storyboard RepeatBehavior="ForEver">
<DoubleAnimation BeginTime="0" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" From="1" To="10" Duration="00:00:01" />
<DoubleAnimation BeginTime="0" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" From="1" To="10" Duration="00:00:01" />
<DoubleAnimation BeginTime="0" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.Opacity)" From="1" To="0" Duration="00:00:01" />
</Storyboard>
</VisualState>
<VisualState x:Name="Normal" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Ellipse Height="10" Width="10" Canvas.Left="-5" Canvas.Top="-5" RenderTransformOrigin="0.5,0.5" x:Name="ellipse" IsHitTestVisible="False">
<Ellipse.RenderTransform>
<ScaleTransform />
</Ellipse.RenderTransform>
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Color="#00FF0000" />
<GradientStop Color="#FFFF0000" Offset="0.25"/>
<GradientStop Color="#00FF0000" Offset="0.5"/>
<GradientStop Color="#FFFF0000" Offset="0.75"/>
<GradientStop Color="#00FF0000" Offset="1"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<Image x:Name="image" Source="Images/vehicles/policecarL.png" Height="30" Width="30" HorizontalAlignment="Center" VerticalAlignment="Center" Canvas.Left="-15" Canvas.Top="-15" />
</Canvas>
</ControlTemplate>
</esri:PictureMarkerSymbol.ControlTemplate>
</esri:PictureMarkerSymbol>
BTW, what version are you using? I'm testing this against 2.1 RC. Also looking at the error messages you posted, the StackTrace do not include ESRI methods. Maybe check your project references, maybe one of the .NET assemblies could not be resolved. What you can also do is create a new SL app, with only this symbol resource and the map I had in my earlier post. See if with minimal code, you are able to switch back and forth XAML and Design tab. Sometimes identifying the real problem means you have to isolate a lot of other things to get to the real issue.
... View more
11-08-2010
02:21 PM
|
0
|
0
|
2431
|
|
POST
|
I just tried your PictureMarkerSymbol on my SL app. I only updated the Image Source to point to my own image file. And I'm able to switch back and forth on XAML and Design page without errors thrown. But when running the SL app, I get error because of this typo. I think you meant "RenderTransform" without the space 🙂 Storyboard.TargetProperty="( UIElement.RenderTransf orm).(ScaleTransform.ScaleX)" From="1" To="10" I don't know if it would help to share what the my map contained:
<esri:Map x:Name="MyMap" >
<esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
<esri:GraphicsLayer ID="MyGraphicsLayer">
<esri:GraphicsLayer.Graphics>
<esri:Graphic Symbol="{StaticResource AddressSearchMarkerSymbol}">
<esri:MapPoint X="-117.22672317423" Y="33.9176215942354"/>
</esri:Graphic>
</esri:GraphicsLayer.Graphics>
</esri:GraphicsLayer>
</esri:Map>
... View more
11-08-2010
01:05 PM
|
0
|
0
|
2431
|
|
POST
|
Hmm I don't think you need to do all that. A simpler approach would be to make use the Attributes property of each graphic. Notice that in that sample, graphicsLayer.Graphics contain the features returned by the query. Feature, in this sample is not only the Geometry but also the Attributes. You can make use of FeatureDataGrid and have it point to the GraphicsLayer that contain the results. This might be related to what you are trying to achieve: http://forums.arcgis.com/threads/8309-How-to-perform-spatial-query-between-two-services...
... View more
11-08-2010
12:24 PM
|
0
|
0
|
977
|
|
POST
|
The point of ensuring namespace in the code-behind and xaml match is so you don't run into errors you were having where the control cannot be found, the namespace is not defined. Since you have verified that namespaces match, you can check at the project references. I believe in VB there's a button to show all files. Be sure that ESRI.ArcGIS.Client.dll's were added or that they point to the proper location. When these assembly references are not resolved, you get into problems like types not defined. I'd like to point you to this tutorial link: http://msdn.microsoft.com/en-us/vbasic/cc817878.aspx The problems you have been running into is not related to our API but to setting up projects in VB. Also, the compile errors usually provide line numbers or when you double-click on them you get pointed to the file that is causing problems. Go to the problem files, and try to solve it one piece at a time. You can identify the root of the issue by reading the errors themselves. It helps to backtrace the problem. For example, Xaml failed because code-behind failed, code-behind failed because project references were missing.
... View more
11-08-2010
12:14 PM
|
0
|
0
|
1348
|
|
POST
|
The FeatureLayer Url property cannot be changed after the layer has been initialized. I would suggest swapping out the layers themselves rather than Url's. Your ComboBox ItemsSource will then have list of FeatureLayers instead of string URL's. Just update its ItemTemplate to show the either the Url or LayerInfo.Name to identify the layer. On the ComboBox SelectionChanged event, you can add/remove layers to/from your Map.
public MainPage()
{
InitializeComponent();
FeatureLayer layer = new FeatureLayer() { Url = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/LandusePlanning/FeatureServer/0" };
layer.Initialized += new System.EventHandler<System.EventArgs>(layer_Initialized);
layer.Initialize();
layer = new FeatureLayer() { Url = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/LandusePlanning/FeatureServer/1" };
layer.Initialized += new System.EventHandler<System.EventArgs>(layer_Initialized);
layer.Initialize();
this.FeatureLayersCB.ItemsSource = layers;
}
ObservableCollection<FeatureLayer> layers = new ObservableCollection<FeatureLayer>();
void layer_Initialized(object sender, System.EventArgs e)
{
layers.Add(sender as FeatureLayer);
}
<ComboBox x:Name="FeatureLayersCB" VerticalAlignment="Top" HorizontalAlignment="Center">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding LayerInfo.Name}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
... View more
11-08-2010
11:59 AM
|
0
|
0
|
1110
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Friday | |
| 1 | 09-11-2025 01:30 PM | |
| 1 | 06-06-2025 10:14 AM | |
| 1 | 03-17-2025 09:47 AM | |
| 1 | 07-24-2024 07:32 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|