title: marker getmap error in google maps v3
body: <p>Got some problem with the getmap in google maps v3.
  I have decalred the myMarker outside of the functions with <code>var myMarker = [];</code>     but still get this error: Uncaught TypeError: undefined is not a function.</p>
  
  <p>The problem is when i call the function Locatieknop.</p>
  
  <p>Can someone help me out ? Thanks!</p>
  
  <pre><code>function MijnLocatie() {
      displayLocation = function(position) {
        myMarker = 0,
          // Container voor de latlon locaties
          var myLatLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
  
          if (!myMarker) {
              // GPS icoon
              var image = new google.maps.MarkerImage(
                  'images/bluedot_retina.png',
                  null,
                  null,
                  new google.maps.Point(8, 8),
                  new google.maps.Size(17, 17) 
              );
  
              // Nieuwe marker aanmaken
              myMarker = new google.maps.Marker({
                  flat: true,
                  icon: image,
                  map: live.map,
                  optimized: false,
                  position: myLatLng,
                  title: 'Mijn locatie',
                  visible: true
              });
  
              // Markers updaten
          } else {
              myMarker.setPosition(myLatLng);
          }
  
      },
  
      useragent = navigator.userAgent;
  
  // IPhone en Android ondersteuning
  if (useragent.indexOf('iPhone') !== -1 || useragent.indexOf('Android') !== -1) {
      navigator.geolocation.watchPosition(
          displayLocation,
          handleError, {
              enableHighAccuracy: true,
              maximumAge: 30000,
              timeout: 27000
          }
      );
  
  // Browsers met statische locatie
  } else if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(displayLocation, handleError);
  }
  }
  
  function Locatieknop() 
  {
  try
  {
     if (!myMarker || !myMarker.getMap()) 
     {
         MijnLocatie()
     }
     else 
     {
         myMarker.setMap(null);
     }
  }
  catch(e)
  {
    MijnLocatie();
  }
  }
  </code></pre>