POST
|
I have a query that returns a list of records that are related to various States (polygons) and I want to link those records to the individual States. I am having problems to extract the individual States from the State boundary GraphicsLayer. here a set of the codes: private Graphic getStateBoundaryGraphic(string ST) { GraphicsLayer usaGraphics = MyMap.Layers["StatesUSA"] as GraphicsLayer; Graphic state = new Graphic(); foreach (Graphic g in usaGraphics) { if (g.Attributes["STATE"] == ST) state = g; } return state; } [ERROR MESSAGE:] "foreach (Graphic g in usaGraphics)" Object reference is not set which is null which is NOT true. What am I missing? Thanks
... View more
11-05-2013
08:49 AM
|
0
|
5
|
2882
|
POST
|
Using the _PropertyChanged event solved the problem.
... View more
09-09-2013
06:42 AM
|
0
|
0
|
209
|
POST
|
I have a feature layer that is derived from a dynamic map service layer solely for Map Tip purpose. The feature layer is set to 100% transparent to fool the eyes of a user that the map tip appears to come from the "underlying dynamic map service layer". Is there a way to sycn the visibility of a map service layer with a derived feature layer using the _VisibilityChanged event or _LegendChanged event of the dynamic map service layer? below is the codes, but none work. What do I miss? Thanks private void ArcGISDynamicMapServiceLayer_LegendChanged(object sender, EventArgs e) { FeatureLayer myFL = MyMap.Layers["Water info popup"] as FeatureLayer; DynamicMapServiceLayer myDMSL = MyMap.Layers["Water info station"] as DynamicMapServiceLayer; if (myDMSL.Visible == true) myFL.Visible = true; else myFL.Visible = false; } OR ... private void ArcGISDynamicMapServiceLayer_LegendChanged(object sender, EventArgs e) { FeatureLayer myFL = MyMap.Layers["Water info popup"] as FeatureLayer; DynamicMapServiceLayer myDMSL = MyMap.Layers["Water info station"] as DynamicMapServiceLayer; if (myDMSL.Visible == true) myFL.Visible = true; else myFL.Visible = false; }
... View more
09-09-2013
05:03 AM
|
0
|
1
|
639
|
POST
|
Doese anyone have an idea how to get the dimension parameters (width and height) of a DataGrid that is linked to a dynamic list with varying length? I am thinking about "Reloading" the DataGrid each time when the list is changed, but am still out of luck so far. Even though the data on mylist does show up in the DataGrid view, "myDataGrid.ItemsSource = mylist;" does not change the size of the grid, especially when a new list becomes shorter. It looks like the "size change" of the DataGrid happens after the display. Any pointers, clues, or samples out there? Thanks Yurong Tan VAOIG
... View more
09-04-2013
12:27 PM
|
0
|
0
|
927
|
POST
|
DataGrid dataGrid = sender as DataGrid; int selectedIndex = dataGrid.SelectedIndex; if (selectedIndex > -1) { GraphicsLayer MyFlashGraphicPoint = MyMap.Layers["MyFlashingGraphicPoint"] as GraphicsLayer; Graphic xgraphic = (Graphic)FindDetailsDataGridCAP.SelectedItem; if (xgraphic != null) { if (xgraphix.TYPE == "POINT") { double flareAtX = xgraphic.Geometry.Extent.XMin; double flareAtY = xgraphic.Geometry.Extent.YMin; MyMap.PanTo(xgraphic.Geometry); MyFlashGraphicPoint = null; MyFlashGraphicPoint = (ESRI.ArcGIS.Client.GraphicsLayer)(MyMap.Layers["MyFlashingGraphicPoint"]); ESRI.ArcGIS.Client.GraphicCollection esriGraphicsCollection = MyFlashGraphicPoint.Graphics; Graphic myFlash = esriGraphicsCollection[0]; ESRI.ArcGIS.Client.Geometry.MapPoint oldPoint = null; oldPoint = (ESRI.ArcGIS.Client.Geometry.MapPoint)myFlash.Geometry; ESRI.ArcGIS.Client.Geometry.MapPoint myFlarePoint = new ESRI.ArcGIS.Client.Geometry.MapPoint(); myFlarePoint.X = flareAtX; myFlarePoint.Y = flareAtY; myFlash.Geometry = myFlarePoint; FlashingGraphicPoint.Visible = true; // The point is a strobe of different colors } else { // a polygon area will flashing } } }
... View more
09-04-2013
12:13 PM
|
0
|
0
|
239
|
POST
|
I have the following XAML code that produces a flashing-expanding (trobe) point. I have to specifically commend out the "MapPoint" section in the code solely to prevent Visual Studio 2010 from crashing. Can someone shed some light on this? Thanks <esri:GraphicsLayer ID="MyFlashingGraphicPoint" Opacity="0.9" Visible="False" > <esri:GraphicsLayer.Graphics> <esri:Graphic Symbol="{StaticResource FlashingMarkerSymbol}"> <!--esri:MapPoint x:Name="MySelectedPoint" X="-10000000" Y="4883000"> <esri:Geometry.SpatialReference > <esri:SpatialReference WKID="102100" /> </esri:Geometry.SpatialReference> </esri:MapPoint--> </esri:Graphic> </esri:GraphicsLayer.Graphics> </esri:GraphicsLayer>
... View more
08-21-2013
05:57 AM
|
0
|
0
|
862
|
POST
|
I have a GraphicsLayer "MySelectedPoint" to hold a selected point feature with a different symbol to distinguish it from the underlying graphics layer, but the selected point does not display nor is it visible. I spent some time looking around for an answer, but couldn't figure out what I missed. Here is the code: Two marker symbols (smaller solid red and larger blue cross). The red one is for the underlying graphicslayer "MyGraphicsLayer" and the blue larger one cross is for the selected graphic in "MySelectedPoint" layer. <Grid.Resources> <esri:SimpleMarkerSymbol x:Key="DefaultMarkerSymbol" Size="30" Color="Blue" Style="Cross" /> <esri:SimpleMarkerSymbol x:Key="SimpleMarkerSymbol" Size="14" Color="Red" Style="Circle" /> <esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000"> <esri:GraphicsLayer ID="MyGraphicsLayer" Opacity="0.8" /> <esri:GraphicsLayer ID="MySelectedPoint"/> When a record is selected in the DataGrid table, the graphic corresponding to the selected record is cloned and add to the "MySelectedPoint" graphicslayer which does not display even thoug there is a record/graphic in it with cordinates and symbology. private void FindDetails_SelectionChanged(object sender, SelectionChangedEventArgs e) { DataGrid myTargetPoint = sender as DataGrid; int mySelection = myTargetPoint.SelectedIndex; if (mySelection > -1) { GraphicsLayer mySelectedPoint = MyMap.Layers["MySelectedPoint"] as GraphicsLayer; mySelectedPoint.ClearGraphics(); Graphic thisPoint = (Graphic)FindDetailsDataGrid.SelectedItems[0]; if (thisPoint != null) { Graphic myPoint = new Graphic(); myPoint.Geometry = thisPoint.Geometry.Extent.Clone(); myPoint.Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as Symbol; mySelectedPoint.Graphics.Add(myPoint); mySelectedPoint.Visible = true; mySelectedPoint.Opacity = 1.0; } } } What do I miss here? Thanks
... View more
08-19-2013
06:08 AM
|
0
|
1
|
3103
|
POST
|
GraphicsLayer myFoundGraphicsLayer = MyMap.Layers["MyFoundGraphicslayer"] as GraphicsLayer; foreach (SQLDataRecord sqlrd in mySQLReturnedList) { Graphic myGraphic = new Graphic() { Geometry = mercator.FromGeographic(new MapPoint(sqlrd.LON, sqlrd.LAT)), Symbol = LayoutRoot.Resources["myLargeBlueMarker"] as Symbol // : LayoutRoot.Resources["BlackMarkerSymbol"] as Symbol }; myGraphic.Attributes.Add("RID", sqlrd.RID); myGraphic.Attributes.Add("STA_NO", sqlrd.STA_NO); myFoundGraphicsLayer.Graphics.Add(myGraphic); }
... View more
08-19-2013
05:54 AM
|
0
|
0
|
212
|
POST
|
Hello, I am wondering if there is some info out there that can explain how to animate marker symbols using storyboard? I got an example from this site for polygons (see below), but it is kind of working in the dark for markers. I would appreciate any pointers. Thanks in advance. EXAMPLE FROM THIS SITE FOR POLYGON GRAPHICS LAYER <esri:FillSymbol x:Key="ResultsFillSymbol"> <esri:FillSymbol.ControlTemplate> <ControlTemplate x:Name="CustomPolygonTemplate"> <Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="MouseOver"> <Storyboard> <ColorAnimation Storyboard.TargetName="Element" Storyboard.TargetProperty="(Fill).(Color)" To="#8800FFFF" Duration="0:0:0.1" /> </Storyboard> </VisualState> ..... But for a marker layer, I am lost: <!-- FOR POINT GRAPHICS LAYER --> <esri:MarkerSymbol x:Key="myFocusPointCustomMarker"> <esri:MarkerSymbol.ControlTemplate> <ControlTemplate x:Name="myCustomMarkerTemplate"> <Grid> <VisualStateManager.VisualStateGroups> <VisualState x:Name="Selected"> <Storyboard> <PointAnimation Storyboard.TargetName="Element" Storyboard.TargetProperty="?????" ???? /> </Storyboard> </VisualState> ... </VisualStateManager.VisualStateGroups> </Grid> </ControlTemplate> </esri:MarkerSymbol.ControlTemplate> </esri:MarkerSymbol>
... View more
08-06-2013
10:02 AM
|
0
|
1
|
3714
|
POST
|
Thank you! I was first trying to use the InfoWindow and realized that it is not that flexible as the DataTemplate must have a fixed items (or lengths). Is there a way to programatically (C#) customize the DatTemplate and then bind/attach it to the InfoWindow? My problem is that I have a point feature layer and each point can have as many as 35 different measurements (some have a few only). In addition, I would like to color-code (red, green, yellow, etc.) the measurements based on their values for high, warning, and normal. Any pointers on this? Thanks
... View more
08-02-2013
07:48 AM
|
0
|
0
|
208
|
POST
|
I am working on a secondary "popup" from a MapTip to display additional information and I haven't been able to position the pop up (either TextBox or esri:InfoWindow) properply. In fact the pop up stays at the center of the map display. Is there a pointer out there or a sample to look at? Thanks
... View more
08-01-2013
08:09 AM
|
0
|
3
|
774
|
POST
|
I got this error message and tech support appears to have no clue. A map service falsely appears fine (started and up running) in ArcCatalog and ArcGIS Server Manager. And the http://myserver:6080/arcgis/rest/services/myservice/MapServer metadata looks fine too. BUT the service CAN NOT be viewed or displayed anywhere (ArcCatalog, ArcMap, ArcGIS Server Manager, Visual Studio, deployed web Applications). When it is previewed in ArcGIS server manager, the following message popped up. Does anyone have a similar experience? Thanks in advance! Message: 'dojo' is undefined Line: 10 Char: 2 Code: 0 URI: http://localhost:6080/arcgis/rest/services/BaseMapLayers/MapServer?f=jsapi
... View more
06-19-2013
07:59 AM
|
0
|
0
|
2520
|
POST
|
That's a message that appears only in design time Inside Visual Studio. However you should be able to compile and run your application despite this message. Thanks for the help and Problem SOLVED. It is the default settings for the legend and once those settings are commented out in the App.xaml, everything goes. Simple
... View more
04-27-2013
08:54 PM
|
0
|
0
|
318
|
POST
|
I encountered an app deployment problem and am yet still struggling with it for some time. It is about deploying a map application developed on the Silverlight (5) platform ArcGIS API(3.0) together with a WCF RIA service. The app was developed in the same web server as the hosting one, but in a separate project directory. It runs fine as a project, but it got choked and spits out an error message (see below) when deployed in the server (wwwroot). The WCF service is to pull in auxiliary data from a SQL server to juice up pop-ups and facilitate controls and it works great. But it ceases functioning once the app is deployed in the web server (see message below). Cam someone shed some light on this as to what is the problem and/or where to look at in order to find a solution? Below is error message ================================================= Message: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at MyXY.ServiceReference1.FetchHITIssuesCompletedEventArgs.get_Result() at MyXY.MainPage.HITDataServiceClient_FetchHITIssuesCompleted(Object sender, FetchHITIssuesCompletedEventArgs e) at MyXY.ServiceReference1.MyXYServiceClient.OnFetchHITIssuesCompleted(Object state) Line: 1 Char: 1 Code: 0 URI: http://oigcodevgis/TEST/MyXY/MyXYTestPage.html
... View more
04-10-2013
09:20 AM
|
0
|
0
|
442
|
POST
|
I forgot to mention this is a Silverlight app. I have a few point records located in central Florida and those records are the results from a query and are displayed on the map as graphics as well as on a DataGrid. When I clicked on a record in the DataGrid, the map pans to Africa? What do I miss. Here is the codes: private void dataReportLink_SelectionChanged(object sender, SelectionChangedEventArgs e) { DataGrid HITHighLight = sender as DataGrid; int HITSelected = HITHighLight.SelectedIndex; if (HITSelected > -1) { Graphic thisHIT = (Graphic)dataReportLink.SelectedItem; if (thisHIT != null) { thisHIT.Symbol = LayoutRoot.Resources["MyCrossHairTarget"] as ESRI.ArcGIS.Client.Symbols.Symbol; thisHIT.Geometry.SpatialReference = MyMap.SpatialReference; MyMap.PanTo(thisHIT.Geometry); } } }
... View more
04-08-2013
11:17 AM
|
0
|
0
|
1448
|
Title | Kudos | Posted |
---|---|---|
2 | 06-08-2015 08:02 AM |
Online Status |
Offline
|
Date Last Visited |
07-24-2024
07:48 PM
|