|
POST
|
so what do I need to do with these files to add the toolbar back into my project? Yes add them in your project. By security change the namespace to avoid ambiguity with ESRI.ArcGIS.Client.toolkit. Add Toolbar.Theme.xaml in the merged dictionary of generic.xaml or app.xaml. That should do it.
... View more
07-23-2012
09:01 AM
|
0
|
0
|
2215
|
|
POST
|
In my mind it's to use as shown below, but I may have missed somthing in your need. private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e)
{
List<string> removeLayers = new List<string>
{
"Service Agreement Areas",
"HTE Routes",
"Water 3-way",
"Water 4-way",
"Water 5-way",
};
var toDeletes = LayerItem.GetAllParentChild().Where(pair => removeLayers.Contains(pair.Item2.Label)).ToArray();
foreach (var pair in toDeletes)
pair.Item1.LayerItems.Remove(pair.Item2);
}
... View more
07-23-2012
07:58 AM
|
0
|
0
|
2325
|
|
POST
|
Is there any what that the OpenStreetMap Basemap can be used when the spatial reference is not WGS1984?? No, OpenStreetmap is a cached tiled layer and so can only be used with a map having the same spatial reference, i.e WGS1984.
... View more
07-23-2012
07:50 AM
|
0
|
0
|
775
|
|
POST
|
dbroux , Thank you. I could able to get tuple pair of parent,child which I need to delete. But I do not understand second part, can you please explain in simple terms?. Second part might be confusing due to the usage of Tuple and it's members Item1 and Item2. Item1 is the parent, Item2 is the child to delete. Likely clearer by using intermediate variables: foreach (var pair in toDeletes)
{
var parentLayerItem = pair.Item1;
var layerItemToDelete = pair.Item2;
parentLayerItem.LayerItems.Remove(layerItemToDelete);
}
(it's why it could make sense to create your own class with better names than Tuple).
... View more
07-23-2012
04:43 AM
|
0
|
0
|
2325
|
|
POST
|
Basically I look for recursive loop logic to handle the case. I have seen another thread where dbroux provided sample for getting selecetd items but that does not help me. You can reuse the same idea as for the selected items, i.e write a recursive extension method returning all layer items and then filter with the criteria you need (selected is just a particular case). For removing the additional difficulty is that you need the parent item as well in order to be able to call parent.LayerItems.Remove(layerItemToRemove); So you can tweak the extension method to return an enumeration of pair <Parent, Child> (using .net Tuple but you might create your own class).
public static class LegendExtensions{
// Go recursively through the LayerItems and return a tuple <parent, child> for each child
public static IEnumerable<Tuple<LayerItemViewModel, LayerItemViewModel>> GetAllParentChild(this LayerItemViewModel layerItem)
{
return layerItem == null || layerItem.LayerItems == null ?
Enumerable.Empty<Tuple<LayerItemViewModel, LayerItemViewModel>>() :
layerItem.LayerItems.SelectMany(child => new[] { new Tuple<LayerItemViewModel, LayerItemViewModel>(layerItem, child) }.Concat(GetAllParentChild(child)));
}
} Then you can use that extension method to delete the items you want with code like:
var toDeletes = LayerItem.GetAllParentChild().Where(pair => new[] {"Service Agreement Areas", "HTE Routes", ....}.Contains(pair.Item2.Label)).ToArray();
foreach (var pair in toDeletes)
pair.Item1.LayerItems.Remove(pair.Item2);
... View more
07-23-2012
02:41 AM
|
0
|
0
|
2325
|
|
POST
|
The legend control doesn't support well symbols defined with a Canvas because we can't know easily the visible extent of the symbol. The workaround might be either to set explicitely the symbol size of the main grid : <Grid RenderTransformOrigin="0.5,0.5" Width="{StaticResource CadSymbolWidth}" Height="{StaticResource CadSymbolHeight}" > or, even simpler, just remove the Canvas should work as well.
... View more
07-21-2012
02:14 AM
|
0
|
0
|
1131
|
|
POST
|
If your field containing the owner is called 'OWNER', you can set a where clause such as OWNER='dbroux' That clause has to be generated dynamically by your application once you know the user name (I guess there is a login step).
... View more
07-19-2012
11:27 PM
|
0
|
0
|
999
|
|
POST
|
Joe is right, the toolbar has been removed from 3.0 after have been deprecated in 2.3 and 2.4. If you want, you can still get the code on codeplex and include it in your code. That being said, the cleaner solution is probbaly that you replace it by your own container (as it was done for the samples).
... View more
07-19-2012
11:07 PM
|
0
|
0
|
2215
|
|
POST
|
At the server side, when publishing the feature layer you can set the edit permissions in order to allow only the feature owner to modify or delete a feature. Then at the client side, an user won't be able to modify or delete a feature he doesn't own. But he will be able to see it. The way not to see them might be to add to the feature layer a where clause based on the owner field.
... View more
07-19-2012
09:55 AM
|
0
|
0
|
999
|
|
POST
|
But still, I can't use 'ShowOnlyVisibleLayers' property since I have to provide Check box before layer name.If user turns off the layer using this check box,then layer would not get re-added to Legend.Am i right? Sure. If the off layers are not displayed in the legend, the user won't be able to turn them on from the legend.
... View more
07-19-2012
09:39 AM
|
0
|
0
|
2182
|
|
POST
|
Not sure how you set the width. I think you have to set it in the control template of the text symbol. Something like: <ControlTemplate x:Key="TextSymbol">
<TextBlock Width="50" TextWrapping="Wrap" Text="{Binding Symbol.Text}"
FontFamily="{Binding Symbol.FontFamily}"
FontSize="{Binding Symbol.FontSize}"
Foreground="{Binding Symbol.Foreground}" />
</ControlTemplate> But I didn't test so that might not work.
... View more
07-19-2012
09:36 AM
|
0
|
0
|
3783
|
|
POST
|
Do you know of a way to translate pixels to esri coords without access to the Maps MapToScreen function? Map resolution gives the size of one pixel in geographical coordinates. So to translate pixels to map coordinates you can do : map.Resolution * pixels;
... View more
07-19-2012
09:28 AM
|
0
|
0
|
1027
|
|
POST
|
As FromJson does exist for a Featureset, the workaround may be to create a FeatureSet with only one geometry and return that geometry. Something like:
static Geometry FromJson(string json)
{
return FeatureSet.FromJson(@"{""features"":[{" + json + @"}]}").Features.First().Geometry;
}
... View more
07-19-2012
09:20 AM
|
0
|
0
|
1647
|
| 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
|