Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim xmldoc As New XmlDataDocument() Dim fs As New FileStream("D:/output.xml", FileMode.Open, FileAccess.Read) xmldoc.Load(fs) XmlNode = xmldoc.GetElementsByTagName("Table") For i = 0 To XmlNode.Count - 1 d = XmlNode(i).ChildNodes.Item(0).InnerText.Trim() coord = XmlNode(i).ChildNodes.Item(1).InnerText.Trim() & "," & XmlNode(i).ChildNodes.Item(2).InnerText.Trim() l1 = XmlNode(i).ChildNodes.Item(1).InnerText.Trim() l2 = xmlnode(i).ChildNodes.Item(2).InnerText.Trim(). I pass this l1 and l2 value in javascript which plot them on map. Below is js function: function initialize() { var lat = '<%=l1%>'; var lon = '<%=l2%>'; var myLatlng = new google.maps.LatLng(lat, lon) // This is used to center the map to show our markers var mapOptions = { center: myLatlng, zoom: 3, mapTypeId: google.maps.MapTypeId.ROADMAP, marker: true }; var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); var marker = new google.maps.Marker({ position: myLatlng }); marker.setMap(map); }
<newdataset> <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xs:element name="NewDataSet" msdata:isdataset="true" msdata:usecurrentlocale="true"> <xs:complextype> <xs:choice minoccurs="0" maxoccurs="unbounded"> <xs:element name="Table"> <xs:complextype> <xs:sequence> <xs:element name="id" type="xs:int" minoccurs="0" /> <xs:element name="lat" type="xs:double" minoccurs="0" /> <xs:element name="long" type="xs:double" minoccurs="0" /> </xs:sequence> </xs:complextype> </xs:element> </xs:choice> </xs:complextype> </xs:element> </xs:schema> <table> <id>1</id> <lat>41.037930622465289</lat> <long>29.428253173828125</long> </table> <table> <id>2</id> <lat>40.896905775860006</lat> <long>30.477447509765625</long> </table> <table> <id>3</id> <lat>18.896905775860006</lat> <long>72.477447509765625</long> </table> </newdataset>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)