|
POST
|
You are right. I just noticed that in my XAML file, the binding of GraphicsLayer was done by XAML instead of code:
<Canvas HorizontalAlignment="Left" VerticalAlignment="Top" >
<esri:MapTip x:Name="MyMapTip" BorderBrush="#99000000" GraphicsLayer="{Binding Layers[MyGraphicsLayer], ElementName=MyMap}"
BorderThickness="1" Title="State Info" VerticalOffset="10"
HorizontalOffset="10" Background="#DDFFFFFF" />
</Canvas>
Probably a test I did some time ago. It's why I didn't need any code. I attach my xaml file to be sure I don't forget anything else (or you can also keep the binding by code as it was in the sample). Sorry for the confusion
... View more
11-05-2010
10:23 AM
|
0
|
0
|
2874
|
|
POST
|
Can you zip up your project with your working code using my service and attach it here? I tried the feature layer, and the maptip does not show, but the features do. I am pulling my hair out wondering what the problem is. I was testing with the interactive samples that you can download by the right top icon of this page : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm Then you have to change the MaptipWidget.xaml file in order to declare your feature layer.
<esri:Map x:Name="MyMap" Background="White" Extent="-130,10,-70,60">
<esri:ArcGISTiledMapServiceLayer ID="BaseMapLayer"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer" />
<esri:FeatureLayer ID="MyGraphicsLayer" Mode="Snapshot" OutFields="*"
Url="http://irnrgis.tamu.edu/ArcGIS/rest/services/Test/Trims/MapServer/0" />
</esri:Map>
�?? and that's it, you should get something like the screenshot I posted a little time ago.
... View more
11-05-2010
08:49 AM
|
0
|
0
|
2874
|
|
POST
|
I have tested with the code I gave and with your service and it's working... So there is probably something else not working in your project but I would need more info to figure out where the issue could be. Note again that using a feature layer would be much easier:)
... View more
11-05-2010
06:53 AM
|
0
|
0
|
2874
|
|
POST
|
Compared to the SDK sample, you have to take care of 2 points: 1) the spatial reference of your service is probably not the same than the map spatial reference. So you have to initialize it by something like :
ESRI.ArcGIS.Client.Tasks.Query query = new ESRI.ArcGIS.Client.Tasks.Query()
{
Geometry = new ESRI.ArcGIS.Client.Geometry.Envelope(-180, 0, 0, 90) { SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(4326) },
OutSpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(4326),
ReturnGeometry = true
};
query.OutFields.Add("*");
2) Your geometry is Point instead of Polygon so you have to initialize the symbol with a marker symbol instead of a fill symbol:
feature.Symbol = LayoutRoot.Resources["MarkerSymbol"] as Symbol;
That being said, the easiest way is to use a feature layer which is doing this work for you without any code(and which is using the symbology defined at server side).
<esri:FeatureLayer Mode="Snapshot" OutFields="*"
Url="http://irnrgis.tamu.edu/ArcGIS/rest/services/Test/Trims/MapServer/0" />
... View more
11-05-2010
06:25 AM
|
0
|
0
|
2874
|
|
POST
|
The trick is to initialize the spatialreference property of the IdentifyParameters. Something like:
ESRI.ArcGIS.Client.Tasks.IdentifyParameters identifyParams = new IdentifyParameters()
{
Geometry = clickPoint,
MapExtent = map.Extent,
Width = (int)map.ActualWidth,
Height = (int)map.ActualHeight,
LayerOption = LayerOption.visible,
SpatialReference = map.SpatialReference
};
... View more
11-05-2010
12:57 AM
|
0
|
0
|
1401
|
|
POST
|
In the Release Canditate available here : http://help.arcgis.com/en/webapi/silverlight/2.1/ , there is a new Legend control which hopefully will do what you are expecting.
... View more
11-04-2010
12:52 PM
|
0
|
0
|
1169
|
|
POST
|
Can Feature layer be identified? No, the identify task is not working with feature layers. As the features are loaded at the client side, you don't need to indentify the features ('Identify' is working with the server). Instead you can use a maptip to display infos about features. But my mapservice layers and feature service layers failed to identify. It should work with mapservice layers. What is exactly your issue?
... View more
11-04-2010
12:47 PM
|
0
|
0
|
1401
|
|
POST
|
This issue should be fixed in the Release Canditate available here : http://help.arcgis.com/en/webapi/silverlight/2.1/
... View more
11-04-2010
12:39 PM
|
0
|
0
|
1647
|
|
POST
|
I don't know where are coming your feature from, but if it's coming from a Query you can set the parameter 'OutSpatialReference' in order to get geometries in geographical coordinates (WKID=4326). If this is not possible, you might have to project the geometry, the easiest way being by a geometry service.
... View more
11-03-2010
08:45 AM
|
0
|
0
|
1634
|
|
POST
|
A first glance your code looks good. I suggest that: 1) you verify that your service is working well by testing the 'Find' url : <mapServiceUrl>/Find Example of Url with ArcGISServiceOnLine : http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/Find 2) use fiddler to look at the requests sent by your silverlight application. Hopefully this will give a clue.
... View more
11-03-2010
08:19 AM
|
0
|
0
|
2162
|
|
POST
|
Try by setting the spatial reference of the geometry: fs.Features[0].Geometry.SpatialReference = _Map.SpatialReference;
_Map.ZoomTo(fs.Features(0).Geometry)
... View more
11-03-2010
08:07 AM
|
0
|
0
|
1634
|
|
POST
|
It might be a spatial reference issue. 'ZoomTo' method is expecting a geometry in the same spatial reference than the map. What is the spatial reference of your feature? You might also find some infos in this thread: http://forums.arcgis.com/threads/15209-How-to-zoom-in-a-selected-feature
... View more
11-03-2010
08:00 AM
|
0
|
0
|
1634
|
|
POST
|
Hi Anastasia, Instead of creating a GP tool, it could be easier to use a spatial query. Here is a sample of a spatial query based on a geometry drawn interactively: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SpatialQuery Here is a sample of a query based on attributes: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AttributeQuery It's also possible to combine these 2 types of query. If, for any reason, you need a GP tool, I think the closest sample is the 'ClipFeatures' sample which is returning all features within a buffer around a line: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ClipFeatures
... View more
11-03-2010
07:49 AM
|
0
|
0
|
1608
|
|
POST
|
Per your post, I should remove this piece of code and then use public Map Map { ... } Is it right? If so, how can I define these graphicslayers? Thanks. No, sorry I was not clear enough. You can keep the definition of your map and its layer in XAML but you have to bind the map property of your control to this map defined in XAML.
<local:ClosestFacilityControl x:Name="MyClosedFacility" Visibility="Collapsed"
Height="240" Width="440" Canvas.Left="306" Canvas.Top="140"
Map="{Binding ElementName=_Map}" />
'Map' being the name of your dependency property defined by code and '_Map' the name of your map defined in XAML
... View more
10-28-2010
07:43 AM
|
0
|
0
|
2037
|
|
POST
|
You can change the labels of a bing map by using the Culture property of the TileLayer. For example:
<bing:TileLayer ID="BingLayer" LayerStyle="Road" Visible="True" ServerType="Production" Culture="fr-FR"
Token="{StaticResource BingKeyString}" />
gives labels in french. I am not sure there is a chinese version at this time. I found this Microsoft link giving the possible cultures: http://msdn.microsoft.com/en-us/library/cc981048.aspx
... View more
10-28-2010
07:30 AM
|
0
|
0
|
1707
|
| 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
|