|
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
|
1815
|
|
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
|
1851
|
|
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
|
2004
|
|
POST
|
What is the version of ArcGIS Desktop? I am using ArcGIS 10.
... View more
08-03-2010
10:09 AM
|
0
|
0
|
698
|
|
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
|
698
|
|
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
|
1177
|
|
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
|
1177
|
|
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
|
1177
|
|
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
|
1177
|
|
POST
|
Yes it is possible to edit featureLayer outside a map as long as the featurelayer is not readonly. In the following example a feature is being added to a featurelayer not in the Map. The key is to *initialize* the featurelayer and make edits in Intialized event. See code below for reference. private void UpdateFeatureLayer_Click(object sender, RoutedEventArgs e) { FeatureLayer Layertobeupdated = new FeatureLayer(); Layertobeupdated.ID = "mylayer"; Layertobeupdated.Url = "http://localhost/ArcGIS/rest/services/MontgomerySimple/FeatureServer/3"; Layertobeupdated.AutoSave = false; Layertobeupdated.Initialize(); Layertobeupdated.Initialized += new EventHandler<EventArgs>(Layertobeupdated_Initialized); } void Layertobeupdated_Initialized(object sender, EventArgs e) { FeatureLayer fl = sender as FeatureLayer; Graphic g = new Graphic(); g.Geometry = new ESRI.ArcGIS.Client.Geometry.MapPoint(509314.1673, 685143.8811); g.Attributes.Add("Name", "abc"); g.Attributes.Add("Service_Details", "Test adding SL"); g.Attributes.Add("Service_Type", "Testing"); g.Attributes.Add("Tracking_Number", "100"); fl.Graphics.Add(g); fl.SaveEdits(); } Hope this helps! Preeti I found a workaround: you have to add the FeatureLayer to a dummy Map... I know this is quite strange and I really don't like it, but it works. Create a dummy Map:
Map map = new Map() {
Extent = new Envelope() {
SpatialReference = new SpatialReference(3857)
}
};
Add the FeatureLayer to the Layers collection, then initialize the FeatureLayer and in the Initialized event call the Update method to load the data (to fill the Graphics collection). At this point you have to work with the Graphics: adding, updating, deleting graphics is all you have to do. Then call the SaveEdits method that in turn calls the ApplyEdits method of the internal EditTask (yes, the FeatureLayer has internally an EditTask). Hint: if you have to work only with a subset of features set the Where property of the FeatureLayer before calling Initialize and Update methods. it works, but I don't like this way at all: we are forced to load the FeatureLayer graphics (or a subset of them), working on them, before applying edits, with EditTask this is not necessary avoiding a roundtrip to the REST service (you have only to specify adds, deletes and updates graphics collection to send to the server).
... View more
07-16-2010
10:52 AM
|
0
|
0
|
410
|
|
POST
|
I tried following code to copy the Layers (altered from the default visibility) from one map to another and it works fine for me. Basically at the click of copy button I fetched the visible layers of the target ArcGISDynamicMapServiceLayer, created a new ArcGISDynamicMapServiceLayer in destination Map and gave same URL as Source map and set visiblity of layers and add the layer to destination Map. private void copy_Click(object sender, RoutedEventArgs e) { ArcGISDynamicMapServiceLayer destinationLayer = new ArcGISDynamicMapServiceLayer(); ArcGISDynamicMapServiceLayer OriginLayer = MyMap.Layers["MyDynamicLayer"] as ArcGISDynamicMapServiceLayer; //give the URL as the source map's DynamicService Layer destinationLayer.Url=OriginLayer.Url; //get all the visible layers from source service List<int> visibleLayerList = OriginLayer.VisibleLayers != null ? OriginLayer.VisibleLayers.ToList() : new List<int>(); //set the visiblelayers to what we got from above destinationLayer.VisibleLayers=visibleLayerList.ToArray(); //add to destination Map TargetMap.Layers.Add(destinationLayer); }
... View more
06-28-2010
02:02 PM
|
0
|
0
|
496
|
|
POST
|
Take a look at following two samples. They both illustrate creating Polyine and Polygon using esri symbols. http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AddGraphicsXAML http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AddGraphics Hope that helps.
... View more
06-28-2010
10:37 AM
|
0
|
0
|
398
|
|
POST
|
You have log-in to Resource Center using ESRI Global account to download the API. It is mentioned in the ArcGIS Silverlight/WPF Resource Center index page. http://help.arcgis.com/en/webapi/silverlight/index.html
... View more
06-25-2010
01:16 PM
|
0
|
0
|
364
|
|
POST
|
I guess you would still need to attach the ConstrainExtent behavior to the Map. The target for the Navigation action 'Full Extent' is the Map and if Map has the constrainExtent behavior then it will be honored whenever full extent is clicked. Hope that helps.
... View more
06-23-2010
11:34 AM
|
0
|
0
|
387
|
| Title | Kudos | Posted |
|---|---|---|
| 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 | |
| 1 | 12-26-2024 11:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-15-2025
10:12 AM
|