|
POST
|
You can clone the map and the layers inside the map. You may find code doing that in the print sample.
... View more
01-15-2013
03:53 AM
|
0
|
0
|
554
|
|
POST
|
Thanks again for your suggestion! One question: If I surround each ScatterViewItem with a viewbox, they are no longer ScatterViewItems, and hence it will not be possible to place them on the ScatterView. Is this correct, or did I misunderstand something? You are right, I was not clear. I am not sure of the workflow of your application but when you add an UIElement in the ScatterView, a ScatterViewItem is automatically created to encapsulate this element. What I meant was surrounding by a viewbox the UIElement that you add in the Scatter View. So the visual hierarchy will be something like: ScatterView --> ScatterViewItem --> Viewbox --> UIElement
... View more
01-15-2013
03:48 AM
|
0
|
0
|
1933
|
|
POST
|
I'd only like to display the legend of subLayerId 18, but to do that I have to include subLayerId 15. No you should just give 18. When I do this, all sublayers belonging to subLayerId 15 are included in the legend, even though I don't pass their Id's to LegendOptions. That's normal, 15 being a group layer, if you give it as input all sublayers will be included in the legend as well. Including only subLayerId 18 yields no results. That's not normal. What happens if you display only this layer in the map and you export the map with the default parameter (i.e without setting LegendOptins by yourself)? You should only see this layer in the legend and then you can use fiddler to check the sublayers sent to the server.
... View more
01-10-2013
05:16 AM
|
0
|
0
|
1599
|
|
POST
|
Strange! I tweaked the UsingDataSource interactive SDK sample and I set a new GraphicCollection each time the user clicks on the map. That works! Here is the code. Comparing with yours might give you some clue: XAML: <UserControl x:Class="ArcGISSilverlightSDK.UsingGraphicsSource"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
xmlns:local="clr-namespace:ArcGISSilverlightSDK" >
<Grid x:Name="LayoutRoot" Background="White">
<Grid.Resources>
<local:Customers x:Key="customers" />
</Grid.Resources>
<esri:Map x:Name="MyMap" MouseClick="MyMap_OnMouseClick">
<esri:ArcGISTiledMapServiceLayer
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" />
<esri:GraphicsLayer ID="MyGraphicsLayer"
GraphicsSource="{Binding Source={StaticResource customers}, Path=MyGraphicsList}" />
</esri:Map>
</Grid>
</UserControl> C#: using ESRI.ArcGIS.Client;
using ESRI.ArcGIS.Client.Geometry;
using ESRI.ArcGIS.Client.Symbols;
using System;
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows.Media;
namespace ArcGISSilverlightSDK
{
public partial class UsingGraphicsSource : UserControl
{
public UsingGraphicsSource()
{
InitializeComponent();
}
private void MyMap_OnMouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e)
{
var customer = LayoutRoot.Resources["customers"] as Customers;
customer.MyGraphicsList = Customers.CreateNewGraphicCollection();
}
}
public class Customers : INotifyPropertyChanged
{
private static readonly ESRI.ArcGIS.Client.Projection.WebMercator mercator = new ESRI.ArcGIS.Client.Projection.WebMercator();
public Customers()
{
MyGraphicsList= CreateNewGraphicCollection();
}
private GraphicCollection _myGraphicsList;
public GraphicCollection MyGraphicsList
{
get { return _myGraphicsList; }
set
{
_myGraphicsList = value;
RaisePropertyChanged("MyGraphicsList");
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string prop)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(prop));
}
}
internal static GraphicCollection CreateNewGraphicCollection()
{
var graphicCollection = new GraphicCollection();
var random = new Random();
for (int i = 0; i < 10; i++)
{
var g = new Graphic
{
Geometry = mercator.FromGeographic(new MapPoint(random.Next(-180, 180), random.Next(-90, 90))),
Symbol = new SimpleMarkerSymbol
{
Color = new SolidColorBrush(Color.FromArgb(255, (byte)random.Next(0, 255), (byte)random.Next(0, 255), (byte)random.Next(0, 255))),
Size = 28
}
};
graphicCollection.Add(g);
}
return graphicCollection;
}
}
}
... View more
01-10-2013
05:08 AM
|
0
|
0
|
2036
|
|
POST
|
Hi Tracey, At first glance, I don't see any problem in your code. If your class inherits from INotifyPropertyChanged, that should work. Does your class Map_ViewModelDataSource inherit from INotifyPropertyChanged?
... View more
01-09-2013
10:04 PM
|
0
|
0
|
2036
|
|
POST
|
The position of the items being managed in device-independent units, the only way to keep the geographical position of the items is to include the scatter view (with a fixed size) inside a Viewbox. So the display of the scatter view is stretched while zooming in or out but its size doesn�??t change and the items keep their geographical position. The counterpart is that the items scale up and down while zooming since their size in device independent units doesn�??t change but they scale because the viewbox scales. The solution might be to wire up an handler to the map Extent_Changed event and to change the scatterviewitems size dynamically depending on the map scale. But to keep the content of the scatter item unchanged while changing the scatter item size, I guess you have to encapsulate each item inside a viewbox. In short: Surround the scatter view by a viewbox that is inserted in the element layer with a fixed size. Surround by a viewbox each scatter view item that doesn�??t have to scale while zooming On map extent changed event, loop on all scatter view items containing a viewbox and change the items size by a size depending of the map scale. Hope this helps.
... View more
01-09-2013
09:15 AM
|
0
|
0
|
1933
|
|
POST
|
Hi Chris, I've tested your nice sample and I found out that the issue was coming from points having a latitude equals to 90 or -90. When converted to Web Mercator projection, we end up with a Y value equals to + or - infinity and that messes up the cluster process. The workaround for now might be avoid such latitude. After changing your code to: // add the objects as Graphics to our graphics layer datasource
foreach (var asset in assets)
{
asset.Lat = Math.Min(89.9, Math.Max(-89.9, asset.Lat));
var graphic = new Graphic ....... all seem OK. Thanks
... View more
01-09-2013
12:09 AM
|
0
|
0
|
2084
|
|
POST
|
Envelope env = new Envelope(); You have to set the map extent to null by code like: MyMap.Extent = null;
... View more
01-08-2013
11:58 PM
|
0
|
0
|
1497
|
|
POST
|
I would like to compare the ImageSource those use in the graphic of my Layer. That won't work. The legend ImageSource is a static snapshot of the symbol and there is no way to retrieve the symbol or the graphics from that image source. The easiest way to get the association between a legend item and a symbol is during the event Legend.Refreshed. The legend items returned by the feature layer are in the same order as the UniqueValueInfos in the UniqueValueRenderer, so at this stage you could store the symbol or the UniqueValueInfo in the Tag of the LegendItemViewModel. Then you can reuse this tag when the user clicks the checkbox in the legend.
... View more
01-08-2013
11:56 PM
|
0
|
0
|
2054
|
|
POST
|
The identify task doesnt run unless I grab the mouse and click. Screen taps appear to not work. It's depending on the event you subscribe to execute your identify task. If you subscribe to MouseClick event only, the identify task won't run on Tap event. You have to subscribe to tap or, better, MapGesture event as well. Another approach consists to use a Draw object in Point DrawMode and to execute the identify task when the draw completed. The Draw object includes snapping capabilities so this approach is recommended. I wanted to see if it was my app or not so I viewed the live samples on this site and sure enough it doesnt work there either. You are right. We are considering to enhance the samples to get a better support of the touch screens.
... View more
01-07-2013
11:24 PM
|
0
|
0
|
1063
|
|
POST
|
I have determined that the problem is a cross domain problem which gives me the 'Security Error' exception If you set the ProxyUrl property of the KML layer, the proxy will be used for the Network Link as well. So this should solve your issue. For testing purpose you can use our proxy demo server : http://servicesbeta3.esri.com/SilverlightDemos/ProxyPage/proxy.ashx If that helps you will have to install your own proxy. I have attempted to download the Silverlight proxy example from here: http://help.arcgis.com/en/webapi/sil...LProxyPage.zip but I keep getting a 404 error that the files is not available. You can download the proxy example here.
... View more
01-07-2013
10:24 PM
|
0
|
0
|
1858
|
|
POST
|
If the error occurs unfrequently and randomly, it's probably coming from the server for example due to a time out after a long period of server inactivity. As noticed by tek_siri, the best would be either to use fiddler to observe the requests or to log the events at server side. But if you can't reproduce the issue, it's hard to debug. If most generally the second user attempt after a fail is working, you might implement it by code, i.e. in the Failed Handler, retry once to execute the request.
... View more
01-07-2013
10:07 PM
|
0
|
0
|
2166
|
|
POST
|
Could you share a sample allowing to reproduce the issue? Thanks
... View more
01-07-2013
09:57 PM
|
0
|
0
|
1839
|
|
POST
|
There is no out of the box solution for showing or hiding all graphics corresponding to a unique value or a class break of the renderer (I am guessing it's what you would need). You could do it by yourself by code but it's likely not that easy. I see 3 possible approachs: - change to null the symbol of the class break or the unique value, so the graphics will not be displayed (but the legend will reflect this null value). - change to null the symbol of all graphics whose attribute is in the class break range (and set FeatureLayer.RendererTakesPrecedence to false) - change the where clause of the FeatureLayer in order to exclude the graphics that are in the range Unfortunately I have no sample to share with these approachs. Dominique
... View more
01-07-2013
09:55 PM
|
0
|
0
|
2054
|
|
POST
|
unless if you want to see my url and login I can send them your way. You may send me login info for testing at [email protected] Thanks.
... View more
01-07-2013
09:26 PM
|
0
|
0
|
1381
|
| 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
|