Select to view content in your preferred language

Add graphics for X,Y Coordinate from a notepad file

1108
2
11-28-2011 02:20 AM
MuhammadWaqar_ul_islam
Occasional Contributor
I want to add a Note Pad file that Contains XY Coordinate taken from GPS device
and shown as a graphic points on silverlight application
i seen the sample
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Project
its works fine for single entry by manually entering XY Coordinate
but i want to add a file that contain X,Y
i m attaching notepad file  that contain XY and others values
urgently required Code
0 Kudos
2 Replies
MichaelKohler
Frequent Contributor
the code below is part of what I use to read data from an xml file and draw graphics on the screen for hurricane points.


 MapPoint mp = new MapPoint(xLoc, yLoc, new SpatialReference(4326));
                Graphic gPt = new Graphic();
                gPt.Geometry = mp;

                gPt.Attributes.Add("Storm", ptVals[6]);
                gPt.Attributes.Add("Model", ptVals[0]);
                gPt.Attributes.Add("Time", ptVals[1]);
                gPt.Attributes.Add("Lat", ptVals[2]);
                gPt.Attributes.Add("Lon", ptVals[3]);
                gPt.Attributes.Add("Wind", ptVals[4]);
                gPt.Attributes.Add("Pressure", ptVals[5]);

                gPt.Symbol = gSym;
                gl.Graphics.Add(gPt);


to read from a text file you would need to get the file from the user with the OpenFileDialog. I use the xml format and WebClient to get at the data.
0 Kudos
MuhammadWaqar_ul_islam
Occasional Contributor
Thanks Michael Kohler
can u please send me ur whole source code along with xml file
so i can understand how you add from xml.

It would be more help full if some body explain the code for adding file from txt format
0 Kudos