title: update position of geolocation marker in Openlayers 3
body: <p>I wan't to have a marker on the map, which position is dynamically updated.
  When I create the layer inside the function of the geolocation.on('change'-event it works, but the layer is added each time the geolocation changes. Therefore I wanted to create the layer outside that function and update only the position of the marker.</p>
  
  <p>With the folowing code I get an 'TypeError: a is null'</p>
  
  <pre><code>var geolocation = new ol.Geolocation({
    projection: map.getView().getProjection(),
    tracking: true,
    trackingOptions: {
      enableHighAccuracy: true,
      maximumAge: 2000  
    }
  });     
  
  var iconStyle = new ol.style.Style({
    image: new ol.style.Icon({
      anchor: [0.5, 46],
      anchorXUnits: 'fraction',
      anchorYUnits: 'pixels',
      opacity: 0.75,
      src: './_img/marker_.png'
    })
  });
  
  var pos1 = geolocation.getPosition();
  
  var iconFeature = new ol.Feature({
     geometry: new ol.geom.Point(pos1)
  });         
  var iconSource = new ol.source.Vector({
    features: [iconFeature]
  });
  var iconLayer = new ol.layer.Vector({
    source: iconSource,
    style : iconStyle
  });
  
  map.addLayer(iconLayer);
  
  geolocation.on('change', function() {
    var pos_upd = geolocation.getPosition();
    iconFeature.getGeometry().setCoordinates(pos_upd);
    view.setCenter(pos_upd);
    view.setZoom(18);        
  }); 
  </code></pre>