|
POST
|
Not sure about what you mean exactly by 'Legend Title'. If it's the label which is displayed close to the legend swatches, this label is coming from the renderer, for example, from the RendererInfo.Label property in case of UniqueValueRenderer or ClassBreakRenderer. So, to change this label, the easiest way is to set the renderer with the correct labels. For advanced scenarios, you can also change directly the LegendItemViewModel label in an handler that is wired up to the Legend.Refresh event.
... View more
06-11-2014
07:41 AM
|
0
|
0
|
479
|
|
POST
|
It might be due to the max records returned by a map service query. The default limit is 500 for ArcGIS Server 9.3.1 and 1000 for ArcGIS Server 10. This limit can be changed at the server size. From SL30.0 and ArcGIS Server 10.1, the API exposes this limit: FeatureLayer.LayerInfo.MaxRecordCount so we can programmatically know if you reach the limit or not.
... View more
05-23-2014
06:45 AM
|
0
|
0
|
1322
|
|
POST
|
The legend reflects the organization of the layers in the map. To get a hierarchy of layer, you have to organize your graphics layers into group layers. Then you have to set your Legend.LayerItemsMode to "Tree". The GroupLayers SDK sample demonstrates that.
... View more
05-23-2014
06:01 AM
|
0
|
0
|
945
|
|
POST
|
The swatch of a line symbol is supposed to have a hardcoded size of 20*20. I have no clue where this 320*290 size could come from. I would need a repro case. Could you provide one?
... View more
05-16-2014
07:44 AM
|
0
|
0
|
1914
|
|
POST
|
I set up the renderer, and it appear in the map If you setup a renderer, the renderer symbols should be displayed with the same size in the map and in the legend. What is the expected size of your symbols in the map?
... View more
05-16-2014
05:54 AM
|
0
|
0
|
1914
|
|
POST
|
Currently I'm using a Graphics layer, where the objects are created an the symbol is set. A graphics layer without renderer and without clustering should not have any legend item. How do you setup your graphics layer?
... View more
05-16-2014
05:22 AM
|
0
|
0
|
1914
|
|
POST
|
I am not sure which kind of layer you are referring to, but it's a WMS layer it often happens that the legend image provided by the service is that size. With WMS, all symbols for the layer are grouped into one image. Likely the legend provided by the service is actually 320*290 so there is no bug here. You can try setting a maxheight and maxwidth in the LegendItemTemplate but the legend will be stretched and may become unreadable.
... View more
05-15-2014
10:55 PM
|
0
|
0
|
1914
|
|
POST
|
- Toggling on the GroupLayer turns on the transfered in FeatureLayer, even if the latter is off. It's why I said 'a la google'. Turning on/off the group layer, turns the sublayers as well. You can change this behavior in GroupLayerItem_PropertyChanged. However, for consistency, we have still to turn off the feature layer when you turn off the group layer (else the FL would be visible while, in the legend, it appears inside a non visible group layer). Something like: void GroupLayerItem_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
// synchronize feature layer visibility on group layer
if (e.PropertyName == "IsVisible" && !_groupLayerItem.IsVisible)
_featureLayerItem.Layer.Visible = _groupLayerItem.IsVisible;
}
- Toggling on the transfered in FeatureLayer turns on the GroupLayer, which is different behavior than the non transfered in FeatureLayers in the GroupLayer. You could change this behavior in FeatureLayerItem_PropertyChanged (actually by removing all the code) but you would run into the same visual inconsistency as in previous case: FL visible that seems to be inside a non visible group layer.
... View more
04-18-2014
12:35 AM
|
0
|
0
|
1891
|
|
POST
|
Hm, maybe not possible/practical? You should get something working 'à la google' with code like: private LayerItemViewModel _featureLayerItem;
private LayerItemViewModel _groupLayerItem;
private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e)
{
var legend = sender as Legend;
if (legend == null)
return;
// initialize group layer item once
if (_groupLayerItem == null)
{
_groupLayerItem = legend.LayerItems.FirstOrDefault(l => l.Layer is GroupLayer); // here we suppose there is only one group layer but might be based on ID as well
if (_groupLayerItem != null)
_groupLayerItem.PropertyChanged += GroupLayerItem_PropertyChanged;
}
if (e.LayerItem.Layer is FeatureLayer && _groupLayerItem != null && !_groupLayerItem.LayerItems.Contains(e.LayerItem))
{
_featureLayerItem = e.LayerItem; // store feature layer item
_featureLayerItem.PropertyChanged += FeatureLayerItem_PropertyChanged;
legend.LayerItems.Remove(_featureLayerItem); // remove feature layer from the legend root (else it would be duplicated)
// Add feature layer item in the group layer
_groupLayerItem.LayerItems.Add(_featureLayerItem);
}
}
void GroupLayerItem_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
// synchronize feature layer visibility on group layer
if (e.PropertyName == "IsVisible")
_featureLayerItem.Layer.Visible = _groupLayerItem.IsVisible;
}
void FeatureLayerItem_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
// if feature layer item is toggled on, toggle on the group layer as well
if (e.PropertyName == "IsEnabled" && _groupLayerItem != null && ((LayerItemViewModel)sender).IsEnabled)
_groupLayerItem.IsEnabled = true;
}
That being said, I don't see why you don't set the layers in your map as you want to see them in the legend. But I may miss something.
... View more
04-17-2014
04:17 AM
|
0
|
0
|
1891
|
|
POST
|
OK, cool. Never used that library before. That's a Silverlight Viewer library, so might be better to post the question of the Viewer forum.
... View more
04-16-2014
11:10 PM
|
0
|
0
|
1256
|
|
POST
|
Thanks Dbroux. However, there seem to be differences between the GroupLayer type and types that impliment ISubLayerVisibilitySupport (Like ArcGISDynamicMapServiceLayer). I can't seem to find the right combination of handlers that mimic the functionality of an unmodified GroupLayer (all childlayers of the group respecting the visibility of the parent grouplayer). At first glance, I would say that you have only to subscribe to GroupLayer.PropertyChanged event and no more worry about ISubLayerVisibilitySupport. i.e something like: _groupLayerItem .Layer.PropertyChanged += (s, evt) =>
{
if (evt.PropertyName == "Visible")
UpdateFeatureLayerVisibility();
};
... View more
04-08-2014
04:59 AM
|
0
|
0
|
1891
|
|
POST
|
I answered to a similar question in this thread. Hope this helps.
... View more
04-02-2014
02:13 PM
|
0
|
0
|
1891
|
|
POST
|
But at the same I couldn't see all the labels displayed for every state.... something weird happening... Is it related to environment? The labelling engine hides labels if there is not enough place to display them without overlap. The labels should show up if you zoom in though.
... View more
03-27-2014
10:50 AM
|
0
|
0
|
1900
|
|
POST
|
I am able to display labels with your mpk file. See screenshot: [ATTACH=CONFIG]32562[/ATTACH] However, I have had to do 2 changes that could explain your issue: - filename is States1.mpk and not States.mpk - the map layer id is 0 and not 1 (MapLayerID="1" --> MapLayerID="0")
... View more
03-27-2014
10:21 AM
|
0
|
0
|
1900
|
|
POST
|
Dominique, I verified that I have a column named [NAME1] available... also tried to use the text as suggested.... nothing worked. If you could share your file States.mpk, I would take a look.
... View more
03-27-2014
09:16 AM
|
0
|
0
|
3447
|
| Title | Kudos | Posted |
|---|---|---|
| 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 | |
| 1 | 09-07-2021 03:12 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-30-2025
08:06 AM
|