title: Updating google map markers without reloading map and blinking
body: <p>I am doing a project where I should create a web page that shows Google map with the markers at the specified GPS coordinates. 
  The project is organized in the following way. At the server side, I have the php script that accepts HTTP request from a GPS device, receives and stores GPS coordinates in the corresponding .txt file. The php file also includes javascript/jquery code that reads the .txt file with the GPS coordinates, create new instance of Google map and put the markers on map for the user that make request in a web browser. As I am electronic hardware engineer, this is pretty new for me. The code I found reloads the map on every 5 second, but that makes the map flashing/blinking for a while on each reload. Also, if I change the zooming manually in the browser, it resets to default on each map reload. Is there any way to avoid map blinking, and update markers smoothly. In the following is the snippet of the javascript/jquery code I have.</p>
  
  <pre><code>function initialize()
      {
          mapProp = {
            center:myCenter,
            zoom:17,
            mapTypeId:google.maps.MapTypeId.ROADMAP
            };
          setInterval('mark()',5000);
      }
  
      function mark()
      {
              map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
          var file = "gps.txt";
          $.ajaxSetup({cache: false});
                  $.get(file, function(txt) { 
              var lines = txt.split("\n");
  
              for (var i=0;i&lt;lines.length;i++){
                  console.log(lines[i]);
                  var words=lines[i].split(",");
                  if ((words[0]!="")&amp;&amp;(words[1]!=""))
                  {
                      marker=new google.maps.Marker({
                            position:new google.maps.LatLng(words[0],words[1]),
                            });
                      marker.setMap(map);
                      map.setCenter(new google.maps.LatLng(words[0],words[1]));
                      map.addMarker(new MarkerOptions().position(entry.getValue()).title(entry.getKey()));
                  }
              }
              lastLength = lines.length;
              marker.setAnimation(google.maps.Animation.BOUNCE);
          });
  
      }
  
      google.maps.event.addDomListener(window, 'load', initialize);
  </code></pre>