Start work on drag-and-drop start/end markers

This commit is contained in:
Richard Fairhurst 2014-01-23 00:49:00 +00:00
parent d40d32889c
commit 08837b2f8b
4 changed files with 13 additions and 0 deletions

View file

@ -356,6 +356,8 @@ $(document).ready(function () {
$(".search").hide();
$(".routing").show();
$(".query_wrapper.routing [name=route_from]").focus();
$("#map").on('dragend dragover',function(e) { e.preventDefault(); });
$("#map").on('drop',function(e) { OSM.routing.handleDrop(e); });
});
$(".close_directions").on("click",function(e) {
@ -363,6 +365,7 @@ $(document).ready(function () {
$(".search").show();
$(".routing").hide();
OSM.routing.close();
$("#map").off('dragend drop dragover');
$(".query_wrapper.search [name=query]").focus();
});

View file

@ -88,6 +88,12 @@ OSM.Routing=function(map,name,jqSearch) {
r.requestRoute();
}
};
// Drag and drop markers
r.handleDrop=function(e) {
console.log(r.map.mouseEventToLatLng(e.originalEvent))
};
// Route-fetching UI