-OSM.Directions = function (map, name, jqSearch) {
- var r = {};
-
- TURN_INSTRUCTIONS = [
- "",
- I18n.t('javascripts.directions.instructions.continue_on'), // 1
- I18n.t('javascripts.directions.instructions.slight_right'), // 2
- I18n.t('javascripts.directions.instructions.turn_right'), // 3
- I18n.t('javascripts.directions.instructions.sharp_right'), // 4
- I18n.t('javascripts.directions.instructions.uturn'), // 5
- I18n.t('javascripts.directions.instructions.sharp_left'), // 6
- I18n.t('javascripts.directions.instructions.turn_left'), // 7
- I18n.t('javascripts.directions.instructions.slight_left'), // 8
- I18n.t('javascripts.directions.instructions.via_point'), // 9
- I18n.t('javascripts.directions.instructions.follow'), // 10
- I18n.t('javascripts.directions.instructions.roundabout'), // 11
- I18n.t('javascripts.directions.instructions.leave_roundabout'), // 12
- I18n.t('javascripts.directions.instructions.stay_roundabout'), // 13
- I18n.t('javascripts.directions.instructions.start'), // 14
- I18n.t('javascripts.directions.instructions.destination'), // 15
- I18n.t('javascripts.directions.instructions.against_oneway'), // 16
- I18n.t('javascripts.directions.instructions.end_oneway') // 17
- ];
+ endpoint.marker.on('drag dragend', function (e) {
+ dragging = (e.type == 'drag');
+ if (dragging && !chosenEngine.draggable) return;
+ if (dragging && awaitingRoute) return;
+ endpoint.setLatLng(e.target.getLatLng());
+ if (map.hasLayer(polyline)) {
+ getRoute();
+ }
+ });