I solved

Freshly commented: How did you solve it? +0

My code is:

var customIcons = {
      restaurant: {
        icon: 'http://labs.google.com/ridefinder/images/mm_20_blue.png'
      },
      bar: {
        icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png'
      }
    };

    function load() {
      var map = new google.maps.Map(document.getElementById("map"), {
        center: new google.maps.LatLng(37.4805016667, 126.952741667),
        zoom: 12,
        mapTypeId: 'roadmap'
      });
      var infoWindow = new google.maps.InfoWindow;

      // Change this depending on the name of your PHP file
      downloadUrl("**mark_info4.xml**", function(data) {
        var xml = data.responseXML;
        var markers = xml.documentElement.getElementsByTagName("marker");
        for (var i = 0; i < markers.length; i++) {
          var name = markers[i].getAttribute("time");
          var address = markers[i].getAttribute("sectionspray");
          var type = markers[i].getAttribute("pdistance");
      var td = markers[i].getAttribute("totaldistance");
          var point = new google.maps.LatLng(
              parseFloat(markers[i].getAttribute("latitude")),
              parseFloat(markers[i].getAttribute("longitude")));
          var html = "<b>" + "Time:"+name + "</b> <br/>" + "Spray:"+address+"<br/>"+"Dis:" + type+ "<br/>"+"Total dis:"+td;
          var icon = customIcons[type] || {};
          var marker = new google.maps.Marker({
            map: map,
            position: point,
            icon: icon.icon
          });
          bindInfoWindow(marker, map, infoWindow, html);
        }
      });
    }

    function bindInfoWindow(marker, map, infoWindow, html) {
      google.maps.event.addListener(marker, 'click', function() {
        infoWindow.setContent(html);
        infoWindow.open(map, marker);
      });
    }

    function downloadUrl(url, callback) {
      var request = window.ActiveXObject ?
          new ActiveXObject('Microsoft.XMLHTTP') :
          new XMLHttpRequest;

      request.onreadystatechange = function() {
        if (request.readyState == 4) {
          request.onreadystatechange = doNothing;
          callback(request, request.status);
        }
      };

      request.open('GET', url, true);
      request.send(null);
    }

    function doNothing() {}

In chrome or IE browser, I could load this .html file very well when this html file and mark_info4.xml were in raspberryPi; /var/www/.
but when I moved them to usb or c:/abc, only blank map was loaded and didn't parsing.. I changed url(bolded part) to 'E:/mark_info4.xml' and 'c:/abc/mark_info4.xml' but it didn't work.

This is php code at https://developers.google.com/maps/articles/phpsqlajax_v3#putting-it-all-together.

<?php
$username="xxxx";
$password="xxx";
$database="xxx";
?>
<?php

function parseToXML($htmlStr)
{
$xmlStr=str_replace('<','&lt;',$htmlStr);
$xmlStr=str_replace('>','&gt;',$xmlStr);
$xmlStr=str_replace('"','&quot;',$xmlStr);
$xmlStr=str_replace("'",'&#39;',$xmlStr);
$xmlStr=str_replace("&",'&amp;',$xmlStr);
return $xmlStr;
}

// Opens a connection to a MySQL server
$connection=mysql_connect ('localhost', $username, $password);
if (!$connection) {
  die('Not connected : ' . mysql_error());
}

// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
}

// Select all the rows in the markers table
$query = "SELECT * FROM markers WHERE 1";
$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}

header("Content-type: text/xml");

// Start XML file, echo parent node
echo '<markers>';

// Iterate through the rows, printing XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
  // ADD TO XML DOCUMENT NODE
  echo '<marker ';
  echo 'name="' . parseToXML($row['name']) . '" ';
  echo 'address="' . parseToXML($row['address']) . '" ';
  echo 'lat="' . $row['lat'] . '" ';
  echo 'lng="' . $row['lng'] . '" ';
  echo 'type="' . $row['type'] . '" ';
  echo '/>';
}

// End XML file
echo '</markers>';

?>

This php file(phpsqlajax_genxml.php) makes a xml file. but there is no 'phpsqlajax_genxml.xml' file. I can't find it every directory

why? and how can I find it or make a 'phpsqlajax_genxml.xml' file?? please help me..

I want to mark some data on google map.
I use eclipse Java EE and xml file is in the same workspace;(workspace_jsp).

xml file:

<csv_data>
<row>
<time>10:01:43</time>
<latitude>37.4805016667</latitude>
<longitude>126.952741667</longitude>
<pdistance>0.000555</pdistance>
<totaldistance>0.000555</totaldistance>
<sectionspray>3343.0</sectionspray>
</row>
<row>
<time>10:01:57</time>
<latitude>37.4807483333</latitude>
<longitude>126.952753333</longitude>
<pdistance>0.027396</pdistance>
<totaldistance>0.027951</totaldistance>
<sectionspray>3320.0</sectionspray>
</row>

my code is

<!DOCTYPE html >
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>PHP/MySQL & Google Maps Example</title>
    <script src="https://maps.googleapis.com/maps/api/js?key=~~~~"
            type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[

    var customIcons = {
      restaurant: {
        icon: 'http://labs.google.com/ridefinder/images/mm_20_blue.png'
      },
      bar: {
        icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png'
      }
    };

    function load() {
      var map = new google.maps.Map(document.getElementById("map"), {
        center: new google.maps.LatLng(37.466285,126.948366),
                zoom: 10,
        mapTypeId: 'roadmap'
      });
      var infoWindow = new google.maps.InfoWindow;

      // Change this depending on the name of your PHP file
      downloadUrl("mark_info.xml", function(data) {
        var xml = data.responseXML;
        var markers = xml.documentElement.getElementsByTagName("/csv_data/row");
        for (var i = 0; i < markers.length; i++) {
          var time = markers[i].getAttribute("time");
          var ss = markers[i].getAttribute("sectionspray");
          var pd = markers[i].getAttribute("pdistance");
          var td = markers[i].getAttribute("totaldistance");
          var point = new google.maps.LatLng(
              parseFloat(markers[i].getAttribute("latitude")),
              parseFloat(markers[i].getAttribute("longitude")));
          var html = "<b>" + time + "</b> <br/>" + ss + pd + td;
          var icon = customIcons[pd] || {};
          var marker = new google.maps.Marker({
            map: map,
            position: point,
            icon: icon.icon
          });
          bindInfoWindow(marker, map, infoWindow, html);
        }
      });
    }

    function bindInfoWindow(marker, map, infoWindow, html) {
      google.maps.event.addListener(marker, 'click', function() {
        infoWindow.setContent(html);
        infoWindow.open(map, marker);
      });
    }

    function downloadUrl(url, callback) {
      var request = window.ActiveXObject ?
          new ActiveXObject('Microsoft.XMLHTTP') :
          new XMLHttpRequest;

      request.onreadystatechange = function() {

          if (request.readyState == 4) {
              request.onreadystatechange = doNothing;
              callback(request, request.status);
            }
          };

          request.open('GET', url, true);
          request.send(null);
        } ...

I have a basic question.

I collected some gps signal to some columns by python code.

I want to read them and use some data in html-javascript. In this case, what kind of file is the easiest to read and use in html/javascript??

I made a text file but people said it's not good in safe and operating, so I made a json file but I don't know how to read it in html/javascript

Help me..

I made a json file and its contents are like these.

[{"pdis": "pdistance", "time": "time", "lon": "longitude", "tdis": "totaldistance", "secsp": "sectionspray", "lat": "latitude"}, {"pdis": "0.000555", "time": "10:01:43", "lon": "126.952741667", "tdis": "0.000555", "secsp": "3343.0", "lat": "37.4805016667"}, {"pdis": "0.027396", "time": "10:01:57", "lon": "126.952753333", "tdis": "0.027951", "secsp": "3320.0", "lat": "37.4807483333"},~~~,{"~~~~~"}]

I want to read and save them in javascript array as

pdis       time        lon            tds        secsp     lat
0.000555   10:01:43    126.95274      0.000555   3343.0    37.4805
0.027396   10:01:57    126.95275      0.02795    3320.0    37.4807

How can I do that? please advice me or recommend some sites or pages..

My object: Take latitude, longitude columns from textfile(.txt) and mark them on googlemap api v3.

For the first step, I made a code for reading textfile by javascript and html. When I run this code, chrome and IE browser open well but nothing happened. javascript part don't work. How can I fix it?

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript">
    var fso=new ActiveXObject("Scripting.FileSystemObject");
    var filename="C:\\text.txt";
    function savefile() {
        if (!fso.FileExists(filename)) {
            fso.CreateTextFile(filename,true);
        }
        var 
f=fso.OpenTextFile(filename,2,true);

f.Write(myarea.innerHTML);
        f.Close();
    }
    function loadfile() {

if (!fso.FileExists(filename)) {

fso.CreateTextFile(filename,true);

}
        var f=fso.OpenTextFile(filename,1);
        r=f.ReadAll();
        f.Close();
        myarea.innerHTML=r;
    }

function window.onload() {
        loadfile(filename);

}
</script>
<div id=myarea contenteditable=true 
style="width:320;height:240;border:solid 2 
inset;overflow:scroll;background-color:silver;"></div>
<br><input 
type=button value=load onclick=loadfile()><input type=button value=save 
onclick=savefile()>
</body>
</html>

text.txt => (delimiter = " ")

year class sex a b c d
1 1 f 90 80 60 100 
1 1 m 90 80 60 100 
1 2 f 90 70 60 100 
2 1 f 100 80 60 100 
3 1 m 90 99 60 100

Hello, my code is like that

<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google Map API V3 with markers</title> <style type="text/css">
 body { font: normal 10pt Helvetica, Arial; }
 #map { width: 350px; height: 300px; border: 0px; padding: 0px; }
 </style> <script src="$aa.$bb/maps/api/js?v=3&sensor=false" type="text/javascript"></script> <script type="text/javascript">
 //Sample code written by August Li
 var icon = new google.maps.MarkerImage("**http://maps.google.com/mapfiles/ms/micons/blue.png**",
 new google.maps.Size(32, 32), new google.maps.Point(0, 0),
 new google.maps.Point(16, 32));
 var center = null;
 var map = null;
 var currentPopup;
 var bounds = new google.maps.LatLngBounds();

bolded part is problem..

after "// ", "maps.google.com/mapfiles/ms/micons/blue.png" is presented as comment.

I want to draw trace of car and mark and infowindow by using googlemap api and php. when I write url like "http://maps.google.com/maps/api/js?v=3&sensor=false", after "//", it's just comment not url and it occurs File does not exist: /var/www/maps.google.com problem... I tried $aa = "http:/"; $bb = "/maps.google.com"; $aa.$bb/maps/~~~ but not works... How can I fix it?? please help me..