center map on stop when you click on it
This commit is contained in:
parent
374a8f695f
commit
7c869fd4da
|
@ -69,6 +69,8 @@ var API_BASE = "/1.0/",
|
||||||
var url = API_BASE + name + "/" + $target.find(".listItemText").text();
|
var url = API_BASE + name + "/" + $target.find(".listItemText").text();
|
||||||
$target.data("loading", true);
|
$target.data("loading", true);
|
||||||
var $loading = $('<span />').addClass("loadingSpan").text("Loading...").appendTo($target);
|
var $loading = $('<span />').addClass("loadingSpan").text("Loading...").appendTo($target);
|
||||||
|
$('#stopForm').remove();
|
||||||
|
$('#formCol').empty();
|
||||||
$.getJSON(url, {'srid': 3857}, function(obj) {
|
$.getJSON(url, {'srid': 3857}, function(obj) {
|
||||||
$loading.remove();
|
$loading.remove();
|
||||||
var stopsGeojson = obj.stops;
|
var stopsGeojson = obj.stops;
|
||||||
|
@ -370,6 +372,9 @@ var API_BASE = "/1.0/",
|
||||||
$('.selectedStop').removeClass("selectedStop");
|
$('.selectedStop').removeClass("selectedStop");
|
||||||
}
|
}
|
||||||
mapControl.select(feature);
|
mapControl.select(feature);
|
||||||
|
//map.setCenter(feature.geometry);
|
||||||
|
var lonLat = new OpenLayers.LonLat(feature.geometry.x, feature.geometry.y);
|
||||||
|
map.setCenter(lonLat);
|
||||||
}
|
}
|
||||||
|
|
||||||
//return currently selected feature or false
|
//return currently selected feature or false
|
||||||
|
|
Loading…
Reference in New Issue
Block a user