|
POST
|
If _candidateGraphicsLayer.Graphics.Count > index condition fails, then index does not match your GraphicsCount. You have to debug through your code to know if _candidateGraphicsLayer.Graphics.Add() is hit and what value index is when it tries to access _candidateGraphicsLayer.Graphics.
... View more
01-20-2012
09:48 AM
|
0
|
0
|
1019
|
|
POST
|
Yes this code should replace your FeatureDataGrid_SelectionChange event handler. This is how you can get the graphic from FDG.row. Once you have the graphic, you can set AttachmentEditor.GraphicSource property.
... View more
01-20-2012
09:42 AM
|
0
|
0
|
1936
|
|
POST
|
This is a related thread: forums.arcgis.com/threads/43917-HTML-Popups-for-Silverlight. ArcGIS API for WPF also does not support HTML popups but you can use MapTip to display the attributes.
... View more
01-20-2012
09:33 AM
|
0
|
0
|
1239
|
|
POST
|
Thank you for sharing the sample. Since v2.3 introduced Auto-Projection, we cannot use GraphicsLayer.SpatialReference. You must set Map.SpatialReference by setting its Extent.SpatialReference:
<esri:Map WrapAround="True" x:Name="MyMap" Grid.Column="0" Grid.Row="1" >
<esri:Map.Extent>
<esri:Envelope>
<esri:Envelope.SpatialReference>
<esri:SpatialReference WKID="4326"/>
</esri:Envelope.SpatialReference>
</esri:Envelope>
</esri:Map.Extent>
<esri:GraphicsLayer >
<esri:GraphicsLayer.Renderer>
<esri:SimpleRenderer Symbol="{StaticResource DefaultLineSymbol}"/>
</esri:GraphicsLayer.Renderer>
<esri:GraphicsLayer.Graphics >
<esri:Graphic>
<Geometry:Polyline >
<Geometry:Polyline.Paths>
<Geometry:PointCollection>
<Geometry:MapPoint X="0" Y="51.399" />
<Geometry:MapPoint X="2.637" Y="48.865" />
<Geometry:MapPoint X="12.568" Y="41.706" />
<Geometry:MapPoint X="13.447" Y="52.483" />
<Geometry:MapPoint X="21.357" Y="52.160" />
<Geometry:MapPoint X="30.322" Y="59.845" />
</Geometry:PointCollection>
</Geometry:Polyline.Paths>
<esri:Polyline.SpatialReference>
<esri:SpatialReference WKID="4326"/>
</esri:Polyline.SpatialReference>
</Geometry:Polyline>
</esri:Graphic>
</esri:GraphicsLayer.Graphics>
</esri:GraphicsLayer>
<!--<esri:ArcGISTiledMapServiceLayer ID="MyLayer"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />-->
</esri:Map>
In addition, I've added this in code-behind so you can zoom to GraphicsLayer.FullExtent
MyMap.Layers.LayersInitialized += (s, e) =>
{
MyMap.ZoomTo(MyMap.Layers[0].FullExtent);
};
... View more
01-20-2012
09:30 AM
|
0
|
0
|
1061
|
|
POST
|
Here's some description on the RouteParameters: http://help.arcgis.com/en/webapi/wpf/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.RouteParameters.html If you look at Fiddler response when using this SDK sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Routing, you will see that Total_Time and Shape_Length are returned with RouteDirections=False. ReturnRoutes must be true though to get this information.
... View more
01-20-2012
07:49 AM
|
0
|
0
|
1204
|
|
POST
|
Can you attach a sample? I tried to add a GraphicsLayer to this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#UtilityActions but was not able to get the error even with the ArcGISTiledMapServiceLayer Visible=True.
... View more
01-18-2012
10:49 AM
|
0
|
0
|
1062
|
|
POST
|
You can use just one GraphicsLayer to label your features. If the graphics are of the same geometry, it is okay that they are added to the same layer. You can even set GraphicsLayer.Renderer to SimpleRenderer with TextSymbol that points to an attribute, this way you don't need to create TextSymbol instance every time.
... View more
01-18-2012
10:43 AM
|
0
|
0
|
1204
|
|
POST
|
This seem related thread: forums.arcgis.com/threads/8680-FeatureLayer-and-SpatialRelationship-for-selection-geometry The RelationshipResult can be filtered by geometry from the client API using FindGraphicsInHostCoordinates() or Intersects(). See post# 4 in this thread: forums.arcgis.com/threads/43496-Select-and-Delete-feature-overlapped-polygon-problem. These are the client-side operations.
... View more
01-18-2012
10:36 AM
|
0
|
0
|
1301
|
|
POST
|
This is related thread: forums.arcgis.com/threads/46013-FeatureDataGrid-Selection-Changed-Event (see post# 2).
... View more
01-18-2012
10:12 AM
|
0
|
0
|
1936
|
|
POST
|
The code-snippet I posted is for editing. If the graphic does not exist yet and you want to intercept the draw, you can use Draw.VertexAdded event, Draw.UndoLastVertex(), calculate new MapPoint, and Draw.AddVertex(newPoint). After the vertex was removed (UndoLastVertex), endpoint will be the start point from which you need to calculate the next point given the desired distance. Once you have this new point, you can AddVertex(newPoint).
PointCollection pnts = (_graphic.Geometry as Polyline).Paths[0];
MapPoint endPoint = pnts[pnts.Count - 1];
... View more
01-18-2012
10:09 AM
|
0
|
0
|
2351
|
|
POST
|
I'm not sure if this works for you but you can try updating this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsGeometry VertexAdded is one of GeometryEdit action, you can compare the distance between vertices then and if the shortest distance is still outside the max distance, you can Undo the last edit.
private void EditGeometry_GeometryEdit(object sender, EditGeometry.GeometryEditEventArgs e)
{
if (e.Action == EditGeometry.Action.VertexAdded)
{
var graphic = e.Graphic as Graphic;
var polyline = graphic.Geometry as Polyline;
var distance = double.NaN;
var vertex = e.NewItems[0] as MapPoint;
foreach (var p in polyline.Paths[0])
{
if (!double.IsNaN(distance)) break;
var d = Math.Sqrt(Math.Pow(Math.Abs(vertex.X - p.X), 2) + Math.Pow(Math.Abs(vertex.Y - p.Y), 2));
if (double.IsNaN(distance) || d < distance)
distance = d;
}
if (distance > maxDistance)
editGeometry.UndoLastEdit();
}
... View more
01-18-2012
08:48 AM
|
0
|
0
|
2351
|
|
POST
|
If you know the new geometry (X,Y), you can just set graphic.Geometry = new MapPoint(X, Y, MyMap.SpatialReference); You don't need to handle MouseMove.
... View more
01-18-2012
08:29 AM
|
0
|
0
|
1021
|
|
POST
|
You can use query.Where = "NOT (description is NULL)". http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0/query?objectIds=&where=not+%28description+is+NULL%29&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&outSR=&returnIdsOnly=false&f=html Or if you have already retrieved all features and want to filter the results via client API, you can use linq Query, you can do the following in QueryTask.ExecuteCompleted event handler: var nonNullValues = from f in e.FeatureSet.Features where f.Attributes["description"] != null select f;
... View more
01-18-2012
08:23 AM
|
0
|
0
|
905
|
|
POST
|
Yes this is correct, FeatureDataForm.IsValid property is set when an error is returned from updating a field and/or clicking apply. FeatureDataForm.EditEnded event is raised only if IsValid and updates to the attributes were commited successfully.
... View more
01-18-2012
08:13 AM
|
0
|
0
|
589
|
|
POST
|
I'm not sure how you are populating the ComboBox.Items to retrieve index. But how about the including the following condition: if(index >= 0 && _candidateGraphicsLayer.Graphics.Count > index)
... View more
01-18-2012
08:05 AM
|
0
|
0
|
1019
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-10-2026 12:13 PM | |
| 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 |
07-13-2026
09:07 AM
|