private void prikaziLines(object sender, RoutedEventArgs e)
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load("Geographic.xml");

            XmlNodeList lines = xmlDoc.GetElementsByTagName("LineEntity");
            double      latitude;
            double      longitude;

            for (int i = 0; i < 1000; i++)
            //for (int i = 0; i < lines.Count; i++)
            {
                List <Koordinata> lKord         = new List <Koordinata>();
                XmlNodeList       subChildNodes = lines[i].ChildNodes;

                XmlNode xnode = subChildNodes.Item(9);

                foreach (XmlNode xn in xnode.ChildNodes)
                {
                    Koordinata tempKoor = new Koordinata();
                    ToLatLon(double.Parse(xn.ChildNodes.Item(0).InnerText.ToString()),
                             double.Parse(xn.ChildNodes.Item(1).InnerText.ToString()),
                             34,
                             out latitude,
                             out longitude);
                    tempKoor.X = latitude;
                    tempKoor.Y = longitude;
                    lKord.Add(tempKoor);
                }

                kooridinateLines.Add(lKord);
                //Console.WriteLine("x: " + subChildNodes.Item(3).InnerText + " y:" + subChildNodes.Item(4).InnerText);
                //Console.WriteLine("koord x: " + tempKoor.X + " y:" + tempKoor.Y);
            }

            GMapOverlay routes = new GMapOverlay("routes");

            foreach (List <Koordinata> lk in kooridinateLines)
            {
                List <PointLatLng> points = new List <PointLatLng>();
                foreach (Koordinata k in lk)
                {
                    points.Add(new PointLatLng(k.X, k.Y));
                }
                GMapRoute route = new GMapRoute(points, "Jardin des Tuileries");
                route.Stroke = new System.Drawing.Pen(System.Drawing.Color.YellowGreen, 1);
                routes.Routes.Add(route);
                gmap.Overlays.Add(routes);
            }
        }
        private void prikaziSubstations(object sender, RoutedEventArgs e)
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load("Geographic.xml");

            XmlNodeList substations = xmlDoc.GetElementsByTagName("SubstationEntity");

            double latitude;
            double longitude;

            for (int i = 0; i < substations.Count; i++)
            {
                Koordinata  tempKoor      = new Koordinata();
                XmlNodeList subChildNodes = substations[i].ChildNodes;


                ToLatLon(double.Parse(subChildNodes.Item(2).InnerText),
                         double.Parse(subChildNodes.Item(3).InnerText),
                         34,
                         out latitude,
                         out longitude);
                tempKoor.X = latitude;
                tempKoor.Y = longitude;
                kooridinateSubstations.Add(tempKoor);
                //Console.WriteLine("x: " + subChildNodes.Item(2).InnerText + " y:" + subChildNodes.Item(3).InnerText);
                //Console.WriteLine("koord x: " + tempKoor.X + " y:" + tempKoor.Y);
            }

            //foreach (Koordinata kord in kooridinateSubstations)
            //{
            //    Console.WriteLine("X: " + kord.X + " Y: " + kord.Y);
            //}

            GMapOverlay markers = new GMapOverlay("substations");

            foreach (Koordinata k in kooridinateSubstations)
            {
                GMapMarker marker = new GMarkerGoogle(
                    new PointLatLng(k.X, k.Y),
                    GMarkerGoogleType.purple);
                markers.Markers.Add(marker);
            }

            gmap.Overlays.Add(markers);
        }
        private void parseXML(object sender, RoutedEventArgs e)
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load("Geographic.xml");

            XmlNodeList substations = xmlDoc.GetElementsByTagName("SubstationEntity");
            XmlNodeList nodes       = xmlDoc.GetElementsByTagName("NodeEntity");
            XmlNodeList switches    = xmlDoc.GetElementsByTagName("SwitchEntity");
            XmlNodeList lines       = xmlDoc.GetElementsByTagName("LineEntity");

            //txbXml.Text = "X:";
            //foreach (XmlNode xnode in xCordinate)
            //{
            //    txbXml.Text += xnode.InnerText.ToString();
            //}


            double latitude;
            double longitude;

            //for(int i = 0; i < substations.Count; i++)
            //{
            //    Koordinata tempKoor = new Koordinata();
            //    XmlNodeList subChildNodes = substations[i].ChildNodes;


            //    ToLatLon(double.Parse(subChildNodes.Item(2).InnerText),
            //                double.Parse(subChildNodes.Item(3).InnerText),
            //                34,
            //                out latitude,
            //                out longitude);
            //    tempKoor.X = latitude;
            //    tempKoor.Y = longitude;
            //    kooridinateSubstations.Add(tempKoor);
            //    //Console.WriteLine("x: " + subChildNodes.Item(2).InnerText + " y:" + subChildNodes.Item(3).InnerText);
            //    //Console.WriteLine("koord x: " + tempKoor.X + " y:" + tempKoor.Y);
            //}

            //foreach (Koordinata kord in kooridinateSubstations)
            //{
            //    Console.WriteLine("X: " + kord.X + " Y: " + kord.Y);
            //}

            for (int i = 0; i < nodes.Count; i++)
            {
                Koordinata  tempKoor      = new Koordinata();
                XmlNodeList subChildNodes = nodes[i].ChildNodes;


                ToLatLon(double.Parse(subChildNodes.Item(2).InnerText.ToString()),
                         double.Parse(subChildNodes.Item(3).InnerText.ToString()),
                         34,
                         out latitude,
                         out longitude);
                tempKoor.X = latitude;
                tempKoor.Y = longitude;
                kooridinateNodes.Add(tempKoor);
                //Console.WriteLine("x: " + subChildNodes.Item(2).InnerText + " y:" + subChildNodes.Item(3).InnerText);
                //Console.WriteLine("koord x: " + tempKoor.X + " y:" + tempKoor.Y);
            }

            ////foreach (Koordinata kord in kooridinateNodes)
            ////{
            ////    Console.WriteLine("X: " + kord.X + " Y: " + kord.Y);
            ////}

            //for (int i = 0; i < switches.Count; i++)
            //{
            //    Koordinata tempKoor = new Koordinata();
            //    XmlNodeList subChildNodes = switches[i].ChildNodes;


            //    ToLatLon(double.Parse(subChildNodes.Item(3).InnerText.ToString()),
            //                double.Parse(subChildNodes.Item(4).InnerText.ToString()),
            //                34,
            //                out latitude,
            //                out longitude);
            //    tempKoor.X = latitude;
            //    tempKoor.Y = longitude;
            //    kooridinateSwitches.Add(tempKoor);
            //    //Console.WriteLine("x: " + subChildNodes.Item(3).InnerText + " y:" + subChildNodes.Item(4).InnerText);
            //    //Console.WriteLine("koord x: " + tempKoor.X + " y:" + tempKoor.Y);
            //}

            ////foreach (Koordinata kord in kooridinateSwitches)
            ////{
            ////    Console.WriteLine("X: " + kord.X + " Y: " + kord.Y);
            ////}

            //for (int i = 0; i < lines.Count; i++)
            //{
            //    List<Koordinata> lKord = new List<Koordinata>();
            //    XmlNodeList subChildNodes = lines[i].ChildNodes;

            //    XmlNode xnode = subChildNodes.Item(9);

            //    foreach(XmlNode xn in xnode.ChildNodes)
            //    {
            //        Koordinata tempKoor = new Koordinata();
            //        ToLatLon(double.Parse(xn.ChildNodes.Item(0).InnerText.ToString()),
            //                double.Parse(xn.ChildNodes.Item(1).InnerText.ToString()),
            //                34,
            //                out latitude,
            //                out longitude);
            //        tempKoor.X = latitude;
            //        tempKoor.Y = longitude;
            //        lKord.Add(tempKoor);
            //    }

            //    kooridinateLines.Add(lKord);
            //    //Console.WriteLine("x: " + subChildNodes.Item(3).InnerText + " y:" + subChildNodes.Item(4).InnerText);
            //    //Console.WriteLine("koord x: " + tempKoor.X + " y:" + tempKoor.Y);
            //}

            Console.WriteLine("uspesno ucitan xml");
        }