Commit 58552da156b5fa82e2adfae51e99f4315d179c7c

Authored by Luis Suarez
1 parent 719ab7c849
Exists in develop

valido marcadores para nota de pedido

Showing 1 changed file with 26 additions and 7 deletions   Show diff stats
src/js/osm-directive.js
... ... @@ -60,13 +60,32 @@ angular.module('focaAdminSeguimiento').directive('osm', function() {
60 60 // if (marcador.visita) icon.options.iconUrl = 'img/marker-icon-2x-yellow.png';
61 61  
62 62 if (observacion) {
63   - $scope.markers.push(
64   - L.marker(
65   - [marcador.latitud, marcador.longitud],
66   - {icon: icon}).addTo($scope.map)
67   - .bindPopup(observacion)
68   - );
69   -
  63 + if ($scope.parametros.actividad === 'Nota de pedido') {
  64 + if (marcador.cliente.puntoDescarga) {
  65 + $scope.markers.push(
  66 + L.marker(
  67 + [marcador.cliente.puntoDescarga[0].latitud,
  68 + marcador.cliente.puntoDescarga[0].longitud],
  69 + {icon: icon}).addTo($scope.map)
  70 + .bindPopup(observacion)
  71 + );
  72 + } else if (marcador.cliente.direcciones) {
  73 + $scope.markers.push(
  74 + L.marker(
  75 + [marcador.cliente.direcciones[0].DATO,
  76 + marcador.cliente.direcciones[1].DATO],
  77 + {icon: icon}).addTo($scope.map)
  78 + .bindPopup(observacion)
  79 + );
  80 + }
  81 + } else {
  82 + $scope.markers.push(
  83 + L.marker(
  84 + [marcador.latitud, marcador.longitud],
  85 + {icon: icon}).addTo($scope.map)
  86 + .bindPopup(observacion)
  87 + );
  88 + }
70 89 $scope.markers[0].openPopup();
71 90 }
72 91 });