title: Ionic Google Maps controller not restarting
body: <p>I have a list, and everytime I click on the list, I go to another tab which contains the map and shows the marker, but everytime I click on the list, it will add another marker, instead of refreshing the map and showing only one.</p>
  
  <p>This is the code of my controller.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>app.controller('mapCtrl', function($scope, $stateParams, $timeout, animalListServ) {
  
   $scope.$on('$ionicView.enter', function(e) {
     var map;
     var mostrar = false;
  
     console.log("llegamos");
     var paramLongitude = $stateParams.longitude;
     var paramLatitude = $stateParams.latitude;
     var paramHealth = $stateParams.health;
  
     console.log(paramLongitude);
     console.log(paramLatitude);
     console.log(paramHealth);
  
     $timeout(function() { $scope.showMap(); }, 1000);
  
    $scope.showMap = function() {
     document.addEventListener("deviceready", function() {
      var div = document.getElementById("map");
  
      //Initiate the map view
      map = plugin.google.maps.Map.getMap(div);
  
      map.addEventListener(plugin.google.maps.event.MAP_READY, onMapReady);
     }, false)
    };
  
     function onMapReady() {
  
      var canvas = document.createElement('canvas');
      canvas.width = 200;
      canvas.height = 100;
      var context = canvas.getContext('2d');
  
      var img = new Image();
      // img.src = array[i].image;
      img.src = 'img/dogstreet.jpg';
  
  
      img.onload = function() {
  
        context.drawImage(img, 0, 5, 90, 90);
  
        context.font = '12pt Calibri';
        // context.fillStyle = 'black';
        context.fillText(paramHealth, 95, 15);
        context.fillText('09/09/2016', 95, 45);
  
        var myLatlng = new plugin.google.maps.LatLng(paramLatitude, paramLongitude);
  
        $scope.savedMarker = map.addMarker({
         position: myLatlng,
         title: canvas.toDataURL()
         
        }, function(marker) {
          marker.addEventListener(plugin.google.maps.event.MARKER_CLICK, function() {
           console.log("llegamos aqui?")
           marker.showInfoWindow();
          });
         });
      };
  
     }
  
   });
  });</code></pre>
  </div>
  </div>
  </p>