|
POST
|
When you put breakpoints in debug-mode, does InitializeMeasureAction() and Execute() get hit? When do you invoke MeasureAction.Execute() - through button click, mouse event?
... View more
01-12-2011
02:24 PM
|
0
|
0
|
2193
|
|
POST
|
The FeatureLayer's Renderer trumps FeatureSymbol. Since the service already defines a Renderer, the FeatureSymbol is ignored. The only way you can override the Renderer defined by the service is to create your own renderer. For example: Under Resources...
<esri:SimpleRenderer x:Key="MyRenderer">
<esri:SimpleRenderer.Symbol>
<esri:SimpleMarkerSymbol Color="Red" Style="Circle" Size="10"/>
</esri:SimpleRenderer.Symbol>
</esri:SimpleRenderer>
FeatureLayer..
<esri:FeatureLayer Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0"
Renderer="{StaticResource MyRenderer}"/>
... View more
01-12-2011
01:51 PM
|
0
|
0
|
1710
|
|
POST
|
This constructor takes any two MapPoints (p1, p2) that will define 2 corners of your envelope. It does not matter which corner they come from. It would make sense if these two points would form a diagonal. The constructor will set the XMin, YMin, XMax, YMax properties accordingly by getting the Min or Max of two points.
... View more
01-12-2011
01:39 PM
|
0
|
0
|
538
|
|
POST
|
I just tried this sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#UtilityActions on a touch-enabled device and it works fine for me. I'm able to draw the polyline by tapping the map to mark my vertices. Are you seeing something different when you use this sample?
... View more
01-12-2011
01:31 PM
|
0
|
0
|
2193
|
|
POST
|
Oh I see why that is happening now. MouseClick is an event from our API, which we only raise when triggered by mouse. Can you use MouseLeftButtonDown or MouseLeftButtonUp instead of MouseClick? Alternatively, you can refactor the code you have inside MouseClick eventhandler to a method that you can call inside MapGesture eventhandler. Similar to what you have but I imagine that refactored code will only need MapPoint as parameter.
... View more
01-12-2011
12:48 PM
|
0
|
0
|
2193
|
|
POST
|
Are you saying that when you tap on the map, MouseClick does not fire? Touch promotes mouse events as discussed here http://msdn.microsoft.com/en-us/library/dd894494(v=vs.95).aspx (see "Promotion to Mouse Events" section) You can subscribe to both touch and mouse events but there is a risk of "Dualism". I don't think there is a need to raise MouseClick() inside MapGesture eventhandler.
... View more
01-12-2011
11:49 AM
|
0
|
0
|
2193
|
|
POST
|
It's hard to tell where it could have failed but the error comes from the service. What you can do is run Fiddler with your SL app. It might be able to tell you which webrequest failed and what parameters where used.
... View more
01-12-2011
09:18 AM
|
0
|
0
|
691
|
|
POST
|
I assume that scoutingEvents is your FeatureLayer. Few comments: Graphics in FeatureLayer will never be null and cannot be changed once the layer starts to initialize. This is populated based on the features returned by the feature service. Therefore you don't need these lines of code. if (scoutingEvents.Graphics == null) { scoutingEvents.Graphics = new GraphicCollection(); } You can add to the FeatureLayer Graphics after the layer is Initialized. if(scoutingEvents.IsInitialized){ //insert code below here } Graphic newGraphic = new Graphic() { Symbol = markerSymbol, Geometry = mercator.FromGeographic(newPoint) }; newGraphic.Attributes.Add("ScoutingEventsId", 1); newGraphic.Attributes.Add("Title", Title); newGraphic.Attributes.Add("Description", Description); scoutingEvents.Graphics.Add(newGraphic); ScoutingEventsId, Title, Description must be the same field names in the feature service and the type must match.
... View more
01-11-2011
03:12 PM
|
0
|
0
|
691
|
|
POST
|
In that SDK Sample, create a symbol template similar to "SelectRectangleMarkerSymbol". Notice how it defines SelectionStates, a ColorAnimation is done on Selected state. If you go to the Live view, you can see that the outline of the rectangle changes from blue to blinking red when selected and back to blue when not selected. You need to create something similar to distinguish the selected graphic. In the SDK Sample, GraphicsLayer_MouseLeftButtonDown is there to allow you to select the graphic on mouse left button down. You cannot use the same event handler for the ListBox MouseLeftButtonDown event because they will have different EventArgs. Since you want to select the graphic based on the selection on the ListBox, you can use the ListBox SelectionChanged event. I don't know which solution you end up using so I cannot tell what type your ListBox contains. If it is a Graphic then you can type cast as such and call Select()/UnSelect().
Private Sub imageList_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
For Each item As var In e.RemovedItems
Dim g As Graphic = TryCast(item, Graphic)
g.UnSelect()
Next
For Each item As var In e.AddedItems
Dim g As Graphic = TryCast(item, Graphic)
g.[Select]()
Next
End Sub
... View more
01-11-2011
01:41 PM
|
0
|
0
|
863
|
|
POST
|
Do you set the symbol's ControlTemplate inside GetSymbol()? I remember the original issue when you needed to calculate the offsets based on the space occupied by the TextBlock that contains an attribute value.
... View more
01-11-2011
10:35 AM
|
0
|
0
|
1314
|
|
POST
|
Can you share your code for symbol ControlTemplate or the code that causes the Binding warning?
... View more
01-11-2011
10:28 AM
|
0
|
0
|
1314
|
|
POST
|
In your earlier post, you mentioned that the FeatureLayer has the following properties DisableClientCaching = true AutoSave = False OutFields = * Mode = OnDemand Where = "OBJECTID = 0" I meant to say update this Where clause to Where="REMOVED is null" so that you would not have to change it on Button Click. Since the value of this field is changing, you need to re-query the layer by calling Update() on EndSaveEdits. An issue you might encounter by calling Update() inside EndSaveEdits event handler is that any attribute or geometry change, add or delete feature will re-query the layer. So maybe you can set a boolean when the attribute that changed is REMOVED. For example:
private void FeatureLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
{
removed = false;
e.Graphic.AttributeValueChanged -= Graphic_AttributeValueChanged;
this.MyFeatureDataForm.GraphicSource = e.Graphic;
e.Graphic.AttributeValueChanged += Graphic_AttributeValueChanged;
}
bool removed = false;
void Graphic_AttributeValueChanged(object sender, Graphics.DictionaryChangedEventArgs e)
{
if (e.Key == "REMOVED") removed = true;
}
private void FeatureLayer_EndSaveEdits(object sender, Tasks.EndEditEventArgs e)
{
if (removed)
(sender as FeatureLayer).Update();
}
... View more
01-11-2011
09:29 AM
|
0
|
0
|
1853
|
|
POST
|
ArcGISDynamicMapServiceLayer does not give you the fields for its sublayers. You can create a FeatureLayer for every sublayer, if you want or parse the JSON to get "Fields" information. FeatureLayer has LayerInfo.Fields property http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureService.FeatureLayerInfo~Fields.html. Field contains the following information http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Field_members.html. Note however that the layer need to be initialized before the LayerInfo will have a value.
... View more
01-11-2011
09:25 AM
|
0
|
0
|
1259
|
|
POST
|
Are you saying FeatureLayers from 9.3.1 service renders fine, while FeatureLayers from 10 service does not? What version of the API are you using? You need v2.0 or higher when working with Server 10. If the FeatureService is set up correctly, you will find that there is "DrawingInfo" section when you visit the URL from your web browser. Can you share that with us? For example in this FeatureService: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0 It has the following DrawingInfo: Drawing Info: Renderer: Unique Value Renderer: Field 1: ftype Field 2: Field 3: Field Delimiter: , Default Symbol: Simple Marker Symbol: Style: esriSMSCircle, Color: [138, 126, 0, 255], Size: 8, Angle: 0, XOffset: 0, YOffset: 0 Outline Color: [0, 0, 0, 255], Width: 1 Also, be sure to check that the service contains features. When you query the layer from the web browser where "1=1", it return some results.
... View more
01-11-2011
09:11 AM
|
0
|
0
|
1666
|
|
POST
|
Oh I'm sorry I got it confused with the FindTask solution. Remove "Feature." in the Binding statements. Text="{Binding Attributes[CITY_NAME], StringFormat='City Name: \{0\}'}" Also, in your code-behind you don't need these lines anymore, if you are setting ItemsSource in the ExecuteCompleted. '' '' BINDING TO LIST BOX Dim resultFeaturesBinding As New Binding("LastResult") resultFeaturesBinding.Source = queryTask imageList.SetBinding(ListBox.ItemsSourceProperty, resultFeaturesBinding) To clarify: In the three solutions posted in this thread, no one solution is more correct than the other. They all work fine. You just need to tweak the Binding statements depending on the content of your ListBox. Solution 1: Bind ItemsSourceProperty as in the FindTask example Dim resultFeaturesBinding As New Binding("LastResult")
resultFeaturesBinding.Source = queryTask
imageList.SetBinding(ListBox.ItemsSourceProperty, resultFeaturesBinding) Correct Binding statement is - Text="{Binding Feature.Attributes[CITY_NAME], StringFormat='City Name: \{0\}'}" Solution 2: Set ItemsSource in the Query ExecuteCompleted event handler. imageList.ItemsSource = args.FeatureSet.Features Correct Binding statement is - Text="{Binding Attributes[CITY_NAME], StringFormat='City Name: \{0\}'}" Solution 3: Add Items as string in the Query ExecuteCompleted event handler imageList.Items.Add(resultFeature.Attributes("CITY_NAME").ToString()) Correct Binding statement is - Text="{Binding StringFormat='City Name: \{0\}'}"
... View more
01-11-2011
08:44 AM
|
0
|
0
|
1335
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|