title: Google Maps - maintain current position and zoom when reloading dynamic map pointers
body: <p>I have been searching high and low for a solution to this problem. I fetch dynamic positions of markers and show the map positioned and zoomed baased on the City that has been selected in my application. If I then scroll or zooom the Google map and then request an update of the markers position (by fetching the xml) I loose the new position and zoom I was at. How do I make the function check what the current getCenter and getZoom is to use in the reload of the map ?</p>
  
  <pre><code>function load() {
  
   if(map) { // Does not work
    var lat = map.getCenter().lat();  
       var lng = map.getCenter().lng();
        var zoom = map.getZoom();
   } else {
    var lat = '&lt;?=$Lat?&gt;';
    var lng = '&lt;?=$Lon?&gt;';
    var zoom = &lt;?=$zoom?&gt;;
   }
   var map_options = {
    center: new google.maps.LatLng(lat,lng),
    zoom: zoom,
    mapTypeId: '&lt;?=$map_type?&gt;'
   };
  
   var map = new google.maps.Map(document.getElementById("map"), map_options);
   var infoWindow = new google.maps.InfoWindow;
  
      &lt;&lt; Other marker creating code here that works fine &gt;&gt;
  
  }
  </code></pre>