|
POST
|
Your map is being declared in AddMap(). Wherever the first layer is added with Map.Layers.Add(...) , attach the event handler for the Initialized event to that layer before you add it to the map. Since I can't see all your code I'm not sure where that's happening.
... View more
12-23-2010
10:48 AM
|
0
|
0
|
552
|
|
POST
|
I would place that code in the BaseLayer_Initialized event handler (first layer in your map, usually a tiled map service). There you will definitely have a reference to the map control with the spatial reference set. [HTML]<esri:Map x:Name="Map" > <esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" Initialized="baseLayer_Initialized" /> </esri:Map>[/HTML]
... View more
12-23-2010
08:07 AM
|
0
|
0
|
552
|
|
POST
|
Another addition to the Nav control; I found that the zoom slider wasn't accurately reflecting the map zoom level until I used the Nav to zoom. A quick fix for that : private static void OnMapPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
Navigation nav = d as Navigation;
Map map = e.NewValue as Map;
Map oldmap = e.OldValue as Map;
if (oldmap != null)
{
oldmap.RotationChanged -= nav.Map_RotationChanged;
oldmap.ExtentChanged -= nav.Map_ExtentChanged;
oldmap.ExtentChanging -= nav.Map_ExtentChanged;
if (oldmap.Layers != null)
oldmap.Layers.LayersInitialized -= nav.Layers_LayersInitialized;
}
if (map != null)
{
map.RotationChanged += nav.Map_RotationChanged;
map.ExtentChanged += nav.Map_ExtentChanged;
map.ExtentChanging += nav.Map_ExtentChanged;
if (map.Layers != null)
map.Layers.LayersInitialized += nav.Layers_LayersInitialized;
if (nav.TransformRotate != null)
nav.TransformRotate.Angle = map.Rotation;
//Added for cases when Map binding is created after template is applied
nav.SetupZoom();
//end correction
}
}
... View more
12-23-2010
08:02 AM
|
0
|
0
|
304
|
|
POST
|
Just wanted to share a quick and dirty fix to the Nav control's left side (mis)behavior. Just download the source from Codeplex and make the following change inside Navigation/Navigation.cs: private void RotateRing_MouseMove(object sender, MouseEventArgs e)
{
Point p = e.GetPosition(this);
double delta = (p.Y - startMousePos.Y);
//added to correct left-side drag behavior
if (p.X < this.ActualWidth / 2.0)
delta *= -1;
//end correction
startMousePos = p;
angle += delta;
SetMapRotation(angle);
}
... View more
12-23-2010
06:32 AM
|
0
|
2
|
1069
|
|
POST
|
ZoomTo() doesn't work for a MapPoint, I believe. Instead you should call ZoomToResolution() and supply the mappoint and a resolution value.
... View more
12-22-2010
06:41 PM
|
0
|
0
|
552
|
|
POST
|
Dominique, If I set RotateMap="'True" in XAML, I get a runtime exception. Am I doing something wrong?
... View more
12-14-2010
06:54 PM
|
0
|
0
|
1323
|
|
POST
|
You have 2 options: 1) Put the shapefile into the xap container, or 2) write code to download it from the server after the application loads.
... View more
12-08-2010
06:32 PM
|
0
|
0
|
1258
|
|
POST
|
Will, Regarding issue #2, are you passing a callback handler to SubmitChanges() like this:
using System.ServiceModel.DomainServices.Client;
....
domaincontext.SubmitChanges(Changes_Submitted, null);
....
private void Changes_Submitted(SubmitOperation sop)
{
if (sop.HasError)
{
ErrorWindow.CreateNew(sop.Error);
sop.MarkErrorAsHandled();
}
}
... View more
11-29-2010
10:55 AM
|
0
|
0
|
554
|
|
POST
|
Yes, it's possible to customize the legend tree on the event 'Legend.refreshed'. Ryan did it and gave his code here : http://forums.arcgis.com/threads/17674-2.1-LegendItems-Always-Null Thanks Dominique. I'm not so much interested in customizing the legend as getting it working with Map Services. I think that my problem is that our services are hosted on an AWS instance running AGS 10 (NOT SP1). There seems to be a problem with the way the legend symbols are served via ArcGis.com. I guess we can wait for SP1 images to show up so we can take advantage of the new legend service.
... View more
11-22-2010
05:26 AM
|
0
|
0
|
547
|
|
POST
|
I love the new legend control in 2.1. I am wondering if there is any way to set up symbology for a raster layer in ArcMap so that the service can pick up a symbol for the legend. Is it possible? Thanks!
... View more
11-19-2010
09:35 AM
|
0
|
5
|
2969
|
|
POST
|
I am using the editor widget to edit feature services that the user can add at run time. Each time a user adds or subtracts a feature layer from the map, I am setting the EditorWidget.LayerIDs property accordingly. Oddly, there seems to be a bug in the TemplatePicker portion of the widget where when the control switches from 0 to 1 layers, the symbols are missing from the template. When you add a second layer, symbols from both layers show up. Adding more layers the control exhibits expected behavior, as well as when you remove layers. If this is fixed in 2.1, I can wait until release for it.
... View more
11-18-2010
05:20 AM
|
0
|
2
|
828
|
|
POST
|
I'm trying to get away from querying a service and load stuff fast.
... View more
11-11-2010
10:54 AM
|
0
|
0
|
879
|
|
POST
|
No, this is just a one-off operation to capture the geometry and attributes of a certain set of features, then hard-code both into my app.
... View more
11-11-2010
10:18 AM
|
0
|
0
|
879
|
|
POST
|
My goal is to 'hard-code' some features with attributes into my app. I am generating the XAML dynamically from a FeatureService dataset, then when (if) I can get it working, I will remove the FeatureService and just have the graphics. If I can't add the attributes with XAML, is there a way to store JSON messages and trick the FeatureService into reading them when it loads?
... View more
11-11-2010
09:42 AM
|
0
|
0
|
879
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-16-2015 10:23 AM | |
| 2 | 09-25-2015 10:36 AM | |
| 1 | 06-29-2015 08:24 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|