title: Google Maps - Map reload
body: <p>I have the following code setup to apply a map for a variety of areas</p>
  
  <pre><code>var locations = [
    ['Liver Office - Liverpool Office', 53.40529, -2.988801, 1],
    ['Lond office - London Office', 51.515026, -0.086811, 2],
  
  ];
  function plotMap(loc) {  
  
  var mapOptions = {
      zoom: 17,
      center: new google.maps.LatLng((locations[loc][1]), (locations[loc][2])),
      stylers: [
      { saturation: -100 } // &lt;-- THIS
    ]
  };
  
  var map = new google.maps.Map(document.getElementById('map'),
  
    mapOptions);
  
  var marker = new google.maps.Marker({
      position: map.getCenter(),
      map: map,
       mapTypeControlOptions: {
       mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'tehgrayz']
      },
      icon: 'marketICO.png',
      title: (locations[loc][0])
  });
  
  var infowindow = new google.maps.InfoWindow();
      google.maps.event.addListener(marker, 'click', (function(marker) {
      return function() {
        infowindow.setContent(locations[loc][0]);
        infowindow.open(map, marker);
      }
    })(marker, loc));
  }
  
  $('.livLink').click(function(){
      plotMap(0);
  });
  $('.lonLink').click(function(){
      plotMap(1);
  });
      plotMap(0);
  </code></pre>
  
  <p>Regarding reloading the map - at the moment the above script is triggered by 2 tab buttons - if a map is loaded and the second button is clicked the script re-runs and replaces the existing map - I'm just thinking of memory issues - should the initial map instance be stopped before loading a second?</p>