-
- return false;
- }
-
- function loadObjectList() {
- $("#browse_content").html(browseObjectList);
- $("#browse_content").find("a[data-feature-id]").click(viewFeatureLink);
-
- return false;
- }
-
- function onSelect(layer) {
- // Unselect previously selected feature
- if (selectedLayer) {
- selectedLayer.setStyle(selectedLayer.originalStyle);
- }
-
- // Redraw in selected style
- layer.originalStyle = layer.options;
- layer.setStyle({color: '#0000ff', weight: 8});
-
- // If the current object is the list, don't innerHTML="", since that could clear it.
- if ($("#browse_content").firstChild == browseObjectList) {
- $("#browse_content").removeChild(browseObjectList);
- } else {
- $("#browse_content").empty();
- }
-
- var feature = layer.feature;
-
- $("#browse_content").html(JST["templates/browse/feature"]({
- name: featureNameSelect(feature),
- url: "/browse/" + feature.type + "/" + feature.id,
- attributes: feature.tags
- }));
-
- $("#browse_content").find("a.browse_show_list").click(loadObjectList);
- $("#browse_content").find("a.browse_show_history").click(loadHistory);
-
- // Stash the currently drawn feature
- selectedLayer = layer;
- }
-
- dataLayer.on("click", function (e) {
- onSelect(e.layer);