|
POST
|
I'm trying to add graphics to my map in XAML using this syntax: [HTML]<esri:GraphicsLayer ID="Shapes"> <esri:Graphic> <esri:Graphic.Attributes> <sys:String x:Key="Name">Graphic 0</sys:String> </esri:Graphic.Attributes> <esri:Graphic.Geometry>....</esri:Graphic.Geometry> </esri:Graphic> </esri:GraphicsLayer>[/HTML]I get a runtime exception (I assume because Attributes is read-only). Is there a way to add attributes with XAML?
... View more
11-11-2010
07:22 AM
|
0
|
8
|
3921
|
|
POST
|
Looks like the "Link" attribute of your graphic is of type System.Uri. In that case just use: private void graphicsLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs args)
{
System.Windows.Browser.HtmlPage.Window.Navigate((System.Uri)args.Graphic.Attributes["link"], "_blank");
}
... View more
11-04-2010
10:29 AM
|
0
|
0
|
961
|
|
POST
|
The link does not appear to be working. Here's a brief list of KML features I would like to see supported: GroundOverlay ScreenOverlay NetworkLink (including updates OnInterval and OnRefresh) Document, Folder hierarchy implemented Timestamps
... View more
11-03-2010
07:09 PM
|
0
|
0
|
499
|
|
POST
|
Instead of calling Initialize() directly, just add the layer to your map control. MyMap.Layers.Add(fLayer);
... View more
11-03-2010
04:50 AM
|
0
|
0
|
930
|
|
POST
|
I hear you on the kludgey bit. It's not difficult to get that way when you're using new tech and aren't sure what patterns and practices to use. We had a similar issue where we wanted to use the same UI to interact with different types of map objects. Some of our symbols were KML with HTML in one of the Attribute fields, and others were Shapefile or ESRI Features that just had a table of attributes. It may not be the best approach, but we went with the toolkit maptip, and modded it to allow display of an HTML panel (see Morten Nielsen's blog) in the case where the Url or HTML attributes were present, and a feature grid in the case where they weren't. The Maptip controltemplate has both controls present, with their visibility databound to a (added) dependency property in the maptip control, whose value is set when you click a graphic.
... View more
11-02-2010
07:20 AM
|
0
|
0
|
961
|
|
POST
|
You can download and modify the toolkit maptip source. On the template, You need to replace the datagrid with something like: <HyperlinkButton NavigateUri="{TemplateBinding Url}" TargetName="_blank" /> And then create a Dependency Property named Url and assign it in code behind in graphicsLayer_MouseEnter().
... View more
11-01-2010
12:24 PM
|
0
|
0
|
961
|
|
POST
|
Handle the GraphicsLayer.MouseLeftButtonDown event with the following code: private void graphicsLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs args)
{
System.Windows.Browser.HtmlPage.Window.Navigate(new System.Uri((string)args.Graphic.Attributes["link"], System.UriKind.Absolute), "_blank");
} Setting the target to "_blank" ensures that you don't leave the app by clicking. If you want to make the maptip more hyperlink friendly, you'll probably want to use the maptip included in the toolkit instead of the default ESRI.ArcGis.Client.Maptip control.
... View more
10-29-2010
04:46 AM
|
0
|
0
|
961
|
|
POST
|
Does your layout root grid have this: <Grid x:Name="MainElement"> <Grid.RenderTransform> <ScaleTransform /> </Grid.RenderTransform> </Grid>
... View more
10-28-2010
05:08 AM
|
0
|
0
|
882
|
|
POST
|
Which version of Silverlight and ESRI API are you using? If you're at 4.0 and 2.0+, you don't need the dictionary converter anymore. Just bind with expressions like {Binding Attributes[attributename]}. Regarding issue 2, I don't think you can use multiple paths in a polygon symbol template. The base control is a path object named "Element". Although this limits you in styling choices, you should be able to support Normal/MouseOver/Selected visual states. For example, we use the line color/thickness to indicate selection, and show a drop shadow to indicate mouse hovering. Sample: [HTML]<ControlTemplate xmlns=""http://schemas.microsoft.com/client/2007"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""> <Path x:Name=""Element"" Stroke=""{Binding Symbol.BorderBrush}"" Fill=""{Binding Symbol.Fill}"" StrokeThickness=""{Binding Symbol.BorderThickness}"" StrokeStartLineCap=""Round"" StrokeLineJoin=""Round"" StrokeEndLineCap=""Round"" Cursor=""Hand""> <Path.Effect><DropShadowEffect x:Name=""ElementShadow"" ShadowDepth=""0"" Color=""White"" Opacity=""0"" /></Path.Effect> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name=""SelectionStates""> <VisualState x:Name=""Unselected"" /> <VisualState x:Name=""Selected""> <Storyboard> <ColorAnimation Storyboard.TargetName=""Element"" Storyboard.TargetProperty=""(Path.Fill).(SolidColorBrush.Color)"" To=""#88FFFF00"" Duration=""00:00:00.25""/> <ColorAnimation Storyboard.TargetName=""Element"" Storyboard.TargetProperty=""(Path.Stroke).(SolidColorBrush.Color)"" To=""Yellow"" Duration=""00:00:00.25""/> </Storyboard> </VisualState> </VisualStateGroup> <VisualStateGroup x:Name=""CommonStates""> <VisualState x:Name=""Normal"" /> <VisualState x:Name=""MouseOver""> <Storyboard> <DoubleAnimation Storyboard.TargetName=""ElementShadow"" Storyboard.TargetProperty=""(UIElement.Opacity)"" To=""1"" Duration=""00:00:00.1""/> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Path></ControlTemplate> [/HTML]
... View more
10-27-2010
06:42 PM
|
0
|
0
|
331
|
|
POST
|
Bing's Location is roughly equivalent to ESRI.ArcGis.Client.Geometry.MapPoint
... View more
10-21-2010
11:16 AM
|
0
|
0
|
962
|
|
POST
|
Dan, Thanks for your input, I set up a local ArcGIS server mostly because the machine that this application will be used for will not have internet access - but I am not sure my question is clear enough: Based on the following application http://milsym.codeplex.com/documentation that I downloaded - it is a Silverlight application using Bing maps I want to be able to do the same thing using Esri maps in WPF - so back to my original question - how would I implement interactive drawing of Military Graphics on the Esri map using WPF? You could reuse some of the low-level classes like MilBrush, etc., but most of the project is heavily integrated with the Bing maps API. ESRI classes are different, and you would have to slog through potentially thousands of lines of code to convert those classes into ESRI-friendly ones. You could start to see how much work it would be by removing the Bing references from the project and looking at the errors that pop up in each class. You might be better off just going with the Bing maps API.
... View more
10-21-2010
09:57 AM
|
0
|
0
|
962
|
|
POST
|
In that case you may find this blog post useful: http://kiwigis.blogspot.com/2009/05/accessing-esri-style-files-using-adonet.html Style files are just access databases that you can open using .NET data access classes. You could grab all the symbols that way. Just a thought...
... View more
10-21-2010
08:38 AM
|
0
|
0
|
962
|
|
POST
|
The preferred ESRI way to do this is to define all your symbology on the server using ArcMap and and a .style database, then publishing an MXD as a map service with feature access. Then using the editor widget on the client, you get all the symbols (more or less) automatically populated.
... View more
10-21-2010
07:50 AM
|
0
|
0
|
1409
|
|
POST
|
You can do it using Javascript and Silverlight's HtmlPage class. Here is a blog post explaining how to do it: http://geekswithblogs.net/PeterTweed/archive/2009/08/08/html-bridge---silverlight-javascript-interop.aspx
... View more
10-06-2010
09:40 AM
|
0
|
0
|
335
|
| 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
|