|
POST
|
Hi Kevin, What issues are you having with ShowCoordinatesBehavior?
... View more
08-25-2010
08:42 PM
|
0
|
0
|
1022
|
|
POST
|
Sure you will need to create a FeatureLayer that represent the RelatedTable and if you want to add an entry to this table, you will need to add Graphics with attributes matching the fields of this table. If you set AutoSave to false, you need to explicitly call SaveEdits().
... View more
08-25-2010
08:31 PM
|
0
|
0
|
1236
|
|
POST
|
For a FeatureLayer you can investigate the attribute type based on the layer's LayerInfo.Fields.
... View more
08-25-2010
08:11 PM
|
0
|
0
|
426
|
|
POST
|
You are correct, setting Fill to Transparent should give you the 'hollow' graphic. Here's one way of defining your Renderer (under Resources):
<esri:SimpleFillSymbol x:Key="MySimpleFillSymbol"
Fill="Transparent"
BorderBrush="Black"
BorderThickness="2" />
<esri:SimpleRenderer x:Key="MySimpleRenderer" Symbol="{StaticResource MySimpleFillSymbol}"/>
Instead of overwriting the FeatureSymbol, you can set the Renderer like so:
<esri:FeatureLayer ID="Polygon"
Renderer="{StaticResource MySimpleRenderer}" Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/LandusePlanning/FeatureServer/2" />
It's possible that your layer already defines a renderer that's why your FeatureSymbol was not used. To find out you can visit the layer's Url in your browser and look for "DrawingInfo" - this defines the layer's renderer.
... View more
08-25-2010
07:20 PM
|
0
|
0
|
448
|
|
POST
|
You can use WebClient DownloadStringAsync and parse the result into an XDocument. Based on the XML you provided, it seems like you can use a GraphicsLayer with UniqueValueRenderer (Attribute="precinct") that uses SimpleFillSymbol. Your UniqueValueRendererInfos will have a different color per precinct value. By setting the renderer, you do not have to create a symbol on individual graphics. But you will still need to create each graphic based on the ward information you just parsed so that each ward becomes a graphic in your GraphicsLayer with geometry from the given pointcollection, and attributes from the given "name" and "precinct" values. You can look at our SDK samples for guide: esriurl.com/slsdk2. Good luck.
... View more
08-20-2010
01:50 PM
|
0
|
0
|
667
|
|
POST
|
You can replace the ListBox ItemsSource="{Binding ElementName=MyMap, Path=Layers.[DynamicLayerCalifornia].Layers}" with an instance of ObservableCollection<LayerInfo> that gets populated when dynamic layer is initialized. Set the dynamic layer's VisibleLayers to an empty int[]. You also need to remove IsChecked="{Binding DefaultVisibility}" from the CheckBox. With these minor tweaks in the sample, you can control the sublayer visibility using the listbox.
<ListBox Margin="0,5,0,0"
x:Name="LayerList"
Grid.Row="1">
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox Margin="2"
Name="DynamicLayerCalifornia"
Content="{Binding Name}"
Tag="{Binding ID}"
ClickMode="Press"
Click="CheckBox_Click" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
private ObservableCollection<LayerInfo> layers = new ObservableCollection<LayerInfo>();
public MainPage()
{
InitializeComponent();
this.LayerList.ItemsSource = layers;
}
private void ArcGISDynamicMapServiceLayer_Initialized(object sender, EventArgs e)
{
ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer dynamicServiceLayer =
sender as ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer;
foreach (LayerInfo l in dynamicServiceLayer.Layers)
layers.Add(l);
dynamicServiceLayer.VisibleLayers = new int[] { };
}
... View more
08-20-2010
10:40 AM
|
0
|
0
|
304
|
|
POST
|
This is one way of finding the nearest geometry but it can be optimized. This sample assumes you are only checking against one layer and will select the closest graphic. The con for doing this is, you will be making async call on every graphic. You might want to refer to Buffer a Point and Intersect samples too. Another idea is to buffer the point returned by MapClick until you find geometries intersecting the buffered point. These intersecting geometries become your candidates for calling DistanceAsync. This may limit the number of async calls you make. At worse case, you may need to keep buffering the point only to find all geometries will intersect it, which means you will be calling DistanceAsync on all geometries anyway. I'm not sure how likely this scenario is but you have to remember too that there can be at most 1000 features returned for ArcGIS Server 10 or 500 for ArcGIS Server 9.31.
public MainPage()
{
InitializeComponent();
polygonLayer = this.MyMap.Layers["Polygon"] as FeatureLayer;
geometryService = new GeometryService("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
geometryService.DistanceCompleted += new EventHandler<DistanceEventArgs>(GeometryService_DistanceCompleted);
distanceParameter = new DistanceParameters()
{
DistanceUnit = LinearUnit.Kilometer,
Geodesic = true
};
}
FeatureLayer polygonLayer;
GeometryService geometryService;
DistanceParameters distanceParameter;
Graphic closestGraphic;
double distanceRecorded;
private void MyMap_MouseClick(object sender, Map.MouseEventArgs e)
{
closestGraphic = null;
distanceRecorded = 0;
if (polygonLayer != null && polygonLayer.Graphics != null && polygonLayer.Graphics.Count > 0)
{
int i = 0;
Graphic g = polygonLayer.Graphics;
geometryService.DistanceAsync(e.MapPoint, g.Geometry, distanceParameter, new object[]{polygonLayer.Graphics, i, e.MapPoint});
}
}
private void GeometryService_DistanceCompleted(object sender, DistanceEventArgs e)
{
object[] distanceParams = e.UserState as object[];
if (distanceParams != null && distanceParams.Length == 3 &&
distanceParams[0] is GraphicCollection && distanceParams[1] is int
&& distanceParams[2] is MapPoint)
{
GraphicCollection graphics = distanceParams[0] as GraphicCollection;
int index = (int)distanceParams[1];
MapPoint mp = distanceParams[2] as MapPoint;
if (closestGraphic == null || distanceRecorded > e.Distance)
{
distanceRecorded = e.Distance;
closestGraphic = graphics[index];
}
index++;
if (index < graphics.Count)
{
Graphic g = polygonLayer.Graphics[index];
geometryService.DistanceAsync(mp, g.Geometry, distanceParameter, new object[] { polygonLayer.Graphics, index, mp });
}
else
{
foreach (Graphic g in graphics)
{
if (g == closestGraphic)
g.Selected = true;
else
g.Selected = false;
}
}
}
}
... View more
08-20-2010
10:06 AM
|
0
|
0
|
1182
|
|
POST
|
If you make your stateNameQuery an ObservableCollection and have both combobox ItemSource set to this, you can set the second combobox SelectedItem="{Binding ElementName=vejComboBox, Path=SelectedItem, Mode=TwoWay}". It might also be a good idea to check for duplicates, before adding to your stateNameQuery. To make the combobox editable and autocomplete, you will need to create your own style. You can read up on it here: http://silverlightfeeds.com/post/53/Use_Styles_for_an_editable_Silverlight_ComboBox.aspx
... View more
08-20-2010
08:50 AM
|
0
|
0
|
696
|
|
POST
|
You can set DistanceParameter's DisplayUnit to always be in Kilometers for example, and then if user chooses another unit, convert from Kilometers to the desired unit.
... View more
08-18-2010
06:54 AM
|
0
|
0
|
478
|
|
POST
|
In addition to Brook's response, please also look at the following blog post: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/02/15/How-to-use-secure-ArcGIS-Server-services.aspx
... View more
08-17-2010
05:02 PM
|
0
|
0
|
829
|
|
POST
|
Based on the link you provided, there is a way to unblock the files inside the zip collectively if you are using Windows 7. You did not do anything wrong, it's just that these files were marked unsafe and needed to be unblocked prior to use. For Windows 7, 1. Right click on the zip file 2. Click on 'Properties' 3. Choose 'Unblock' in the 'Attributes' section 4. Extract file Note: If you unzip the file before unblocking, all files in the extracted folder are flagged as unsafe.
... View more
08-17-2010
04:52 PM
|
0
|
0
|
764
|
|
POST
|
If you upgraded to ArcGIS Server 10, you should update your ArcGIS API for SL/WPF to v2.0. Here's a list of what new in ArcGIS Server 10http://sampleserver3.arcgisonline.com/ArcGIS/SDK/REST/index.html?whatsnew.html.
... View more
08-17-2010
04:37 PM
|
0
|
0
|
294
|
|
POST
|
You will need to update the TemplatePicker's LayerIDs property which takes a string[] of layer IDs.
... View more
08-17-2010
01:42 PM
|
0
|
0
|
378
|
|
POST
|
These are good responses and if I may add, please also visit our Concepts page, this includes GettingStarted document. http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/help/index.html If you are using 9.3, you should visit: esriurl.com/slsdk, for 10, you should visit esriurl.com/slsdk2.
... View more
08-17-2010
10:10 AM
|
0
|
0
|
738
|
|
POST
|
Sure, we are continuing to try to improve our documentation. We will try to include this. Thank you.
... View more
08-17-2010
10:00 AM
|
0
|
0
|
599
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-11-2025 01:30 PM | |
| 1 | 06-06-2025 10:14 AM | |
| 1 | 03-17-2025 09:47 AM | |
| 1 | 07-24-2024 07:32 AM | |
| 1 | 04-05-2024 06:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-03-2025
08:39 PM
|