add outline code to get form for stop
This commit is contained in:
parent
23d074b141
commit
9c104e8fca
|
@ -78,11 +78,28 @@ $(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
function getStopsList(stops) {
|
function getStopsList(stops) {
|
||||||
var $ul = $('<ul />').addClass("stopsList");
|
var $ul = $('<ul />').addClass("stopsList").click(function(e) {
|
||||||
|
var $target = $(e.target);
|
||||||
|
if ($target.hasClass("selectedStop")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$('.selectedStop').removeClass("selectedStop");
|
||||||
|
$target.addClass("selectedStop");
|
||||||
|
var props = $target.data("properties");
|
||||||
|
var $form = getStopForm(props);
|
||||||
|
$('#formCol').empty();
|
||||||
|
$('#formCol').append($form);
|
||||||
|
});
|
||||||
$.each(stops, function(i,v) {
|
$.each(stops, function(i,v) {
|
||||||
var props = v.properties;
|
var props = v.properties;
|
||||||
var geom = v.geometry;
|
var geom = v.geometry;
|
||||||
var $li = $('<li />').addClass("stopItem").data("slug", props.slug).data("geometry", geom).text(props.display_name).appendTo($ul);
|
var $li = $('<li />').addClass("stopItem").data("slug", props.slug).data("properties", props).data("geometry", geom).text(props.display_name).appendTo($ul);
|
||||||
});
|
});
|
||||||
return $ul;
|
return $ul;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getStopForm(stop) {
|
||||||
|
var $div = $('<div />');
|
||||||
|
var $displayName = $('<div />').text(stop.display_name).appendTo($div);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user