@@ -24,8 +24,8 @@ OSM.Directions = function (map) {
24
24
} ;
25
25
26
26
const endpoints = [
27
- OSM . DirectionsEndpoint ( map , $ ( "input[name='route_from']" ) , { icon : "MARKER_GREEN " } , endpointDragCallback , endpointChangeCallback ) ,
28
- OSM . DirectionsEndpoint ( map , $ ( "input[name='route_to']" ) , { icon : "MARKER_RED " } , endpointDragCallback , endpointChangeCallback )
27
+ OSM . DirectionsEndpoint ( map , $ ( "input[name='route_from']" ) , { color : "#9cef11 " } , endpointDragCallback , endpointChangeCallback ) ,
28
+ OSM . DirectionsEndpoint ( map , $ ( "input[name='route_to']" ) , { color : "#f6110a " } , endpointDragCallback , endpointChangeCallback )
29
29
] ;
30
30
31
31
const expiry = new Date ( ) ;
@@ -156,14 +156,18 @@ OSM.Directions = function (map) {
156
156
getRoute ( true , true ) ;
157
157
} ) ;
158
158
159
- $ ( ".routing_marker_column img " ) . on ( "dragstart" , function ( e ) {
159
+ $ ( ".routing_marker_column svg " ) . on ( "dragstart" , function ( e ) {
160
160
const dt = e . originalEvent . dataTransfer ;
161
161
dt . effectAllowed = "move" ;
162
- const dragData = { type : $ ( this ) . data ( "type" ) } ;
163
- dt . setData ( "text" , JSON . stringify ( dragData ) ) ;
162
+ const jqthis = $ ( this ) ;
163
+ dt . setData ( "text" , JSON . stringify ( jqthis . data ( ) ) ) ;
164
164
if ( dt . setDragImage ) {
165
- const img = $ ( "<img>" ) . attr ( "src" , $ ( e . originalEvent . target ) . attr ( "src" ) ) ;
165
+ const img = jqthis . clone ( )
166
+ . toggleClass ( "img-fluid position-absolute bottom-100 end-100" )
167
+ . attr ( { width : "25" , height : "40" } )
168
+ . appendTo ( document . body ) ;
166
169
dt . setDragImage ( img . get ( 0 ) , 12 , 21 ) ;
170
+ setTimeout ( ( ) => img . remove ( ) , 0 ) ;
167
171
}
168
172
} ) ;
169
173
0 commit comments