title: Changing Google Maps V3 Maker Icon the correct way?
body: <p>The code in example 1 works. I would like to understand the marker.setIcon(); function more (new to JavaScript also).</p>
  
  <p>My question is. In the documentation for Google maps you see something like this for changing the marker.</p>
  
  <pre><code>MarkerImage(url:string, size?:Size, origin?:Point, anchor?:Point, scaledSize?:Size)
  </code></pre>
  
  <p>How does this relate to what I have done in example 1 for setting up marker Icon, shoud I have done somethign like this instead?</p>
  
  <pre><code>marker = google.maps.MarkerImage({
          url: "newIcon.png"
  });
  
  marker.setIcon(marker);
  </code></pre>
  
  <p>and would that have worked?</p>
  
  <p>here is my example</p>
  
  <p>Example 1</p>
  
  <pre><code>function initialize(){
  //MAP
  
    var latlng = new google.maps.LatLng('xxx','xxx');
    var options = {
      zoom: 16,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.SATELLITE
    };
  
    map = new google.maps.Map(document.getElementById("map_canvas"), options);
  
    //GEOCODER
    geocoder = new google.maps.Geocoder();
  
    marker = new google.maps.Marker({
      map: map,
      draggable: true
    });     
  
    marker.setPosition(latlng);
    marker.setIcon("newIcon.png");
    map.setCenter(latlng);
  
  }
  </code></pre>