|
POST
|
I think you have the same problem you've had as in your other posts where your map and UserControl are separate. I have already suggested creating a DependencyProperty in your UserControl so that it can have its own map source that gets set in your MainPage when you create an instance of it. You need not duplicate the contents of your map in the MainPage to your UserControl - this approach will not work, because they will be dealing with two different maps. Try to solve one problem at a time. You will see what works in one and learn from it. Good luck.
... View more
10-29-2010
09:26 AM
|
0
|
0
|
907
|
|
POST
|
Check your SL app, if you had set Cursor to anything. Be sure to set it back to Arrow or restore the cursor if you know what it was before you changed it.
... View more
10-29-2010
09:15 AM
|
0
|
0
|
548
|
|
POST
|
Sure this can be done by setting the graphic's Selected property to true. Provided your FeatureLayer is added to your map, you can do something like:
private void QueryTask_ExecuteCompleted(object sender, QueryEventArgs args)
{
FeatureSet featureSet = args.FeatureSet;
foreach (var item in featureSet.Features)
item.Selected = true;
}
The FeatureLayer itself has a Where property too you can use to filter. You can look at this sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerFiltering
... View more
10-29-2010
09:08 AM
|
0
|
0
|
560
|
|
POST
|
If you have properly defined the DependencyProperty in your ClosestFacilityControl, and have set Map property when you instantiated an instance of this control in your MainPage, you can set breakpoint at OnMapPropertyChanged and it should be hit. Also in your ClosestFacilityControl, did you remove the element binding to map for the editors?
<esri:Editor x:Key="MyBarriersEditor" LayerIDs="MyBarriersGraphicsLayer" Map="{Binding ElementName=MyMap}" />
This should be removed since the OnMapPropertyChanged will handle setting the editor's Map property.
... View more
10-29-2010
08:57 AM
|
0
|
0
|
1930
|
|
POST
|
When you see examples in C# and there's no VB equivalent available, you might want to try and use an online converter C# to VB like this one http://www.developerfusion.com/tools/convert/csharp-to-vb/ Any example with one button/image that drops down and links to a zoom tool is all I am looking for. Have you looked at the ToolBar sample?http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolBarWidget You can use a ComboBox with Image items and write code for the SelectionChanged event handler
<ComboBox VerticalAlignment="Top" HorizontalAlignment="Center" Height="55" Width="70" SelectedIndex="0" SelectionChanged="ComboBox_SelectionChanged">
<ComboBox.Items>
<Image x:Name="ZoomIn" Source="images/i_zoomin.png" Height="35" Width="35" Stretch="None"/>
<Image x:Name="ZoomOut" Source="images/i_zoomout.png" Height="35" Width="35" Stretch="None"/>
</ComboBox.Items>
</ComboBox>
I'm not really sure how your project is setup so I can't tell you how to use the KBar, MenuButton, SubButton. However you can download the SDK sample if it would be easier to view and learn the project structure that way.
... View more
10-28-2010
09:02 PM
|
0
|
0
|
1816
|
|
POST
|
Please refer to this link http://help.arcgis.com/en/webapi/silverlight/help/Installation.htm
... View more
10-28-2010
08:24 PM
|
0
|
0
|
1049
|
|
POST
|
When you go to the Interactive SDK http://esriurl.com/slsdk2 and click Download SDK on the upper right corner, you will see that there is a WPF SDK. It should have similar content except for some platform differences. There's also a sample on adding graphics in code: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AddGraphics Basically, these are equivalent: XAML:
<esri:Graphic>
<esri:MapPoint X="-80.210" Y="35.284" />
</esri:Graphic>
<esri:Graphic>
<esri:Polyline >
<esri:Polyline.Paths>
<esri:PointCollection>
<esri:MapPoint X="-118.169" Y="34.016" />
<esri:MapPoint X="-104.941" Y="39.7072" />
<esri:MapPoint X="-96.724" Y="32.732" />
<esri:MapPoint X="-87.671" Y="41.804" />
<esri:MapPoint X="-74" Y="40.68" />
</esri:PointCollection>
</esri:Polyline.Paths>
</esri:Polyline>
</esri:Graphic>
<esri:Graphic>
<esri:Polygon >
<esri:Polygon.Rings>
<esri:PointCollection>
<esri:MapPoint X="110.039" Y="-20.303" />
<esri:MapPoint X="132.539" Y="-7.0137" />
<esri:MapPoint X="153.281" Y="-13.923" />
<esri:MapPoint X="162.773" Y="-35.174" />
<esri:MapPoint X="133.594" Y="-43.180" />
<esri:MapPoint X="111.797" Y="-36.032" />
<esri:MapPoint X="110.039" Y="-20.303" />
</esri:PointCollection>
</esri:Polygon.Rings>
</esri:Polygon>
</esri:Graphic>
Graphic point = new Graphic() { Geometry = new MapPoint(-80.210, 35.284) };
PointCollection pts = new PointCollection();
pts.Add(new MapPoint(-118.169, 34.016));
pts.Add(new MapPoint(-104.941, 39.7072));
pts.Add(new MapPoint(-96.724, 32.732));
pts.Add(new MapPoint(-87.671, 41.804));
pts.Add(new MapPoint(-74, 40.68));
Polyline polyline = new Polyline();
polyline.Paths.Add(pts);
Graphic line = new Graphic() { Geometry = polyline };
pts = new PointCollection();
pts.Add(new MapPoint(110.039, -20.303));
pts.Add(new MapPoint(132.539, -7.0137));
pts.Add(new MapPoint(153.281, -13.923));
pts.Add(new MapPoint(162.773, -35.174));
pts.Add(new MapPoint(133.594, -43.180));
pts.Add(new MapPoint(111.797, -36.032));
pts.Add(new MapPoint(110.039, -20.303));
Polygon polygon = new Polygon();
polygon.Rings.Add(pts);
Graphic area = new Graphic() { Geometry = polygon };
... View more
10-28-2010
07:48 PM
|
0
|
0
|
1388
|
|
POST
|
You can call Map.ZoomTo(Geometry geometry) to zoom to the feature's geometry. To check whether the feature's geometry is within the map's extent, you can do where env is the graphic's Geometry.Extent
private bool IsWithin(Envelope env)
{
return (env.XMin >= Map.Extent.XMin &&
env.XMax <= Map.Extent.XMax &&
env.YMin >= Map.Extent.YMin &&
env.YMax <= Map.Extent.YMax);
}
... View more
10-28-2010
07:43 PM
|
0
|
0
|
516
|
|
POST
|
I have not done this myself but this might help http://blog.roboblob.com/2010/01/26/binding-ui-events-from-view-to-commands-in-viewmodel-in-silverlight-4/ DynamicLayer is not the UIElement though, Map is - so maybe you need to change the Binding statement.
... View more
10-28-2010
07:22 PM
|
0
|
0
|
436
|
|
POST
|
Please look at these samples http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#MapTipWidget http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#GraphicsMapTip http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerMapTips
... View more
10-28-2010
07:15 PM
|
0
|
0
|
907
|
|
POST
|
You can use Where property of the Query http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Query~Where.html In this feature service, I'm able to perform query on any number of fields: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/2 Where = ftype <> 10501 and fcode <> 10501 and objectid > 9155 The FeatureLayer.LayerInfo.Fields have the following members http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Field_members.html, the field's type will help you determine how you choose what control to use (i.e. DateTimePicker).
... View more
10-28-2010
07:03 PM
|
0
|
0
|
418
|
|
POST
|
Did you add the namespace in xaml? xmlns:local="clr-namespace:YourUserControlNamespace"> and added UserControl this way? <local:ClosestFacilityControl ../>
... View more
10-28-2010
06:42 PM
|
0
|
0
|
1930
|
|
POST
|
This GraphicsLayer contain graphics? When you click on a graphic, the MouseLeftButtonDown does not get raised? I could not replicate it. Please share some code.
... View more
10-28-2010
06:12 PM
|
0
|
0
|
1142
|
|
POST
|
You can update your color and width conversion this way.
symbol.Color = Color.FromArgb(Convert.ToByte(result.color[3]), Convert.ToByte(result.color[0]), Convert.ToByte(result.color[1]), Convert.ToByte(result.color[2]));
symbol.Width = Convert.ToDouble(pts, CultureInfo.InvariantCulture) * 96 / 72; // to convert from points to pixel units
... View more
10-27-2010
12:10 PM
|
0
|
0
|
838
|
|
POST
|
Correct me if I'm wrong. You are using the MapGesture.Hold to trigger an EditVertices where you pass the graphic as the CommandParameter? If you want to use EditVertices for MapPoint, you set the CommandParameter to null (not the graphic). While EditVertices is active, any graphic you touch provided it comes from a layer that is included in the Editor, will respond to move or edit geometry. If you are to use DirectlyOver from Map.GestureEventArgs, do you provide a tap_tolerance (double) and specify the layer of interest? (Like the one below) IEnumerable<Graphic> graphics = e.DirectlyOver(TAP_TOLERANCE, new List<GraphicsLayer>() { vertexLayer }); And you say the graphics returned here are incorrect?
... View more
10-27-2010
11:54 AM
|
0
|
0
|
699
|
| Title | Kudos | Posted |
|---|---|---|
| 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 | |
| 1 | 04-05-2024 06:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-12-2026
09:38 AM
|