Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3848 → Rev 3849

/trunk/widget/modules/saisie/squelettes/js/tb-geoloc/js/Geoloc.js
155,9 → 155,7
this.initMap();
this.handleCoordinates();
this.onCoordinates();
if('point' === this.geometryFilter) {
this.initSearchLocality();
}
this.initSearchLocality();
};
 
Geoloc.prototype.initMap = function() {
284,7 → 282,7
const lthis = this;
// move marker on click
$(this.map).off('click').on('click', function(evt) {
lthis.handleNewLocation(evt.latlng);
lthis.handleNewLocation(evt.originalEvent.latlng);
});
// move marker on drag
$(this.map.marker).off('dragend').on('dragend', function() {
322,12 → 320,20
coordinates = this.formatCoordinates(coordinates);
 
if(!!coordinates && !!coordinates.lat && coordinates.lng) {
this.zoom = 20;
this.setMapCoordinates(coordinates);
 
if('point' === this.geometryFilter) {
this.createDraggableMarker();
this.handleMarkerEvents();
}
this.getLocationInfo(coordinates, polyline);
 
if (
('rue' === this.geometryFilter && 0 < polyline.length) ||
('point' === this.geometryFilter && 0 === polyline.length)
) {
this.getLocationInfo(coordinates, polyline);
}
}
};
 
353,7 → 359,7
Geoloc.prototype.setMapCoordinates = function (coordinates) {
this.coordinates = coordinates;
// updates map
this.map.setView(coordinates);
this.map.setView(coordinates,this.zoom);
};
 
Geoloc.prototype.createDraggableMarker = function() {
504,7 → 510,10
'lng' : localityData.lon
};
 
this.map.removeControl(this.drawControl);
if ('point' === this.geometryFilter) {
this.map.removeControl(this.drawControl);
}
this.zoom = 18;
this.handleNewLocation(coordinates);
}
};