Commit 6416e07b007bdfe85eafd82735439966ba9b9278

Authored by Eric Fernandez
Exists in master and in 1 other branch develop

Merge branch 'master' into 'develop'

Master

See merge request !15
src/js/osm-directive.js
... ... @@ -5,7 +5,7 @@ angular.module('focaModalPuntoDescarga').directive('osmPuntoDescarga', function(
5 5 var contenedor = document.createElement('div');
6 6 contenedor.className = 'w-100 h-50 mt-3';
7 7 el.append(contenedor);
8   - scope.map = L.map(contenedor).setView([-32.89214159952345, -68.84572999101856], attrs.zoom);
  8 + scope.map = L.map(contenedor);
9 9 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(scope.map);
10 10 },
11 11 controller: ['$scope', '$timeout', function($scope, $timeout) {
... ... @@ -19,8 +19,9 @@ angular.module('focaModalPuntoDescarga').directive('osmPuntoDescarga', function(
19 19 for(var i in $scope.markers) {
20 20 $scope.map.removeLayer($scope.markers[i]);
21 21 }
  22 + $scope.map.setView([$scope.latitud, $scope.longitud], 14);
22 23 $scope.markers.push(
23   - L.marker([$scope.latitud, $scope.longitud], {draggable: $scope.draggable})
  24 + L.marker([$scope.latitud, $scope.longitud], {draggable: true})
24 25 .addTo($scope.map)
25 26 .on('dragend', function() {
26 27 $scope.latitud = this.getLatLng().lat;
... ... @@ -33,8 +34,7 @@ angular.module('focaModalPuntoDescarga').directive('osmPuntoDescarga', function(
33 34 scope: {
34 35 latitud: '=',
35 36 longitud: '=',
36   - zoom: '=',
37   - draggable: '<'
  37 + zoom: '='
38 38 }
39 39 };
40 40 });