POST
|
You have to initialize the LayerIds property of your identifyParameter with the list of currently visible layers. The confusion is coming from the 'visible' value of the LayerOption. This option means 'identify the layers visible in the map service' (i.e the layers visible before you turned on/off some layers by code). /Dominique
... View more
04-28-2010
02:03 AM
|
0
|
0
|
179
|
POST
|
With the 'address to location' sample, you can use 'centerAndZoom' instead of ZoomToResolution this way: //if (_firstZoom)
//{
// MyMap.ZoomToResolution(MyMap.Resolution / 6, pt);
// _firstZoom = false;
//}
//else
// MyMap.PanTo(pt);
centerAndZoom(MyMap, pt, MyMap.MinimumResolution * 4);
This will give good results. /Dominique
... View more
04-27-2010
09:42 AM
|
0
|
0
|
315
|
POST
|
After removing the dust from my student geometry books, I eventually got a method which centers AND pans to a point. private void centerAndZoom(ESRI.ArcGIS.Client.Map map, ESRI.ArcGIS.Client.Geometry.MapPoint mapPoint, double resolution)
{
double ratio = 1.0;
if (map.Resolution != 0.0)
ratio = resolution / map.Resolution;
if (ratio == 1.0)
map.PanTo(mapPoint);
else
{
ESRI.ArcGIS.Client.Geometry.MapPoint mapCenter = map.Extent.GetCenter();
double X = (mapPoint.X - ratio * mapCenter.X) / (1 - ratio);
double Y = (mapPoint.Y - ratio * mapCenter.Y) / (1 - ratio);
map.ZoomToResolution(resolution, new ESRI.ArcGIS.Client.Geometry.MapPoint(X, Y));
}
} /Dominique
... View more
04-27-2010
05:23 AM
|
0
|
0
|
315
|
POST
|
Looks like there is a small issue in the sample because the first time the user selects an address, it's calling ZoomToResolution but this method is not supposed to center on the given point. If we try calling successively ZoomToResolution + PanTo, we run into trouble because these methods are asynchronous. There is already a thread about this issue (without definitive solution) http://forums.arcgis.com/threads/2269-Zoom-and-Pan-with-Address-locator Dominique
... View more
04-27-2010
03:11 AM
|
0
|
0
|
315
|
POST
|
Define the value of the renderer as Int32. xmlns:sys="clr-namespace:System;assembly=mscorlib"
........
<esri:UniqueValueRenderer.Infos>
<esri:UniqueValueInfo Symbol="{StaticResource Line_Rood_Dik}" >
<esri:UniqueValueInfo.Value>
<sys:Int32>0</sys:Int32>
</esri:UniqueValueInfo.Value>
</esri:UniqueValueInfo>
<esri:UniqueValueInfo Symbol="{StaticResource Line_Rood_Dik}" >
<esri:UniqueValueInfo.Value>
<sys:Int32>1</sys:Int32>
</esri:UniqueValueInfo.Value>
</esri:UniqueValueInfo>
.......
</esri:UniqueValueRenderer.Infos> /Dominique
... View more
04-22-2010
06:53 AM
|
0
|
0
|
120
|
POST
|
You might use a custom line symbol and apply a TranslateTransform to this custom symbol. Something like : <esri:LineSymbol x:Key="TranslatedLineSymbol">
<esri:LineSymbol.ControlTemplate>
<ControlTemplate>
<Grid>
<Grid.RenderTransform>
<TranslateTransform X="5" Y="-5" />
</Grid.RenderTransform>
<Path x:Name="Element" Stroke="Blue" StrokeThickness="1" />
</Grid>
</ControlTemplate>
</esri:LineSymbol.ControlTemplate>
</esri:LineSymbol> /Dominique
... View more
04-21-2010
11:46 PM
|
0
|
0
|
451
|
POST
|
An OverviewMap shows one layer which is given by the layer property of the OverviewMap. This layer can be set by code or by XAML and doesn't need to be the same than the layers in the main map. <esriToolkit:OverviewMap x:Name="OVMap" Margin="0"
MaximumExtent="-180,-90,180,90" Map="{Binding ElementName=Map}">
<esriToolkit:OverviewMap.Layer>
<esri:ArcGISTiledMapServiceLayer Url="http://server.arcgisonline.com/ArcGIS/rest/service/ESRI_StreetMap_World_2D/MapServer" />
</esriToolkit:OverviewMap.Layer>
</esriToolkit:OverviewMap> So I guess you could set the overviewmap layer to your graphic layer. /Dominique
... View more
04-21-2010
01:11 AM
|
0
|
0
|
145
|
POST
|
Starting from a map application template, you can just add the code in MainPage.xaml.cs. Example of code displaying the earthquakes in california since 1950 as DynamicMapServiceLayer: public MainPage()
{
InitializeComponent();
System.Collections.ObjectModel.ObservableCollection<LayerDefinition> layerDefinitions;
ArcGISDynamicMapServiceLayer myMapServiceLayer = Map.Layers["California"] as ArcGISDynamicMapServiceLayer;
layerDefinitions = new System.Collections.ObjectModel.ObservableCollection<LayerDefinition>();
LayerDefinition layerDefinition = new LayerDefinition();
layerDefinition.LayerID = 2;
layerDefinition.Definition = "YEAR > 1950";
layerDefinitions.Add(layerDefinition);
myMapServiceLayer.VisibleLayers = new int[] { 2 };
myMapServiceLayer.LayerDefinitions = layerDefinitions;
} The MainPage.xaml must also be completed with the declaration of the dynamic service: <esri:ArcGISDynamicMapServiceLayer ID="California" Url="http://serverapps.esri.com/ArcGIS/rest/services/California/MapServer" /> Note that this example is 'XAMLable'. Yo can get the same result without any C# code by modifying the .xaml file only:
<esri:ArcGISDynamicMapServiceLayer ID="California"
Url="http://serverapps.esri.com/ArcGIS/rest/services/California/MapServer"
VisibleLayers="2" >
<esri:ArcGISDynamicMapServiceLayer.LayerDefinitions>
<esri:LayerDefinition LayerID="2" Definition="YEAR > 1950" />
</esri:ArcGISDynamicMapServiceLayer.LayerDefinitions>
</esri:ArcGISDynamicMapServiceLayer> /Dominique
... View more
04-17-2010
02:38 AM
|
0
|
0
|
160
|
POST
|
The problem is that ArcGISTiledMapServiceLayer is a DependencyObject and not a FrameworkElement. With Silverlight 3, a property must be a FrameworkElement dependency property in order to be a binding target. Your code should work by reversing the binding: <Slider x:Name="slider1" HorizontalAlignment="Stretch" VerticalAlignment="Top" Maximum=".7" LargeChange="0.1" SmallChange="0.05" Minimum=".1"
Value="{Binding ElementName=map1, Path=Layers[1].Opacity, Mode=TwoWay}" />
<esri:Map Background="White" Grid.Row="1" HorizontalAlignment="Stretch" Margin="0,0,0,0" Name="map1" VerticalAlignment="Stretch" >
<esri:Map.Layers>
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
<esri:ArcGISTiledMapServiceLayer ID="TopoMap" Opacity="0.1" Url="http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer" />
</esri:Map.Layers>
</esri:Map> Dominique
... View more
04-16-2010
01:18 AM
|
0
|
0
|
184
|
POST
|
The LayerDefinitions property (ArcGISDynamicMapServiceLayer class) allows you to define queries by sublayer of your service. Example : layerDefinitions = new System.Collections.ObjectModel.ObservableCollection<LayerDefinition>();
LayerDefinition layerDefinition = new LayerDefinition();
layerDefinition.LayerID = 0;
layerDefinition.Definition = "subtype = 2";
layerDefinitions.Add(layerDefinition);
myMapServiceLayer.LayerDefinitions = layerDefinitions;
Dominique
... View more
04-15-2010
04:06 AM
|
0
|
0
|
160
|
POST
|
Difference between AddRange and Add: - Add method is adding one field e.g. : Add("OBJECTID") - AddRange is adding a list of fields coming from an enumerable : AddRange(myListOfFields) Return all fields : - should be 'query.OutFields.Add("*")' Use the Field alias names when displaying results in a maptip : - I don't think there is any out of the box maptip control which displays alias names - But in the FeatureSet returned by the query, there is FieldAliases property giving a dictionary of <name, alias>. This dictionary could be used to develop your own maptip control. Dominique
... View more
04-12-2010
05:55 AM
|
0
|
0
|
117
|
POST
|
Hi José, From version 10.0, a schematic layer is a composite layer containing standard feature layers (with layer definition queries allowing to see only the schematic objects of one particular diagram). If you publish an mxd containing a schematic diagram, you can access the schematic sublayers with the same WEB API than standard feature layers. So accessing ONE diagram is quite standard. The point, that needs a particular attention, happens if you want to access many diagrams with the same map service. In this case you have: 1) to publish a map without any definition queries (it means that you will see all diagrams overlapping) 2) to manage the definiton query with the web API Dominique Note that is only true from 10.0. With previous versions, the diagrams had to be exported in features before being published.
... View more
04-12-2010
05:09 AM
|
0
|
0
|
344
|
POST
|
If you are only applying ZoomToResolution (the first time in your code), you don't get the expected result because the argument of this method is the center to zoom around (e.g. the fix point). It's not the expected center of the map. If you place the PanTo code with ZoomToResolution in the first half of the IF statement, you run into an issue with these 2 asynchronous methods that overlap (the pan begins while the zoomtoresolution is not over). A workaround could be to reexecute PanTo after a delay: Map.ZoomToResolution(MyMap.MaximumResolution / 10, pt); Map.PanTo(pt); DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(500); timer.Tick += new EventHandler((s, eventArgs) => { timer.Stop(); Map.PanTo(pt); }); timer.Start(); But the result is unaesthetic. Another solution would be to use the 'ZoomTo' method, but you will have to expand the point to get the geometry corresponding to the expected resolution (--> not that easy calculation) There are likely others solutions, but I have no more clue. Dominique
... View more
04-12-2010
12:29 AM
|
0
|
0
|
224
|
POST
|
The ItemsSource of a chart needs to be an Enumerable (e.g a collection). Then the implicit binding to define DependentValue and IndependentValue is one item of this collection. In your case, depending of the graphical expected result, you could need either 3 collections of one item, or one collection of 3 items. Since it's probably better you to implement your own collection, you can also use an existing Collection such as a Listbox. In the resources : . declare one Listbox by serie . add the members of the serie as ListBoxItem In the chart: . bind ItemsSource to Items property of your Listbox (Listbox is not Enumerable by itself --> need Items) . bind DependentValue to content property of the ListboxItems See code behind and attached result. <esri:FeatureLayer.MapTip> <Border Background="{StaticResource CommonBackgroundBrush}"> <Border.Resources> <ListBox x:Name="Telephones"> <ListBoxItem Content="{Binding Converter={StaticResource MyDictionaryConverter}, ConverterParameter=TEL_TOT}" /> <!--with SL4 : {Binding [TEL_TOT]}--> </ListBox> <ListBox x:Name="Mobiles"> <ListBoxItem Content="{Binding Converter={StaticResource MyDictionaryConverter}, ConverterParameter=MOB_TOT}" /> <!--with SL4 : {Binding [MOB_TOT]}--> </ListBox> <ListBox x:Name="Internets"> <ListBoxItem Content="{Binding Converter={StaticResource MyDictionaryConverter}, ConverterParameter=INT_TOT}" /> <!--with SL4 : {Binding [INT_TOT]}--> </ListBox> </Border.Resources> <chartingToolkit:Chart Title="Communication"> <chartingToolkit:Chart.Series> <chartingToolkit:ColumnSeries Title="Telephone Users" DependentValueBinding="{Binding Content}" ItemsSource="{Binding Source={StaticResource Telephones}, Path=Items}" /> <chartingToolkit:ColumnSeries Title="Mobile Users" DependentValuePath="Content" ItemsSource="{Binding Source={StaticResource Mobiles}, Path=Items}" /> <chartingToolkit:ColumnSeries Title="Internet Users" DependentValuePath="Content" ItemsSource="{Binding Source={StaticResource Internets}, Path=Items}" /> </chartingToolkit:Chart.Series> </chartingToolkit:Chart> </Border> </esri:FeatureLayer.MapTip> Dominique
... View more
04-09-2010
01:41 AM
|
0
|
0
|
882
|
Title | Kudos | Posted |
---|---|---|
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 | |
1 | 08-23-2021 03:47 AM |
Online Status |
Offline
|
Date Last Visited |
07-28-2022
12:26 PM
|