|
POST
|
I created a user control for Overview Map using ESRI's source code in http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#OverviewMap <esri:OverviewMap x:Name="MyOverviewMap" Margin="35,25,35,25" MaximumExtent="-180,-90,180,90" Map="{Binding ElementName=_Map}"> <esri:OverviewMap.Layer> <esri:ArcGISTiledMapServiceLayer ID="TopoLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/NPS_Physical_World_2D/MapServer"/> </esri:OverviewMap.Layer> </esri:OverviewMap> where _Map is defined in its .xaml.cs file: private MainPage _Parent; private Map _Map; #region Public Methods public Overview() { InitializeComponent(); ... } public void SetMap(Map TheMap) { _Map = TheMap; } public void SetParent(MainPage TheParent) { _Parent = TheParent; } However, the Overview Map is still empty. I debugged, and observed that _Map contains 4 layers (not null). There must be something missing for the binding. If you know, please point it our. Thanks.
... View more
10-06-2010
04:35 AM
|
0
|
2
|
2249
|
|
POST
|
Still got error. I run debug and receive NullReferenceException at the piece of code below public class ToggleVisibilityAction : TargetedTriggerAction<UIElement> { protected override void Invoke(object parameter) { this.Target.Visibility = this.Target.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible; } } Because this.Target is Null. The related codes are below: In MainPage.xaml <unb:SwitchMap x:Name="MyBaseMaps" ... In Toolbar.xaml <actions:ToggleVisibilityAction TargetName="MainPage.MyBaseMaps" /> I am not sure the parameter I set for the TargetName is correct. Thanks for you toview it and provide your feedback.
... View more
10-05-2010
10:47 AM
|
0
|
0
|
1107
|
|
POST
|
Tried this._Map.Visibility = System.Windows.Visibility.Collapsed; but receive NullReferenceException since this._Map is null Could you tell what is wrong in the following code: private MainPage _Parent; private Map _Map; public void SetParent(MainPage TheParent) { // Assumes that MainPage supports SetCursor and UnsetTool _Parent = TheParent; } public void SetMap(Map TheMap) { _Map = TheMap; } Thanks.
... View more
10-05-2010
10:18 AM
|
0
|
0
|
1107
|
|
POST
|
I created a toolbar, e.g. the BaseMap Switch tool bar that allows me to switch from one basemap to another. Then I created a control toolbar. By clicking a button, the BaseMap Switch toolbar can be either expanded or collapsed. I wrote a piece of code (see below), but I don't know how to set the value for the BaseMap Toolbar's visibility (or something else). If you have the experience, please share it with me. Thanks. private void SetTool(Button btn) { _Parent = (MainPage)System.Windows.Application.Current.RootVisual; _Parent.UnsetTool(); btn.Background = (Brush)Application.Current.Resources["ButtonHighlightBrush"]; _btnCurrentTool = btn; if (btn == btnMapSwitch) { //_Parent.MyBaseMaps.Visibility = "Collapse"; // can't be a string, what should be? } ... }
... View more
10-05-2010
07:46 AM
|
0
|
7
|
1835
|
|
POST
|
Dominique: Great! Using your code, it works well. Thanks a LOT!!! Shaning
... View more
10-05-2010
05:46 AM
|
0
|
0
|
639
|
|
POST
|
Jenniffer: Thanks for your response. As you pointed out, the _Parebt is null. I added _Parent = new MainPage(); then arcgisLayer.Url = ((RadioButton)sender).Tag as string; also shows right URL. However, neither imagery nor topo map can be loaded. Please advise me how to fix this problem. Thanks again. Shaning
... View more
10-05-2010
03:39 AM
|
0
|
0
|
639
|
|
POST
|
I tried to customize a template received by adding the Switch Map component sourced from ESRI: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SwitchMap. The procedure I used is described below: 1) Create Switch.xaml as well as .cs file in \UserControls\. 2) Copy and paste the related source codes into the 2 files mentioned in 1). E.g., in the xaml file: <Grid Name="LayoutRoot" Background="Transparent"> <Grid.Resources> <esri:SimpleFillSymbol x:Name="DefaultFillSymbol" Fill="#33FF0000" BorderBrush="Red" BorderThickness="2" /> </Grid.Resources> <unb:FloatingPanel x:Name="MyFloatingPanel" Floating="True" Margin="0,0,0,0" /> <Grid Style="{StaticResource FloatingPanelItemsGrid}" Margin="10,10,10,10"> <Rectangle Style="{StaticResource ForePanel}" HorizontalAlignment="Left" Width="220" /> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="18,0,6,0" Width="196"> <RadioButton x:Name="StreetsRadioButton" .../> <RadioButton x:Name="TopoRadioButton" .../> <RadioButton x:Name="ImageryRadioButton" ... /> </StackPanel> </Grid> </Grid> 3) Add the following code into MainPage.xaml <esri:Map x:Name="MyMap" Canvas.Left="0" Canvas.Top="0" Height="900" Width="1200" IsLogoVisible="False"> <esri:ArcGISTiledMapServiceLayer ID="AGOLayer" Visible="True" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/> <esri:GraphicsLayer ID="ResultsGraphicsLayer" /> <esri:GraphicsLayer ID="MeasureGraphicsLayer" /> <esri:GraphicsLayer ID="IDGraphicsLayer" /> </esri:Map> 4) Compile and run debugging. I received NullReferenceException at private void RadioButton_Click(object sender, RoutedEventArgs e) { ArcGISTiledMapServiceLayer arcgisLayer = _Parent.MyMap.Layers["AGOLayer"] as ArcGISTiledMapServiceLayer; I don't know how to fix it. If you can share your experience, I will greatly appreciate.
... View more
10-04-2010
11:24 AM
|
0
|
4
|
1000
|
|
POST
|
Paul: I searched through the MainPage.xmal but could not find IsLogoVisible. Besides, I could not locate the place for <Image HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,8,8" Source="PATH TO IMAGE" Width="IMAGE WIDTH" Height="IMAGE HEIGHT" ></Image> Wish you can kindly respond my question. Thanks.
... View more
09-30-2010
07:09 AM
|
0
|
0
|
752
|
|
POST
|
Jennifer: Thanks for your response. I tested. The Navigate to Previous and Next tools still do not work.
... View more
09-30-2010
06:54 AM
|
0
|
0
|
1178
|
|
POST
|
I loaded a sample code into the \UserControls\ folder of the project. I want to load the widget (e.g. myControl.xaml as well as myControl.xaml.cs) as a MenuItem through a menu. The related code is below: <Button x:Name="myMenuItem1" Style="{StaticResource MenuItem}" ToolTipService.ToolTip="Your First Menu Here!" Content="SubMenu #1" > I tried to find a piece of sample code to triggle the widget but not successful. If you know how, I will appreciate your help. Thanks.
... View more
09-29-2010
10:49 AM
|
0
|
0
|
628
|
|
POST
|
I loaded the sample code from http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolBarWidget, which contains the navigation tools. However, both the To Previous and To Next tools do not function. For the code in the XAML file, <esri:ToolbarItem.Content> <Image Source="/Assets/images/i_next.png" IsHitTestVisible="False" ... I removed IsHitTestVisible="False" But it still does not function well. I debugged its C# code for Previous Extent, and observed that _currentExtentIndex is always 0. Then, if (_currentExtentIndex == !0) { ...... } break; it goes to break. I got similiar result for the Next Extent. If you know where the problem is, please share your experience. Thanks.
... View more
09-29-2010
10:35 AM
|
0
|
6
|
3720
|
|
POST
|
Clean Solution and then re-build. The errors were gone. Thanks.
... View more
09-28-2010
06:55 AM
|
0
|
0
|
389
|
|
POST
|
I used to work on ESRI's Flexviewer and currently work on Silverlight version template ESRIStandardMapApplication. I followed the procedure in http://help.arcgis.com/en/webapi/silverlight/help/index.html - Working with Templates, and loaded ESRI's ESRI Standard Map Application template as my new project. Then I received 17 errors. The 1st error is: Error 1 Unable to load the metadata for assembly 'ESRIStandardMapApplication1'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'ESRIStandardMapApplication1' or one of its dependencies. The system cannot find the file specified c:\documents and settings\myName\my documents\visual studio 2010\Projects\ESRIStandardMapApplication1\ESRIStandardMapApplication1\MainPage.xaml I then checked the http://go.microsoft.com/fwlink/?LinkId=179545. However, I don't know which assembly needs to be unblocked. If you have experienced this kind of problem, please share your experience. Thanks.
... View more
09-28-2010
06:26 AM
|
0
|
2
|
2127
|
|
POST
|
You recommended approach: manually copy the files from your src folder into your bin-debug. The files missed are several images. I used your approach. It works for some images that display on the map, but for some of images that do not display on map. Stranger.
... View more
09-17-2010
10:47 AM
|
0
|
0
|
605
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-18-2023 10:02 AM | |
| 3 | 07-14-2023 12:29 PM | |
| 1 | 04-02-2021 12:16 PM | |
| 1 | 07-24-2017 11:31 AM | |
| 1 | 04-04-2016 03:59 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-01-2025
11:58 AM
|