|
POST
|
You are right, it looks like there is an issue in this case. As a temporarly workaround, you can initialize the extent by code when the map is loaded : <esri:Map x:Name="MyMap" Layers="{Binding Layers, Mode=OneWay}" Loaded="MyMap_Loaded" />
void MyMap_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
MyMap.Extent = (ESRI.ArcGIS.Client.Geometry.Envelope)LayoutRoot.Resources["InitialExtent"];
} /Dominique
... View more
05-07-2010
04:43 AM
|
0
|
0
|
290
|
|
POST
|
If you have the version 2 of the API, another option you might consider is to create a FeatureLayer which will give you the list of fields after the initialization step. Example: Declare a feature layer in selection only mode in order not to request any data you don't need. <esri:FeatureLayer Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/0"
Mode="SelectionOnly" Initialized="FeatureLayer_Initialized">
Get the fields by handling 'Initialized' event : private void FeatureLayer_Initialized(object sender, EventArgs e)
{
FeatureLayer featureLayer = sender as FeatureLayer;
List<Field> fields = featureLayer.LayerInfo.Fields;
fields.ForEach(field => Debug.WriteLine(String.Format("Field Name = {0}, Alias = {1}, type = {2}", field.Name, field.Alias, field.Type)));
} /Dominique
... View more
05-07-2010
03:24 AM
|
0
|
0
|
1379
|
|
POST
|
You have to edit the template : Open the project in Blend, rightclick the Toolbar and select to edit a copy of the template. Select the stackpanel called 'RootElement'. Change the orientation from Horizontal to Vertical. /Dominique
... View more
05-07-2010
03:18 AM
|
0
|
0
|
550
|
|
POST
|
From an ArcGISDynamicmapServiceLayer, you can use either 'Identify' which returns the features of the map service near a point (example : http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#Identify ) or a Query task which returns the features of a layer (example : http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#SpatialQuery). If you are using the version 2.0 of the API, you can also consider using a featureLayer in SelectionOnly mode (Example : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerSelection). Hope this help. /Dominique
... View more
05-07-2010
03:13 AM
|
0
|
0
|
1078
|
|
POST
|
If you want to pan to a graphic object of your graphics layer, you can directly call the PanTo method of the map: graphic.Geometry.SpatialReference = MyMap.SpatialReference
MyMap.PanTo(graphic.Geometry)
/Dominique
... View more
05-07-2010
02:55 AM
|
0
|
0
|
259
|
|
POST
|
You are right, I had missed your issue with map control in your original post. Sorry about that. For your problem, I am in lack of idea. It's probably possible to use an underlying map control for generating a bitmap image and then to reuse this bitmap image in your WPF application. But I never tested that and it should not be that easy to implement. Hoepfully somebody will have a better idea. /Dominique
... View more
05-07-2010
02:48 AM
|
0
|
0
|
540
|
|
POST
|
Silverlight/WPF API can't directly read mxd/mxt files : you need a map service. Another option is you to use the map engine control in a WPF application. See: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/how_to_host_an_arcgis_engine_mapcontrol_in_a_wpf_application/0001000004pp000000/ But there are some limitations : http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/limitations_on_using_arcgis_engine_controls_in_wpf/00010000030r000000/ /Dominique
... View more
05-06-2010
11:17 AM
|
0
|
0
|
540
|
|
POST
|
I don't think there is a SL API giving the fields for ArcGISDynamicMapServiceLayer but you can get the info by requesting the REST point. For example http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Population_Density/MapServer/3?f=pjson gives this result: {
"id" : 3,
"name" : "Counties",
"type" : "Feature Layer",
"geometryType" : "esriGeometryPolygon",
"description" : "This thematic map presents the population density in the United States in 2009. Population density is the number of people per square mile. It is calculated by dividing the total population count of geographic feature by the area of the feature, in square miles. The area is calculated from the geometry of the geographic feature in projected coordinates. The geography depicts states at greater than 25m scale, counties at 1m to 25m scale, Census Tracts at 250k to 1m scale, and Census Block Groups at less than 250k scale. The map has been designed to be displayed with semi-transparency of about 50% for overlay on other base maps, which is reflected in the legend for the map. For more information on this map, visit us online at http://goto.arcgisonline.com/maps/Demographics/USA_Population_Density",
"definitionExpression" : "",
"copyrightText" : "Copyright:© 2009 ESRI",
"minScale" : 25000000,
"maxScale" : 750001,
"extent" : {
"xmin" : -19840230.3902342,
"ymin" : 2144435.3403614,
"xmax" : -7452840.46520711,
"ymax" : 11537127.3143578,
"spatialReference" : {
"wkid" : 102100
}
},
"displayField" : "NAME",
"fields" : [
{"name" : "Shape", "type" : "esriFieldTypeGeometry", "alias" : "Shape"},
{"name" : "ID", "type" : "esriFieldTypeString", "alias" : "ID"},
{"name" : "NAME", "type" : "esriFieldTypeString", "alias" : "Name"},
{"name" : "ST_ABBREV", "type" : "esriFieldTypeString", "alias" : "State Abbreviation"},
{"name" : "TOTPOP_CY", "type" : "esriFieldTypeInteger", "alias" : "2009 Total Population"},
{"name" : "POPDENS_CY", "type" : "esriFieldTypeDouble", "alias" : "2009 Population Density"},
{"name" : "LANDAREA", "type" : "esriFieldTypeDouble", "alias" : "Land Area in Square Miles"},
{"name" : "Shape_Length", "type" : "esriFieldTypeDouble", "alias" : "Shape_Length"},
{"name" : "Shape_Area", "type" : "esriFieldTypeDouble", "alias" : "Shape_Area"}
],
"parentLayer" : {"id" : 0, "name" : "USA Population Density"},
"subLayers" : []
} But you will need a little code to deserialize this. /Dominique
... View more
05-06-2010
06:32 AM
|
0
|
0
|
1379
|
|
POST
|
I am not sure that it's recommended to use action in code, but, if it's needed, you can do this (in C# sorry): 1) Create a new action class (the goal is just to be able to call 'Invoke' which is protected): public class MyMeasureAction : MeasureAction
{
public void Execute()
{
Invoke(null);
}
} 2) Call this class when you want to activate the action:
private void Measure_Click(object sender, System.Windows.RoutedEventArgs e)
{
MyMeasureAction m = new MyMeasureAction();
m.MeasureMode = MeasureAction.Mode.Polygon;
m.AreaUnit = AreaUnit.SquareKilometers;
m.DisplayTotals = true;
m.FillSymbol = DefaultFillSymbol;
m.DistanceUnit = DistanceUnit.Meters;
m.Attach(MyMap);
m.Execute();
}
/Dominique
... View more
05-06-2010
06:17 AM
|
0
|
0
|
1054
|
|
POST
|
Is your base layer a DynamicMapServiceLayer, a TiledMapServiceLayer, a FeatureLayer ? If your base layer is TiledMapServiceLayer, it means that the tiles are stored on the server and have to be updated after changing the data. /Dominique
... View more
05-03-2010
08:23 AM
|
0
|
0
|
960
|
|
POST
|
You can initialize the MinimumResolution of the map with a low value. /Dominique
... View more
05-03-2010
03:51 AM
|
0
|
0
|
546
|
|
POST
|
The Minimum/Maximum Resolutions of the map are initialized automatically from the tiled layers, but you can override these values by your own values without adding a dummy tiled layer. /Dominique
... View more
05-03-2010
03:45 AM
|
0
|
0
|
1039
|
|
POST
|
Might be a bad initialization of the ItemsSource. When the selection changes in the combo box, is the ItemsSource well initialized ? (IdentifyDetailsDataGrid.ItemsSource = _dataItems[index].Data; ) /Dominique
... View more
05-03-2010
03:42 AM
|
0
|
0
|
311
|
|
POST
|
You are right the '5' represents the layer ID. The mouse over and mouse click events to produce maptips are managed by the maptip widget, so you don't have to worry about that. After changing the Url, do you get some features displayed in your graphic layer? /Dominique
... View more
05-03-2010
03:25 AM
|
0
|
0
|
397
|
|
POST
|
You can decrease the MinimumResolution parameter but when the resolution is too low you'll get no data coming from the TiledMapService. /Dominique
... View more
05-03-2010
03:01 AM
|
0
|
0
|
1041
|
| 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
|