Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3847 → Rev 3848

/trunk/widget/modules/saisie/squelettes/js/tb-geoloc/js/Geoloc.js
322,7 → 322,11
coordinates = this.formatCoordinates(coordinates);
 
if(!!coordinates && !!coordinates.lat && coordinates.lng) {
this.setMapPosition(coordinates);
this.setMapCoordinates(coordinates);
if('point' === this.geometryFilter) {
this.createDraggableMarker();
this.handleMarkerEvents();
}
this.getLocationInfo(coordinates, polyline);
}
};
346,24 → 350,13
return polyline;
};
 
Geoloc.prototype.setMapPosition = function (coordinates) {
const latLng = new L.LatLng(coordinates.lat, coordinates.lng);
 
 
Geoloc.prototype.setMapCoordinates = function (coordinates) {
this.coordinates = coordinates;
if('point' === this.geometryFilter) {
this.createDraggableMarker(latLng);
this.handleMarkerEvents();
}
// updates map
this.map.setView(latLng);
this.map.setView(coordinates);
};
 
Geoloc.prototype.createDraggableMarker = function(latLng) {
if (undefined === latLng) {
latLng = new L.LatLng(this.coordinates.lat, this.coordinates.lng);
}
 
Geoloc.prototype.createDraggableMarker = function() {
if (undefined === this.map.marker) {
// after many attempts, did not manage
// to make marker from draw control draggable
382,7 → 375,7
}
}
 
this.map.marker.setLatLng(latLng, {draggable: 'true'});
this.map.marker.setLatLng(this.coordinates, {draggable: 'true'});
};
 
Geoloc.prototype.getLocationInfo = function(coordinates, polyline) {
/trunk/widget/modules/saisie/squelettes/js/WidgetsSaisiesCommun.js
736,7 → 736,7
this.geoloc.reSetDrawControl();
}
 
this.geoloc.setMapPosition({'lat': latitude, 'lng': longitude});
this.geoloc.setMapCoordinates({'lat': latitude, 'lng': longitude});
};
 
// Ajouter Obs ****************************************************************/