|
POST
|
You can do something like this. But you might also want to consider click tolerance besides checking for same graphic and elapsed time since last click.
Graphic graphic;
TimeSpan elapsedTime;
DateTime? startTime;
private void FeatureLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e)
{
if (graphic == null || graphic != e.Graphic)
{
graphic = e.Graphic;
startTime = DateTime.Now;
}
else if (graphic == e.Graphic && startTime.HasValue)
{
elapsedTime = DateTime.Now.Subtract(startTime.Value);
if (elapsedTime.TotalMilliseconds < 500)
{
//double click happened
}
graphic = null;
startTime = null;
}
}
... View more
05-08-2012
09:46 AM
|
0
|
0
|
882
|
|
POST
|
You can create your own FlareClusterer and override OnCreateGraphic(). You can try the following code: public class MyFlareClusterer : FlareClusterer { protected override Graphic OnCreateGraphic(GraphicCollection cluster, ESRI.ArcGIS.Client.Geometry.MapPoint point, int maxClusterCount) { if (cluster != null) { if (cluster.Any(g => g.Selected)) { var graphics = new GraphicCollection(cluster.Where(g => g.Selected)); return base.OnCreateGraphic(graphics, point, maxClusterCount); } else { foreach (var g in cluster) return g; } } return null; } } I'm not sure if you wanted to refresh the cluster when selection is changed, but if you are using Editor. You can trigger clustering by subscribing to EditCompleted event. private void Editor_EditCompleted(object sender, Editor.EditEventArgs e) { if(e.Action == Editor.EditAction.Select) { var l = MyMap.Layers["CensusDemographics"] as FeatureLayer; l.Clusterer.ClusterGraphicsAsync(l.Graphics, MyMap.Resolution); } } You can look at tweak this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerSelection. Remove the ArcGISDynamicLayer, change FeatureLayer.Mode to OnDemand, remove the "Renderer="{StaticResource YellowMarkerRenderer}"" and add the following: <esri:FeatureLayer.Clusterer> <local:MyFlareClusterer FlareBackground="Yellow" FlareForeground="#99000000" MaximumFlareCount="20" Radius="10" Gradient="{StaticResource BlueGradient}" /> </esri:FeatureLayer.Clusterer> Under Resources, you can set your gradient. <LinearGradientBrush x:Key="BlueGradient" MappingMode="RelativeToBoundingBox" > <GradientStop Color="#990011FF" Offset="0"/> <GradientStop Color="#990055FF" Offset="0.25"/> <GradientStop Color="#990099FF" Offset="0.5"/> <GradientStop Color="#9900CCFF" Offset="0.75"/> <GradientStop Color="#9900FFFF" Offset="1"/> </LinearGradientBrush>
... View more
05-08-2012
09:11 AM
|
0
|
0
|
1556
|
|
POST
|
You can run Fiddler along with this SDK sample: http://resourcesbeta.arcgis.com/en/help/silverlight-api/samples/start.htm#ExportWebMap. Notice the Web_Map_JSON that is sent to the print tool includes the layers and map's extent, scale, etc.
... View more
05-07-2012
09:25 AM
|
0
|
0
|
1419
|
|
POST
|
I see. If the selection is not based on geometry but rather through a query. I would still recommend FeatureLayer if you plan to use AttachmentEditor, FeatureDataForm, FeatureDataGrid because FeatureLayer keeps service metadata information (i.e. Fields, Domains, etc). It may be a good idea to make it OnDemand mode too if you're only concerned about displaying features within map's current extent. You can still update FeatureLayer.Where clause and call FeatureLayer.Update(), this will re-query the service. If you plan to use Snapshot mode, you may hit service limit but in this case if all features are on the client, you can use Linq query instead to filter the features on the layer. This may help you decide which mode to use: http://help.arcgis.com/en/webapi/silverlight/help/index.html#/Feature_layers/016600000015000000/
... View more
05-07-2012
09:11 AM
|
0
|
0
|
1841
|
|
POST
|
If you need to execute IdentifyTask on multiple services and need to keep track which service returned in the ExecuteCompleted, you can use user token parameter for that.
identifyTask.ExecuteAsync(identifyParameters, identifyTask.Url);
}
void identifyTask_ExecuteCompleted(object sender, IdentifyEventArgs e)
{
var serviceUrl = (string)e.UserState;
}
... View more
05-04-2012
05:23 PM
|
0
|
0
|
624
|
|
POST
|
You can accomplish this by using PrintTask in our API. While you will not have access to the Webmap_JSON, this GP parameter is created for you. See this SDK sample: http://resourcesbeta.arcgis.com/en/help/silverlight-api/samples/start.htm#ExportWebMap
... View more
05-04-2012
05:17 PM
|
0
|
0
|
1419
|
|
POST
|
You can set the layer's Minimum and Maximum Resolution. This will change its visibility if Map.Resolution is not within this range.
... View more
05-04-2012
05:14 PM
|
0
|
0
|
451
|
|
POST
|
Have you looked at this SDK sample? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SelectGraphics or this? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#CustomSymbols. You can highlight the graphic by providing VisualStates (MouseOver).
... View more
05-04-2012
05:07 PM
|
0
|
0
|
921
|
|
POST
|
It is okay to use OnDemand mode. FeatureLayer.Graphics may be empty because UpdateCompleted event is not yet raised. You can subscribe to this and have the following event handler. Note that in OnDemand mode, this will be raised every time your map extent changes so if you want to perform the delete once, you need to unhook from this event.
private void FeatureLayer_UpdateCompleted(object sender, EventArgs e)
{
var l = sender as FeatureLayer;
if (l.Graphics != null)
{
var graphics = l.Graphics.Where(g => (string)g.Attributes["STAGE"] == "tropical depression").ToList();
foreach (var g in graphics)
l.Graphics.Remove(g);
}
}
... View more
05-04-2012
05:01 PM
|
0
|
0
|
1627
|
|
POST
|
You can use FeatureLayer in SelectionOnly mode. You can try this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerSelection. Selection updates the GraphicCollection of FeatureLayer. This way you need not have all 2000 points in your layer.
... View more
05-04-2012
04:43 PM
|
0
|
0
|
1841
|
|
POST
|
This seems related to this thread: http://forums.arcgis.com/threads/52488-trouble-binding-layer-URL-property-in-2.2-API
... View more
05-01-2012
09:09 AM
|
0
|
0
|
563
|
|
POST
|
You can probably check collision by using Extent.Intersects() and setting Graphic.SetZIndex(index) or stack order of the graphic in the collection.
... View more
05-01-2012
08:51 AM
|
0
|
0
|
1378
|
|
POST
|
Sorry for the confusion. I meant v3.0 Pre-Release already have the fix. As for your concern about moving to Silverlight 5, we are currently considering making v3.0 available for Silverlight 4 as well.
... View more
04-25-2012
09:16 AM
|
0
|
0
|
1138
|
|
POST
|
You can subscribe to Map.PropertyChanged (e.PropertyName == "SpatialReference") or Map.Layers.LayersInitialized event.
... View more
04-25-2012
09:09 AM
|
0
|
0
|
1906
|
|
POST
|
Yes, you are correct. Mixed geometry types are not supported. You can quickly check this by running Fiddler. When it makes a request to GeometryService, you can check "geometries" property if its mixed or if separate requests are made per type.
... View more
04-25-2012
08:59 AM
|
0
|
0
|
984
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 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 |
2 weeks ago
|