|
POST
|
The only thing I noticed is that lot of your layers have relatively low MinScale (24000). If you are using the legend template of the interactive SDK:
<CheckBox Content="{Binding Label}"
IsChecked="{Binding IsEnabled, Mode=TwoWay}"
IsEnabled="{Binding IsInScaleRange}" >
</CheckBox>
you will notice that the checbox is not enabled while the map is not in the scale range of the layer, i.e. in your case, you need to zoom in a lot. Not sure it's your issue, but it's worth the try to test after removing that 'IsEnabled="{Binding IsInScaleRange}" '
... View more
03-10-2011
08:16 AM
|
0
|
0
|
1906
|
|
POST
|
I can't access 'buster'. Please share the result of the request.
... View more
03-10-2011
07:12 AM
|
0
|
0
|
1906
|
|
POST
|
If you need to get one line or one column by graphic, the ItemSources of your chart can be the Graphics property of your layer. Something like (based on this sample : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#TemporalRendererTracks) : <Charting:Chart>
<Charting:Chart.Series>
<Charting:ColumnSeries Title="Wind Speed" ItemsSource="{Binding ElementName=MyMap, Path=Layers[MyHurricaneFeatureLayer].Graphics}" IndependentValueBinding="{Binding Attributes[EVENTID]}" DependentValueBinding="{Binding Attributes[WINDSPEED]}"/>
</Charting:ColumnSeries>
</Charting:Chart.Series>
</Charting:Chart> Then, when using TimeAware layers, the difficulty is to filter the graphics in order your chart to display only the graphics in the current time extent and/or only the last observations. Let do that with the hurricane sample. 1) Let's write a method returning the graphics corresponding to the last observations of the time extent (thanks LINQ): private IEnumerable<Graphic> GetLastObservations(IEnumerable<Graphic> graphics)
{
return from g in graphics
where g.TimeExtent.Intersects(MyMap.TimeExtent)
group g by g.Attributes["EVENTID"] into grp
select grp.OrderByDescending(g => g.Attributes["Date_Time"]).First();
}
2) Define a property to return the LastObservations: private readonly ObservableCollection<Graphic> _lastObservations = new ObservableCollection<Graphic>();
public ObservableCollection<Graphic> LastObservations { get { return _lastObservations; } }
3) Define a method setting this LastObservations property: private void SetLastObservations()
{
var layer = MyMap.Layers["MyHurricaneFeatureLayer"] as GraphicsLayer;
LastObservations.Clear();
foreach (var g in GetLastObservations(layer.Graphics))
LastObservations.Add(g);
} 4) Call SetLastObservations when the collection can change i.e. when the feature layer updates and when the time extent changes: private void FeatureLayer_UpdateCompleted(object sender, EventArgs e)
{
SetLastObservations();
}
private void MyMap_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "TimeExtent")
SetLastObservations();
} 4) In XAML, hook up these events 5) Modify the chart to take care of this LastObservations property <Charting:Chart><Charting:Chart.Series>
<Charting:ColumnSeries Title="Wind Speed" ItemsSource="{Binding LastObservations}" IndependentValueBinding="{Binding Attributes[EVENTID]}" DependentValueBinding="{Binding Attributes[WINDSPEED]}">
</Charting:ColumnSeries>
</Charting:Chart.Series>
<Charting:Chart.Axes>
<Charting:LinearAxis Orientation="Y" Minimum="0" Maximum="120" Interval="20" ShowGridLines="True" FontStyle="Italic"/>
</Charting:Chart.Axes>
</Charting:Chart>
6) Set the datacontext of your control to itself: public TemporalRendererTracks()
{
InitializeComponent();
DataContext = this;
} Hope I didn't forget some steps!
... View more
03-10-2011
07:06 AM
|
0
|
0
|
2378
|
|
POST
|
I also need the legend dymbol for the layer. The image I have in the feature class is to store the legend symbol for the layer. How we can access that information? If you have included a legend control in your application, you can use it to get the swatches of the sublayers (look at this thread http://forums.arcgis.com/threads/23147-populating-sublayers-on-a-listbox-along-with-the-symbols) else you could call QueryLegendInfos of the service by yourself. Now I need to add a MouseEnter/Leave event to the Listbox that has the result, but this listbox is defined inside the DataTemplate. How and where I could add those event? Why not just hook up your handler in XAML?
<DataTemplate x:Key="FeatureItemDataTemplate">
<Grid MouseEnter="Grid_MouseEnter">
........
... View more
03-10-2011
06:40 AM
|
0
|
0
|
662
|
|
POST
|
[INDENT]Can we control the opacity of these sublayers...??? [/INDENT] No, the opacity is defined at the server side and can't be changed at the client side.
... View more
03-10-2011
03:37 AM
|
0
|
0
|
949
|
|
POST
|
Could you share the result of this kind of request on your service : http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Median_Age/MapServer?f=pjson ? (or share just the URL if your service is public). Also check that your REST end point is able to manage sublayer visibilities: - make a request on your map server (like http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Median_Age/MapServer) - click ExportMap - test with various Layers (such as 1 or 2 or 3...) and check that the sublayer visibilities are taken into account
... View more
03-09-2011
09:10 AM
|
0
|
0
|
1906
|
|
POST
|
I don't see any code selecting the graphics! Check also your symbology. To make a difference between a selected graphic and a unselected graphic, your symbols must react to the 'SelectionStates'. See sample : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SelectGraphics
... View more
03-09-2011
06:21 AM
|
0
|
0
|
706
|
|
POST
|
I need specifics fields from the layer instead what I am getting is the fields that have the information searched. The FindResult object contains a feature object with all its attributes. So you can extend your FeatureItem to store other attributes: .OtherAttribute = .elem.Feature.Attributes["AttributeName"] or even to store the whole Feature: .Feature= .elem.Feature Also I need functionalities when mouse over the list item to display the feaures it in the map. How I could do that? That will be easier if you store the Feature in your FeatureItem. So (as in the sample) from the SelectedItem, you can retrieve the Feature and show it in a graphics layer.
... View more
03-09-2011
05:52 AM
|
0
|
2
|
1844
|
|
POST
|
I perhaps misunderstood your issue. Do you mean that you don't get any legend infos (no sublayers, no swatches) for your 10SP1 service? If it's the case, could you test your legend rest end point? (something like : http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Median_Age/MapServer/legend)
... View more
03-09-2011
05:33 AM
|
0
|
0
|
1906
|
|
POST
|
The map is firing an 'ExtentChanged' event. You might hook up an handler to this event and, depending on the extent size, set the opacity of the map.
... View more
03-09-2011
05:27 AM
|
0
|
0
|
909
|
|
POST
|
Try by initializing 'ReturnGeometry' to true (depending on the service, the defaut value can be true or false, so...).
.....
query.OutFields.Add("*");
query.ReturnGeometry = true;
.......
... View more
03-09-2011
12:59 AM
|
0
|
0
|
2181
|
|
POST
|
Is your service cached? If cached, it's not possible to change the sublayer visibilities (since the exported images are generated from the cache).
... View more
03-09-2011
12:09 AM
|
0
|
0
|
1906
|
|
POST
|
Yes, you can change the viisbilities of the sublayers. There is a sample here: http://help.arcgis.com/en/webapi/sil...dWithTemplates From the API, you have to use either the VisibleLayers property or the SetLayerVisibility method.
... View more
03-09-2011
12:04 AM
|
0
|
0
|
949
|
|
POST
|
There is no slider since the opacity of a sublayer is not modifiable. To change the sublayer visibilities, you can use templated legend control like in this sample : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#LegendWithTemplates
... View more
03-09-2011
12:01 AM
|
0
|
0
|
930
|
|
POST
|
At this time, I don't understand why you have 2 levels of listbox : one in your SearchListBox and one in your FeatureDataTemplate. Let's focus on the first level. The goal is to initialize the 'ItemsSource' of your SearchListBox with an Enumeration of something. It turns out out that the 'FindResults' returned by the 'FindTask' is a List of 'FindResult', so it's a good candidate as an ItemsSource. To use it, there are 2 ways: - Hook up an handler to the ExecuteCompleted event and, in the handler, initialize the DataContext of your control with e.FindResults (that's probably the easier way). or - Set a binding by code to the LastResult property of the FindTask. The sample is working this way by this code:
Binding resultFeaturesBinding = new Binding("LastResult");
resultFeaturesBinding.Source = findTask;
FindDetailsDataGrid.SetBinding(DataGrid.ItemsSourceProperty, resultFeaturesBinding); .Then in your FeatureDataTemplate you can use properties of a 'FindResult' (i.e. LayerName, LayerId, Feature, Value, ...) So your XAML code
<Border BorderThickness="3" BorderBrush="Green" Grid.RowSpan="2" Grid.Column="0" >
<Image Source="{Binding PhotoUri}" Stretch="Fill" />
</Border>
<dataInput:Label Content="{Binding FeatureLayerName}" Grid.Row="0" Grid.Column="1"/>
<dataInput:Label Content="{Binding FeatureLayerItemCount}" Grid.Row="1" Grid.Column="1"/>
<ListBox Padding="2" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
ItemsSource ="{Binding Path=FeatureItems}"
ItemTemplate="{StaticResource FeatureItemDataTemplate}"
/>
should rather be (since I don't see where FeatureLayerName, FeatreLayerItemCount and PhotoUri are coming from) : <Border BorderThickness="3" BorderBrush="Green" Grid.RowSpan="2" Grid.Column="0" >
<Image Source="{Binding Feature.Attributes[PhotoUri]}" Stretch="Fill" />
</Border>
<dataInput:Label Content="{Binding LayerName}" Grid.Row="0" Grid.Column="1"/>
<dataInput:Label Content="{Binding LayerId}" Grid.Row="1" Grid.Column="1"/>
<dataInput:Label Content="{Binding Value}" Grid.Row="1" Grid.Column="1"/>
Hope this help.
... View more
03-08-2011
11:38 AM
|
0
|
0
|
1844
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-12-2025 03:01 AM | |
| 1 | 10-14-2025 09:24 AM | |
| 1 | 06-13-2013 09:22 AM | |
| 1 | 04-29-2022 02:21 AM | |
| 1 | 04-29-2022 02:28 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-30-2025
08:06 AM
|