|
POST
|
Your code looks good. I think you are in the right track now. It works, right?
... View more
11-24-2010
08:49 AM
|
0
|
0
|
2222
|
|
POST
|
I think in the code that you posted, you are having problem with this line Dim objectid As Integer = Convert.ToInt32(featureSet.ObjectIdFieldName) The ObjectIdField property is the key to the attribute dictionary. http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureService.FeatureLayerInfo~ObjectIdField.html What you need to convert to an integer is the attribute value for that key, the actual object id. In the code I posted earlier, this is the VB version; where incidentLayer is a FeatureLayer:
Dim objectId As Integer = Convert.ToInt32(graphic.Attributes(incidentsLayer.LayerInfo.ObjectIdField))
I used a FeatureLayer to get LayerInfo and ObjectIdField. I did not want to hardcode the key used to get the object id. http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureService.FeatureLayerInfo_members.html You need not do the same thing, you can hardcode the key if you want, but you cannot convert the key to an integer. You need to get the value first and then convert 🙂
... View more
11-24-2010
07:57 AM
|
0
|
0
|
2222
|
|
POST
|
Kindly look at post #14 in this forum post: http://forums.arcgis.com/threads/14730-Area-And-Perimeter Once you know the parameters used by SL app (and they seem correct), you can use the same parameters on your web browser. Also check if any other web request failed prior to edits.
... View more
11-22-2010
09:06 AM
|
0
|
0
|
490
|
|
POST
|
Have you tried running Fiddler? Or applying edits through your web browser? It would be good to try this out too to make sure that the service allows edits. If doing the edit from your web browser also fails, then maybe it is your feature service. You might want to revisit this help page (if you haven't already): http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000023000000.htm
... View more
11-22-2010
07:31 AM
|
0
|
0
|
1804
|
|
POST
|
The closest I found online is this GetUrl (http://rexdotnet.blogspot.com/2010/09/use-google-maps-with-arcgis-silverlight.html). You are correct try to create the WebClient request from here. Maybe this would help too: http://forums.silverlight.net/forums/p/116593/445906.aspx
... View more
11-20-2010
03:09 PM
|
0
|
0
|
919
|
|
POST
|
You can set Editor to ContinuousMode=true and bind your "Change Map Location" button to CancelActive command. You can try it in this sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsAutoSave
... View more
11-20-2010
02:40 PM
|
0
|
0
|
724
|
|
POST
|
Can you subscribe to the Feature Layer's EndSaveEdits and SaveEditsFailed event? Also can you try to run Fiddler maybe there's more useful information there that we are missing.
... View more
11-20-2010
02:33 PM
|
0
|
0
|
1804
|
|
POST
|
You can subscribe to MouseRightButtonDown on the layer. e.Graphic will give you the feature that you need.
... View more
11-18-2010
02:06 PM
|
0
|
0
|
667
|
|
POST
|
Yes, you are right. You will need to create your own GeometryService. Here some documentation that might be useful: http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000027000000.htm
... View more
11-18-2010
02:04 PM
|
0
|
0
|
1346
|
|
POST
|
I think the best event to subscribe to is Map.Layers.LayersInitialized but make sure that you only check this once because the LayerCollection change will trigger this event again. LegendItems will not be null for the case when the layer comes from a service created by ArcGIS Server 10 SP1 http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/index.html To load your custom image for a legend item, you can do the following:
public MainPage()
{
InitializeComponent();
this.MyMap.Layers.LayersInitialized += Layers_LayersInitialized;
}
bool allLayersInitialized;
void Layers_LayersInitialized(object sender, EventArgs args)
{
if (!allLayersInitialized)
{
foreach (var l in this.MyLegend.LayerItems)
{
if (l.LegendItems == null)
{
l.LegendItems = new ObservableCollection<LegendItemViewModel>();
l.LegendItems.Add(new LegendItemViewModel() { ImageSource = new BitmapImage(new Uri("/image/car-blue-32x32.png", UriKind.Relative)), Description = "test" });
}
}
allLayersInitialized = true;
}
}
... View more
11-18-2010
01:14 PM
|
0
|
0
|
1805
|
|
POST
|
For the time-being, you can do the following as workaround: Ensure that the layer you are adding to the map is already initialized.
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
FeatureLayer l = new FeatureLayer() { ID = "Point", Url = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0" };
l.Initialized += l_Initialized;
l.Initialize();
}
private void l_Initialized(object sender, System.EventArgs e)
{
this.MyMap.Layers.Add(sender as Layer);
//this.MyEditorWidget.LayerIDs = new string[] { (sender as Layer).ID };
}
Also, note that setting LayerIDs is optional. It is not necessary when you already bind the EditorWidget or TemplatePicker's Map property to your map and there are no editable FeatureLayers you are trying to exclude. This should be sufficient (include GeometryService for Cut/Reshape/Union/Add with AutoComplete): <esri:EditorWidget x:Name="MyEditorWidget" Map="{Binding ElementName=MyMap}" />
... View more
11-18-2010
11:55 AM
|
0
|
0
|
605
|
|
POST
|
In your project references, does it show a warning symbol (!) next to the System.Windows.Interactivity? Can you check that when this assembly is selected the proper file path is located? Go to the path and see if the file exists (Kindly see attached). Installing Blend 4, should have updated your registry so that these assemblies are found when you add reference to .NET assembly.
... View more
11-18-2010
10:11 AM
|
0
|
0
|
2262
|
|
POST
|
It works for me. I tried the following where my map is in 102100 Spatial Reference.
<esri:Map x:Name="MyMap" ExtentChanged="MyMap_ExtentChanged">
<esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" />
<i:Interaction.Behaviors>
<esri:ConstrainExtentBehavior ConstrainedExtent="-4814883.48538718,-5216317.8461096,9656548.66851654,5273956.71733734" />
</i:Interaction.Behaviors>
</esri:Map>
The only thing I see in your code that may be the problem is: <i:Interaction.Behaviors> <esri:ConstrainExtentBehavior ConstrainedExtent="-9161000 4875000 -7532000 5779000"/> </i:Interaction.Behaviors> The Extent is not delimited by comma. This will lead to XamlParseException.
... View more
11-18-2010
10:01 AM
|
0
|
0
|
799
|
|
POST
|
The StackPanels are fine, they are guaranteed not to overlap elements contained within them. But I would be cautious with the Grids. Even if you create Row/ColumnDefinitions if not all elements contained in the Grid are assigned their respective Grid.Row/Column, they may share the same space and overlap may occur. In this example, the TextBlock will occupy the whole grid, blocking the map from getting any mouse event.
<Grid x:Name="LayoutRoot" Background="White" >
<esri:Map x:Name="MyMap">
<esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
</esri:Map>
<TextBlock/>
</Grid>
Whether it's this: (1): From post#5 <StackPanel Background="system color here"> <Grid Background="color here"> <StackPanel Background="color here"><Map/> </StackPanel> </Grid> </StackPanel> or this: (2) From post #1 <StackPanel> <StackPanel> <Grid><esriMap/></Grid> </StackPanel> </StackPanel> you are doing - Check the other elements contained in the Grid, specifically elements defined after the map. Comment them out one by one until you figure out which of those overlap the map. You can create a new project with only the map, you will see that pan works. So in your current app, pan does not work because either something intercepts the mouse events or map is not hit at all because some element is blocking it.
... View more
11-18-2010
09:43 AM
|
0
|
0
|
1150
|
|
POST
|
You verified nothing similar to this, right? In this case, I did not mean to overlap the map with the grid but it's not apparent to me because visually, the element blocking the map is transparent. If you have something like this, you need to set IsHitTestVisible=false on the grid that overlapped your map.
<Grid x:Name="LayoutRoot" Background="White" >
<esri:Map x:Name="MyMap">
<esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
</esri:Map>
<Grid Background="Transparent" />
</Grid> You mentioned that you no longer use ScrollViewer, right? Because if you still do, ScrollViewer intercepts the mouse events. You can also check if any mouse events on the parent of the map are marked handled. If so, the mouse events will not be raised for the map. For example:
<Grid x:Name="LayoutRoot" Background="White" MouseLeftButtonDown="LayoutRoot_MouseLeftButtonDown">
<esri:Map x:Name="MyMap">
<esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
</esri:Map>
</Grid>
private void LayoutRoot_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
e.Handled = true;
}
... View more
11-18-2010
08:30 AM
|
0
|
0
|
1150
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 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 |
a week ago
|