POST
|
All I need to do is edit the attributes of a graphic so that when the user want to change information about the graphic is will show up in the maptip. Here is my Code and XAML. //Following code creates a new graphic and adds the information that I want to save about it to a list that I have created. Graphic graphic = new Graphic() { Symbol = AddressLayout.Resources["LotRenderer"] as ESRI.ArcGIS.Client.Symbols.Symbol, Geometry = candidate.Location }; string address1 = Address.Text; string address2 = String.Format("{0}, {1} {2}", City.Text, State.Text, Zip.Text); addressCombined = String.Format("{0},{1},{2},{3}", Address.Text, City.Text, State.Text, Zip.Text); ObjectProperties record = new ObjectProperties { ObjectNumber = txtObjectNumber.Text, ObjectComments = txtComments.Text, ObjectAddress = addressCombined, }; Properties.Add(record); graphic.Attributes.Add("MeterNum", record.ObjectNumber); graphic.Attributes.Add("Comment", record.ObjectComments); graphic.Attributes.Add("Address1", address1); graphic.Attributes.Add("Address2", address2); FeatureLayer graphicsLayer = MyMap.Layers["WaterMeterLayer"] as FeatureLayer; graphicsLayer.Graphics.Add(graphic); //Here is the set up for my list. class ObjectProperties { public string ObjectNumber { get; set; } public string ObjectComments { get; set; } public string ObjectAddress { get; set; } } List<ObjectProperties> Properties = new List<ObjectProperties>(); //Here is my XAML <esri:FeatureLayer ID="WaterMeterLayer" Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0" AutoSave="True" Mode="OnDemand" Renderer="{StaticResource WaterMeterRenderer}" ValidateEdits="True" DisableClientCaching="True"> <esri:FeatureLayer.MapTip> <Grid> <Rectangle Stroke="Gray" RadiusX="10" RadiusY="10" Fill="#77FF0000" Margin="0,0,0,5" > <Rectangle.Effect> <DropShadowEffect/> </Rectangle.Effect> </Rectangle> <Rectangle Fill="#DDFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" /> <StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="30,20,30,30"> <TextBlock Text="{Binding [MeterNum]}" HorizontalAlignment="Left" Foreground="Black" /> <TextBlock Text="{Binding [Comment]}" HorizontalAlignment="Left" Foreground="Black" /> <TextBlock Text="{Binding [Address1]}" HorizontalAlignment="Left" Foreground="Black" /> <TextBlock Text="{Binding [Address2]}" HorizontalAlignment="Left" Foreground="Black" /> </StackPanel> </Grid> </esri:FeatureLayer.MapTip> </esri:FeatureLayer> Any help would be appreciated. I just need to update the graphic attributes when an item in the list is changed.
... View more
06-18-2012
12:46 PM
|
0
|
2
|
3909
|
POST
|
Hey Everyone, I have an application that allows the user to add symbols to a map that represent water meters. I have the application locating by address, but I would like for the user to be able to enter the meter number and be able to find the meter as well. I am attaching my code as well as images to further explain what I am trying to do. [ATTACH=CONFIG]15112[/ATTACH] I let the user enter the meter number and information. [ATTACH=CONFIG]15113[/ATTACH] Then as you can see in that image, the user can see the information when they hover over the symbol. The meter number is stored in a textblock which is Binded, if you look at my XAML you can see exactly what I am talking about. I want to have another textbox that allows the user to enter the meter number and find it accordingly. Thank-You for your help. Let me know if you have any questions. 🙂
... View more
06-11-2012
12:09 PM
|
0
|
1
|
2348
|
POST
|
Sorry. The question about _clickpoint was silly. Ok, so I have it adding objects, now I need it to save it when I add them. Do you know anything about this?
... View more
06-11-2012
06:27 AM
|
0
|
0
|
461
|
POST
|
Could you possible explain the code a little more. I have only been using arcGIS for a couple of days so I am definitely a beginner haha. I added it to my code and it does not recognize _clickpoint (It does not exist in the current context) I am sure you are going to have to create a method or event for this. Could you explain how to do that? Thank you for your help.
... View more
06-11-2012
05:38 AM
|
0
|
0
|
461
|
POST
|
I have the map adding objects or symbols, but it does not save them. I may just be missing something simple. Any help would be appreciated. Thank-You. I attached my project to this forum. I have looked at a lot of other forums and have done the demo provided by the SDK Samples for WPF, but I am still not being able to get it to work on mine with symbols. Even if someone could tell me how to tweak the code from the sample to use a symbol that would also work. Thanks Again.
... View more
06-08-2012
01:34 PM
|
0
|
4
|
1835
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|