|
POST
|
Unfortunately I had not planned to go to the dev conference. Now if there is some beer, I might change my mind :cool:
... View more
02-24-2011
08:33 AM
|
0
|
0
|
1705
|
|
POST
|
The QueryTask class has a property 'DisableClientCaching' that can be set to true to prevent the request from being looded from the browser's cache.
... View more
02-24-2011
08:30 AM
|
0
|
0
|
1084
|
|
POST
|
Looks like you forgot to add a reference to System.Windows.Controls.Toolkit . Remember the readme 🙂 : 2c. Add a reference to the System.Windows.Controls.Toolkit to your silverlight application (!! Don't forget this step. !!)
... View more
02-24-2011
07:51 AM
|
0
|
0
|
1724
|
|
POST
|
Sorry I forgot to mention that if you have a hierarchy of group layers, you have also to adapt the C# code to take into account this hierarchy. Here is the code which should work whatever the number of group levels: void Legend_Refreshed(object sender, ESRI.ArcGIS.Client.Toolkit.Legend.RefreshedEventArgs e)
{
SetLayerItemImageSource(e.LayerItem);
}
private void SetLayerItemImageSource(LayerItemViewModel layerItem)
{
if (layerItem.LegendItems != null && layerItem.LegendItems.Any()) // if there is a legend item
layerItem.ImageSource = layerItem.LegendItems.First().ImageSource; // set the image of the sublayer with the image of the first legenditem
// Call recursively SetLayerItemImageSource
if (layerItem.LayerItems != null)
{
foreach(var sublayerItem in layerItem.LayerItems)
SetLayerItemImageSource(sublayerItem);
}
} Note that instead of using your own listbox and a binding to a legend control, you can also retemplate the legend control to use a listbox. For example with this template: <esri:Legend Map="{Binding ElementName=MyMap}" LayerItemsMode="Flat" ShowOnlyVisibleLayers="False" LayerIDs="California" Refreshed="Legend_Refreshed">
<esri:Legend.Template>
<ControlTemplate TargetType="esri:Legend">
<ListBox ItemsSource="{TemplateBinding LayerItemsSource}" >
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding IsEnabled, Mode=TwoWay}" IsEnabled="{Binding IsInScaleRange}" VerticalAlignment="Center"/>
<TextBlock Text="{Binding Label}" VerticalAlignment="Center"/>
<Image Source="{Binding ImageSource}" Margin="3,0"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</ControlTemplate>
</esri:Legend.Template>
<esri:Legend> you get this result:
... View more
02-24-2011
07:47 AM
|
0
|
0
|
3648
|
|
POST
|
Sorry I have no clue. Check that there is no mismatch in the dlls you referenced (MapPrintingControls and your app should reference the same ArcGIS client dlls). If you just compile the sample solution (MapPrinting + MapPrintingControls), is it working?
... View more
02-24-2011
07:32 AM
|
0
|
0
|
1724
|
|
POST
|
As it's only one service (despite the 100 layers), only one image is downloaded and there is nothing out of the box to follow the progression of the image creation on the server and of the download of the image.
... View more
02-24-2011
07:27 AM
|
0
|
0
|
1620
|
|
POST
|
The issue is probably that a layer can't be included in many maps. So if you want at the same time the main map and a preview of the print, you need to clone the layers for previewing them. This is done this way is this print sample: http://www.arcgis.com/home/item.html?id=e361c2cc69784fcba34358d0458f66e3
... View more
02-24-2011
05:48 AM
|
0
|
0
|
1722
|
|
POST
|
MapPrinterIndicator, MapPrinter and MapPrinterDialog are controls defined MapPrintingControls dll. So this first problem should be solved as soon as you add a reference to the MapPrintingControls (nevertheless note that if you defined xmlns:printing=...... you should use printing:MapPrinter/MapPrinterDialog/MapPrinterIndicator and not controls:MapPrinter/....). Concerning the WindowPanel, it's only a container for the MapPrinterDialog, so you can use any panel you want (or you can even use no panel). In the sample application, I was using the WindowPanel defined in the namespace MapPrinting.UserControls, but this is not mandatory. This allows to move the preview but you can use any panel already defined in your map application (or even no panel as suggested in the readme : just drag and drop the MapPrinterDialog to the mainpage)
... View more
02-23-2011
01:33 PM
|
0
|
0
|
1724
|
|
POST
|
What is the version of your ArcGIS server? Is it 10SP1 (10.01) or a previous version? That's important to know because in one case the legend infos are coming from your arcgis server, in the other case from arcgis.com.
... View more
02-23-2011
01:03 PM
|
0
|
0
|
2067
|
|
POST
|
Hi Dominique, do you know which piece of codes shows this measure action is completed? As far as I know there is no event coming from the measure action to show that the measure is over. The idea coming from this thread : http://forums.arcgis.com/threads/5650-MeasureAction-action-finished-event is to use the map.Layers events but there is perhaps better idea.
... View more
02-23-2011
01:00 PM
|
0
|
0
|
2336
|
|
POST
|
One option is that you use the event refreshed to associate an image to the layeritems and/or maplayeritems and to remove the lagenditems when there is only one entry. Then you will have to retemplate the MapLayerTemplate and/or the LayerTemplate in order to include the image. In this thread , there is a sample on how to associate an image to a LayerItem (coming from the first legend item), then you can delete the legenditems in order to save space.
... View more
02-23-2011
12:52 PM
|
0
|
0
|
1079
|
|
POST
|
If you have only one DymamicMapService in your map, it's normal that the progress jumps from 0 to 100 because there is only one image to load. If you have many layers or one tiled layer, you should see intermediate values.
... View more
02-23-2011
12:48 PM
|
0
|
0
|
1620
|
|
POST
|
Hi Kevin, I eventually reproduced your issue with 2.1. The good news (let's begin with this one:)) is that I was not able to reproduce the issue with the current version I am working with, so hopefully this will work well with the next version (2.2). The less good news is that I have had hard time to find out a workaround, and I am not sure the workaround I found covers all cases (but I think it makes things much better anyway). To test the workaround: - Remove the ConstraintExtentBehavior - Wire up the extentchanged and extentchanging events of the map to the following ConstraintExtent code: private Envelope _constrainedExtent = null;
private bool _hasExtentBeenSet = false;
private Envelope _lastExtent = null;
private void ConstraintExtent(object sender, ExtentEventArgs e)
{
var map = sender as Map;
if (map == null) return;
Envelope newExtent = e.NewExtent.Clone();
if (_constrainedExtent == null) // In this sample : initialize contrainted extent to first the extent
_constrainedExtent = newExtent;
if ((newExtent.XMin >= _constrainedExtent.XMin && newExtent.XMax <= _constrainedExtent.XMax && // completely within
newExtent.YMin >= _constrainedExtent.YMin && newExtent.YMax <= _constrainedExtent.YMax) ||
(newExtent.XMin >= _constrainedExtent.XMin && newExtent.XMax <= _constrainedExtent.XMax && // width within and height outside
newExtent.YMin <= _constrainedExtent.YMin && newExtent.YMax >= _constrainedExtent.YMax) ||
(newExtent.XMin <= _constrainedExtent.XMin && newExtent.XMax >= _constrainedExtent.XMax && // height within and width outside
newExtent.YMin >= _constrainedExtent.YMin && newExtent.YMax <= _constrainedExtent.YMax))
{
if (_hasExtentBeenSet)
{
_hasExtentBeenSet = false;
map.ZoomTo(newExtent.Expand(0.999)); // hack to force the refresh of the layers
}
return;
}
if (newExtent.Equals(_lastExtent))
return;
_lastExtent = newExtent;
if (newExtent.Width <= _constrainedExtent.Width && newExtent.Height <= _constrainedExtent.Height)
{
// Pan enough to respect constraint
double dx = Math.Min(_constrainedExtent.XMax - newExtent.XMax, Math.Max(_constrainedExtent.XMin - newExtent.XMin, 0));
double dy = Math.Min(_constrainedExtent.YMax - newExtent.YMax, Math.Max(_constrainedExtent.YMin - newExtent.YMin, 0));
newExtent.XMin += dx; newExtent.XMax += dx;
newExtent.YMin += dy; newExtent.YMax += dy;
map.PanTo(newExtent);
}
else
{
// Change extent to respect constraint
newExtent = newExtent.Intersection(_constrainedExtent);
map.Extent = newExtent;
_hasExtentBeenSet = true;
}
} Hope this help.
... View more
02-23-2011
09:40 AM
|
0
|
0
|
1346
|
| 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
|