diff --git a/src/js/osm-directive.js b/src/js/osm-directive.js index 7ad4127..4faeeae 100644 --- a/src/js/osm-directive.js +++ b/src/js/osm-directive.js @@ -112,7 +112,7 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() observacion = '
' + observacion + '
'; var compiledHtml = $compile(angular.element(observacion))($scope); //Primero verifico si punto de desscarga, si lo hay extraigo lat y long desde alli - if (marcador.remitoPuntoDescarga.length) { + if (marcador.remitoPuntoDescarga) { $scope.markers.push( L.marker( [marcador.remitoPuntoDescarga.puntoDescarga[0].latitud, @@ -124,7 +124,7 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() } //Si no existe punto de descarga, se selecciona la primera direccion //con latitud y longitud desde los Datos del cliente. - else if (marcador.cliente.direcciones.length) { + else if (marcador.cliente.direcciones) { $scope.markers.push( L.marker( [marcador.cliente.direcciones[0].DATO, @@ -133,8 +133,6 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() .bindPopup(compiledHtml[0]) .bindTooltip('Haga click para seleccionar') ); - } else { - console.log('Los remitos filtrados no contienen datos de latitud y longitud',marcador); } //abre marcador del primer punto //$scope.markers[0].openPopup();