|
POST
|
To display the features in current extent you would need to add your polyline layer as FeatureLayer with Mode=OnDemand. This would query/render features that are in the current extent. But again, if you zoom out and extent grows bigger you may run into slower rendering problem. See this sample http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#FeatureLayerOnDemand
... View more
06-27-2012
03:05 PM
|
0
|
0
|
1015
|
|
POST
|
What version of API and ArcGIS Server are you using? For ArcGIS Server, please mention if there is any servicepack installed? Generally, in order to get the updated MapDescription, you have to call GetServerInfo on IMapServer again, The following should be the workflow Create IMapServer3 Remove the layer Call IMapServerObjects.RefreshServerObjects Create IMapServer3 Add the layer Call IMapServerObjects.RefreshServerObjects Sample code: IServerContext serverContext; IMapServer2 mapServer; IMapDescription mapDesc; // Access fine-grained ArcObjects IMapServerObjects2 mapServerObj = (IMapServerObjects)mapServer; string strMapName = mapServer.DefaultMapName; IMap map = mapServerObj.get_Map(strMapName); // Add a new group layer to map IGroupLayer groupLayer = serverContext.CreateObject("esriCarto.GroupLayer") as IGroupLayer; groupLayer.Name = "New Group Layer"; map.AddLayer(groupLayer); // Apply changes to MapServer object mapServerObj.RefreshServerObjects(); // Get updated MapServerInfo and MapDescription IMapServerInfo2 mapServerInfo = mapServer.GetServerInfo(strMapName); mapDesc = mapServerInfo.DefaultMapDescription Let me know if this helps...If you want to provide us with your testcase, I will be more than happy to assist you..
... View more
12-15-2011
10:28 AM
|
0
|
0
|
1806
|
|
POST
|
If you are using v2.2 , then FeatureDataGrid in v.2.2 will display labels for codedvaluedomains but does not display labels for subtypes. It will only display the number for subtypes. But in upcoming release you will find dropdowns in FeatureDatagrid for types and Subtypes fields, displaying the labels. ArcGIS API for Silverlight 3.0 beta 1 already includeds this functionality, if you want to give it a try.
... View more
11-03-2011
04:14 PM
|
0
|
0
|
1319
|
|
POST
|
Can you explain why you want to differentiate them using XAML? Is there any attribute that makes them look different? Have you considered applying UniqueValueRenderer to the layer. UVR will display all different values with different symbol for each type. All you would need is to set the UniqueValueRenderer. Another option may be to define subtypes at the GDB level? Thanks, Preeti
... View more
11-03-2011
04:02 PM
|
0
|
0
|
1424
|
|
POST
|
Please take a look at sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#LocationToAddress All you need to do is tweak the sample a little bit for adding the returned result of the geocoding to a featureservice. In the codebehind go to in LocatorTask_LocationToAddressCompleted. In this event instead of adding the graphic to the graphic layer, you can add the graphic to your FeatureService(editable FeatureLayer) and call FeatureLayer.SaveEdits() to save the results. Hope this helps!
... View more
11-03-2011
03:45 PM
|
0
|
0
|
2331
|
|
POST
|
Open Proxy.ashx and look for line: req.ContentType = "application/x-www-form-urlencoded"; REPLACE ABOVE LINE WITH THE FOLLOWING LINE. req.ContentType = context.Request.Headers["Content-Type"]; Hope that helps!
... View more
08-04-2011
04:17 PM
|
0
|
0
|
3024
|
|
POST
|
I guess DateTime is Non-Nullable DataType so setting it to null won't work. Try setting it to null as follows: g.Attributes["UPDATEDATE"] = new DateTime?();
... View more
03-23-2011
09:15 AM
|
0
|
0
|
3048
|
|
POST
|
Did you install Silverlight 4 tools for Visual Studio? It is not in the list of components you installed. Here is the installation requirements help doc. http://help.arcgis.com/en/webapi/silverlight/help/Installation.htm.
... View more
08-05-2010
09:29 AM
|
0
|
0
|
3360
|
|
POST
|
What is the version of ArcGIS Desktop? I am using ArcGIS 10.
... View more
08-03-2010
10:09 AM
|
0
|
0
|
1219
|
|
POST
|
Hi, I tested the Measure Utility sample from Silverlight/WPF API 1.2 SDK help at: http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#UtilityActions I used same area for testing in ArcMap and the sample and got same results in Arcmap as it gave in the Silvelight Measure sample. What kind of error are you encountering? --Preeti
... View more
08-03-2010
10:07 AM
|
0
|
0
|
1219
|
|
POST
|
You haven't added the handler for MouseClick for map in your XAML. <esri:Map x:Name="MyMap" MouseMove="MyMap_MouseMove" Extent="-120, 30, -60, 60" MouseClick="MyMap_MouseClick" > <esri:Map.Layers> <esri:ArcGISTiledMapServiceLayer ID="AGOLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_ShadedRelief_World_2D/MapServer"/> <esri:ArcGISDynamicMapServiceLayer ID="DynamicLayerCalifornia" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer" InitializationFailed="Layer_InitializationFailed" /> <esri:GraphicsLayer ID="MyGraphicsLayer" /> </esri:Map.Layers> </esri:Map> </esri:Map.Layers> </esri:Map>
... View more
07-28-2010
01:49 PM
|
0
|
0
|
2060
|
|
POST
|
I think the spatialReference for the Wells layers is different than the basemap layer. The Extent that is going as parameter to identifytask is using the basemap's extent which probably does not match with coordinate system of the Wells layer and that is causing the identifyTask to not return any results. You can put a breakpoint in MyMap_MouseClick to see what is the extent passed to Identifytask parameters and also in IdentifyTask_ExecuteCompleted to see if any results are returned. --Preeti
... View more
07-28-2010
12:55 PM
|
0
|
0
|
2060
|
|
POST
|
You can copy the XAML below and make the following additons to the Toolbar sample's codebehind using System.Collections.Generic; using System.Windows; using System.Windows.Controls; using ESRI.ArcGIS.Client; using ESRI.ArcGIS.Client.Geometry; using ESRI.ArcGIS.Client.Tasks; namespace ArcGISSilverlightSDK { public partial class ToolBarWidget : UserControl { private List<DataItem> _dataItems = null; bool identifyclick = false; private void MyToolbar_ToolbarItemClicked(object sender, ESRI.ArcGIS.Client.Toolkit.SelectedToolbarItemArgs e) { MyDrawObject.IsEnabled = false; _toolMode = ""; switch (e.Index) { case 7: //Identify identifyclick = true; break; } } private void MyMap_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e) { if (identifyclick) { ESRI.ArcGIS.Client.Geometry.MapPoint clickPoint = e.MapPoint; ESRI.ArcGIS.Client.Tasks.IdentifyParameters identifyParams = new IdentifyParameters() { Geometry = clickPoint, MapExtent = MyMap.Extent, Width = (int)MyMap.ActualWidth, Height = (int)MyMap.ActualHeight, LayerOption = LayerOption.visible }; IdentifyTask identifyTask = new IdentifyTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/" + "Demographics/ESRI_Census_USA/MapServer"); identifyTask.ExecuteCompleted += IdentifyTask_ExecuteCompleted; identifyTask.Failed += IdentifyTask_Failed; identifyTask.ExecuteAsync(identifyParams); GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; graphicsLayer.ClearGraphics(); ESRI.ArcGIS.Client.Graphic graphic = new ESRI.ArcGIS.Client.Graphic() { Geometry = clickPoint, Symbol = LayoutRoot.Resources["DefaultPictureSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol }; graphicsLayer.Graphics.Add(graphic); identifyclick = false; } if (IdentifyBorder.Visibility == Visibility.Visible) IdentifyBorder.Visibility = Visibility.Collapsed; } public void ShowFeatures(List<IdentifyResult> results) { _dataItems = new List<DataItem>(); if (results != null && results.Count > 0) { IdentifyComboBox.Items.Clear(); foreach (IdentifyResult result in results) { Graphic feature = result.Feature; string title = result.Value.ToString() + " (" + result.LayerName + ")"; _dataItems.Add(new DataItem() { Title = title, Data = feature.Attributes }); IdentifyComboBox.Items.Add(title); } IdentifyComboBox.SelectedIndex = 0; } } void cb_SelectionChanged(object sender, SelectionChangedEventArgs e) { int index = IdentifyComboBox.SelectedIndex; if (index > -1) IdentifyDetailsDataGrid.ItemsSource = _dataItems[index].Data; } private void IdentifyTask_ExecuteCompleted(object sender, IdentifyEventArgs args) { IdentifyDetailsDataGrid.ItemsSource = null; if (args.IdentifyResults != null && args.IdentifyResults.Count > 0) { IdentifyBorder.Visibility = Visibility.Visible; IdentifyResultsPanel.Visibility = Visibility.Visible; ShowFeatures(args.IdentifyResults); } else { IdentifyComboBox.Items.Clear(); IdentifyComboBox.UpdateLayout(); IdentifyResultsPanel.Visibility = Visibility.Collapsed; } } public class DataItem { public string Title { get; set; } public IDictionary<string, object> Data { get; set; } } void IdentifyTask_Failed(object sender, TaskFailedEventArgs e) { MessageBox.Show("Identify failed. Error: " + e.Error); } private void DataDisplayTitleBottom_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; graphicsLayer.ClearGraphics(); IdentifyBorder.Visibility = Visibility.Collapsed; } } } ===================== XAML ============================================ <UserControl x:Class="ArcGISSilverlightSDK.ToolBarWidget" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:esri="http://schemas.esri.com/arcgis/client/2009" xmlns:slData="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" > <Grid x:Name="LayoutRoot" Background="White"> <Grid.Resources> <esri:SimpleFillSymbol x:Key="DefaultFillSymbol" Fill="#33FF0000" BorderBrush="Red" BorderThickness="2" /> <esri:PictureMarkerSymbol x:Key="DefaultPictureSymbol" OffsetX="35" OffsetY="35" Source="/Assets/images/i_about.png" /> </Grid.Resources> <esri:Map x:Name="MyMap" Extent="-33,-12.85,99.75,87.15" ExtentChanged="MyMap_ExtentChanged" MouseClick="MyMap_MouseClick"> <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" /> <esri:GraphicsLayer ID="MyGraphicsLayer" /> </esri:Map> <Grid Height="110" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" > <Rectangle Fill="#77919191" RadiusX="10" RadiusY="10" Margin="0,4,0,6" > <Rectangle.Effect> <DropShadowEffect/> </Rectangle.Effect> </Rectangle> <Rectangle Fill="#CCFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" /> <StackPanel Orientation="Vertical"> <esri:Toolbar x:Name="MyToolbar" MaxItemHeight="80" MaxItemWidth="80" VerticalAlignment="Top" HorizontalAlignment="Center" Loaded="MyToolbar_Loaded" ToolbarItemClicked="MyToolbar_ToolbarItemClicked" ToolbarIndexChanged="MyToolbar_ToolbarIndexChanged" Width="450" Height="80"> <esri:Toolbar.Items> <esri:ToolbarItemCollection> <esri:ToolbarItem Text="Identify"> <esri:ToolbarItem.Content> <Image Source="/Assets/images/i_about.png" Stretch="UniformToFill" Margin="5" /> </esri:ToolbarItem.Content> </esri:ToolbarItem> </esri:ToolbarItemCollection> </esri:Toolbar.Items> </esri:Toolbar> <TextBlock x:Name="StatusTextBlock" Text="" FontWeight="Bold" HorizontalAlignment="Center"/> </StackPanel> </Grid> <Border x:Name="IdentifyBorder" Background="#77919191" BorderThickness="1" CornerRadius="5" HorizontalAlignment="Right" BorderBrush="Gray" VerticalAlignment="Top" Margin="5"> <Border.Effect> <DropShadowEffect/> </Border.Effect> <Grid x:Name="IdentifyGrid" HorizontalAlignment="Right" VerticalAlignment="Top" > <Grid.RowDefinitions> <RowDefinition Height="30" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <TextBlock x:Name="DataDisplayTitleBottom" Text="Close" Foreground="White" FontSize="10" Margin="206,4,6,2" HorizontalAlignment="Center" MouseLeftButtonDown="DataDisplayTitleBottom_MouseLeftButtonDown" > <TextBlock.Effect> <DropShadowEffect /> </TextBlock.Effect> </TextBlock> <Grid x:Name="IdentifyResultsPanel" Margin="5,1,5,5" HorizontalAlignment="Center" VerticalAlignment="Top" Visibility="Collapsed" Grid.Row="1"> <Grid.RowDefinitions> <RowDefinition Height="30" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <ComboBox x:Name="IdentifyComboBox" MinWidth="150" SelectionChanged="cb_SelectionChanged" Margin="5,1,5,5" Grid.Row="0" > </ComboBox> <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Auto" Width="230" MinHeight="200" Grid.Row="1"> <slData:DataGrid x:Name="IdentifyDetailsDataGrid" AutoGenerateColumns="False" HeadersVisibility="None" Background="White"> <slData:DataGrid.Columns> <slData:DataGridTextColumn Binding="{Binding Path=Key}" FontWeight="Bold"/> <slData:DataGridTextColumn Binding="{Binding Path=Value}"/> </slData:DataGrid.Columns> </slData:DataGrid> </ScrollViewer> </Grid> </Grid> </Border> </Grid> </UserControl>
... View more
07-28-2010
10:32 AM
|
0
|
0
|
2060
|
|
POST
|
Actually it is pretty simple. All you need to do is add a toolbaritem to toolbar for identify tool. <esri:ToolbarItem Text="Identify"> <esri:ToolbarItem.Content> <Image Source="/Assets/images/i_about.png" Stretch="UniformToFill" Margin="5" /> </esri:ToolbarItem.Content> </esri:ToolbarItem> Create a bool variable and set it true only when "Identify" is clicked. bool identifyclick; private void MyToolbar_ToolbarItemClicked(object sender, ESRI.ArcGIS.Client.Toolkit.SelectedToolbarItemArgs e) { case 7: //Identify identifyclick = true; break; } } In Map Mouseclick event check value for this boolean variable to true before running identify logic private void MyMap_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e) { if (identifyclick) { //execute identify code identifyclick = false // at the end reset the bool variable to deactivate the identify tool. } } Basically it will be combination of ToolbarWidget sample and Identify Sample. Most of the code can be copied from Identify sample and pasted as is to toolbarWidget Sample. Attached is the sample XAML with implementation. Hope that helps
... View more
07-27-2010
05:06 PM
|
0
|
0
|
2060
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-11-2025 03:29 PM | |
| 2 | 09-04-2025 04:44 PM | |
| 1 | 04-14-2025 10:39 AM | |
| 1 | 12-17-2024 01:28 PM | |
| 1 | 01-16-2025 02:56 PM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|