Once you can read the xml file you can create graphic points and add them to a graphic layer. I didn't include that part because I don't want to rob you of the fun of figuring it out on your own!Hope it helped some,Mike
public MainPage() { InitializeComponent(); callread(); } private void callread() { WebClient wc = new WebClient(); wc.OpenReadAsync(new Uri(" INSERT YOUR XML LINK HERE", UriKind.Absolute)); wc.OpenReadCompleted += new OpenReadCompletedEventHandler(wc_OpenReadCompleted); } private void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) { Stream s = e.Result; XDocument xd = XDocument.Load(s); IEnumerable<XElement> ie = xd.Elements(); foreach (XElement el in ie) { IEnumerable<XElement> re = el.Elements(); foreach (XElement rootElm in re) { IEnumerable<XElement> items = rootElm.Elements(); foreach (XElement item in items) { XElement title = item.Element("title"); XElement desc = item.Element("description"); XElement geolat = item.Element("geolat"); XElement geolong = item.Element("geolong"); MessageBox.Show(title.Value.ToString()); //CREATE A POINT HERE AND ADD IT TO A GRAPHIC LAYER IN YOUR MAP } } } }
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.