|
POST
|
I think you can replace this code graphicsLayer.Graphics.Insert(0, feature);
FeatureLayer featurelayer = graphicsLayer as FeatureLayer;
MyFeatureDataGrid.GraphicsLayer = featurelayer;
with
MyFeatureDataGrid.GraphicsLayer = feature.Layer as FeatureLayer;
It should display features from the Editable FeatureLayer. You need not add them to another GraphicsLayer.
... View more
02-06-2012
05:12 PM
|
0
|
0
|
1926
|
|
POST
|
I've tested code from post# 16 and it worked. The difference that I'm seeing with your code is that you declare FeatureLayer in XAML and then again in code-behind. Since the table has no Geometry associated to it, you need not add this to your Map. FeatureDataGrid.GraphicsLayer can be set when you create an instance of FeatureLayer. Try to do one piece at a time, see if you can get FeatureLayer, Initialized and Updated in code-behind. In the event handler, check that you have some graphics. Then try setting FeatureDataGrid to display these graphics.
... View more
02-06-2012
05:06 PM
|
0
|
0
|
4112
|
|
POST
|
Have you looked at this sample? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#InfoWindowSimple. Do you set InfoWindow.Content? You can still use GraphicsLayer with Graphics.Attributes containing the fields you want displayed in the InfoWindow.
foreach (Graphic g in selected)
{
MyInfoWindow.Anchor = e.MapPoint;
MyInfoWindow.IsOpen = true;
//Since a ContentTemplate is defined, Content will define the DataContext for the ContentTemplate
MyInfoWindow.Content = g.Attributes;
return;
}
Below these lines, when no graphic is found selected, it may display just the Geometry X,Y. notice that a different ContentTemplate is used.
InfoWindow window = new InfoWindow()
{
Anchor = e.MapPoint,
Map = MyMap,
IsOpen = true,
ContentTemplate = LayoutRoot.Resources["LocationInfoWindowTemplate"] as System.Windows.DataTemplate,
//Since a ContentTemplate is defined, Content will define the DataContext for the ContentTemplate
Content = e.MapPoint
};
... View more
02-06-2012
04:54 PM
|
0
|
0
|
1804
|
|
POST
|
Please check... If it can't find it then maybe the XAML namespace declaration could be wrong. Another way to check is to put a break point on GraphicSource class, to see if it comes through there. Check the class namespace is the same as what you define for xmlns:userControls="...".
... View more
02-06-2012
10:23 AM
|
0
|
0
|
1672
|
|
POST
|
Initialized event is different from IsInitialized. http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Layer~Initialized_EV.html vs http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Layer~IsInitialized.html. You subscribe to Initialized event just as you would any event and in the handler, call Update(). IsInitialized boolean property is used to check whether layer had tried to initialized, another property that is usually checked is InitializationFailure which contains exception if there was any. You can look at SDK samples (Code-behind VB) some of them include wiring up to Initialized event: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SubLayerList. It is similar signature, except you are working with FeatureLayer that has no XAML-code.
... View more
02-06-2012
10:21 AM
|
0
|
0
|
4112
|
|
POST
|
After googling around, VB does not support Anonymous methods 😞 that's why the conversion tool did not pick it up. You can try converting the following code instead:
l.Initialized += new EventHandler<EventArgs>(l_Initialized);
}
void l_Initialized(object sender, EventArgs e)
{
var l = sender as FeatureLayer;
l.Update();
}
to replace this code: l.Initialized += (s, e) => { l.Update(); };
... View more
02-03-2012
12:32 PM
|
0
|
0
|
4112
|
|
POST
|
I think we are talking about the same thing 🙂 You want your query to show all fields, I get that. For this reason, you don't want to limit query.OutFields. So the results that are returned will be everything. Since FDG is bound to a GraphicsLayer and determines its columns based on Graphics.Attributes, what you control is what you add to graphic.Attributes. If you need to access other fields that you did not want displayed in FDG, maybe you can use another GraphicCollection to save FeatureSet.Features.
... View more
02-03-2012
12:25 PM
|
0
|
0
|
2094
|
|
POST
|
Have you set FeatureLayer.OutFields? If this only contains a subset, these are the only Attributes that will show when you run your code. If you set OutFields="*", then all fields in your service will be displayed in graphic.Attributes.
... View more
02-03-2012
12:17 PM
|
0
|
0
|
1007
|
|
POST
|
You can look at the time-aware layers sample in the SDK: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#TimeFeatureLayer. Notice that Map.TimeExtent is set using TimeSlider and TimeSlider Min/Max/Value are based on Layer's TimeExtent.
<esri:Map x:Name="MyMap" WrapAround="True"
TimeExtent="{Binding ElementName=MyTimeSlider, Path=Value}">
<!-- more code goes here -->
<esri:TimeSlider x:Name="MyTimeSlider"
Height="20" TimeMode="TimeExtent"
MinimumValue="{Binding ElementName=MyMap, Path=Layers[EarthquakesLayer].TimeExtent.Start, Mode=OneWay}"
MaximumValue="{Binding ElementName=MyMap, Path=Layers[EarthquakesLayer].TimeExtent.End, Mode=OneWay}"
Value="{Binding ElementName=MyMap, Path=Layers[EarthquakesLayer].TimeExtent, Mode=OneWay}" >
</esri:TimeSlider>
... View more
02-03-2012
12:14 PM
|
0
|
0
|
1273
|
|
POST
|
I don't recall any code-change that may affect this area. Try the following code:
<esri:FeatureLayer ID="MyLayer" OutFields="*"
Url="yourServiceUrl">
<esri:FeatureLayer.MapTip>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ItemsControl ItemsSource="{Binding Keys}" Grid.Column="0" />
<ItemsControl ItemsSource="{Binding Values}" Grid.Column="1" />
</Grid>
</esri:FeatureLayer.MapTip>
</esri:FeatureLayer>
... View more
02-03-2012
12:07 PM
|
0
|
0
|
678
|
|
POST
|
Yes, that's right. But you know the original Geometry (before StartEdit()) and resulting Geometry after GeometryMoved (after StopEdit()), you can then compare the distance between the two geometries. In future versions, you would not need to call StopEdit() to get the current state of geometry.
... View more
02-03-2012
08:01 AM
|
0
|
0
|
1146
|
|
POST
|
For time-aware layers, you can use TimeClassBreaksAger, it is similar to ClassBreaksRenderer, except there is TimeUnits associated to MinimumAge and MaximumAge: http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.TimeClassBreaksAger.html
... View more
02-03-2012
07:55 AM
|
0
|
0
|
1273
|
|
POST
|
To answer your question, since FDG.Columns is dependent on GraphicsLayer.Graphics.Attributes, you should not add all fields returned by query to your graphic.Attributes. There could be more fields you can exclude here. Alternatively, simply use query.OutFields to show only fields you want returned in the FDG.
foreach (var f in args.FeatureSet.Features)
{
var g = new Graphic() { Geometry = Geometry.Clone(f.Geometry) };
foreach (var a in f.Attributes)
if(a.Key != "FieldToExclude")
g.Attributes[a.Key] = a.Value;
l.Graphics.Add(g);
}
... View more
02-03-2012
07:47 AM
|
0
|
0
|
2094
|
|
POST
|
Please try the following SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ConstrainExtentBehavior. You can also download SDK and see if you get errors. Note the following XAML namespace declaration: xmlns:esri="http://schemas.esri.com/arcgis/client/2009" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity">
... View more
02-03-2012
07:42 AM
|
0
|
0
|
2114
|
|
POST
|
Oh sorry I misunderstood. Unfortunately grabbing geometry while moving the vertices, is not supported.
... View more
02-02-2012
02:31 PM
|
0
|
0
|
785
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 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 |
3 weeks ago
|