Created
September 7, 2012 16:00
-
-
Save deciob/3667410 to your computer and use it in GitHub Desktop.
ol geonames search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var setup_find_places = function() { | |
var search_container = $j("#searchResultsContainer"); | |
var place_input = $j("#placeName"); | |
var placeholder_place = place_input.val(); | |
place_input.focus(function() { | |
if (place_input.val() == placeholder_place) { | |
place_input.val(""); | |
} | |
}); | |
$j("#search-form").submit(function(e) { | |
var search_text = place_input.val(); | |
if (that.search(search_text)) { | |
search_container.css("display", "block"); | |
} | |
return false; | |
}); | |
$j("#search-close").click(function() { | |
search_container.css("display", "none"); | |
return false; | |
}); | |
}; | |
place_searcher(that, | |
{geonames_url: config.geonames_url, | |
results_dom_id: "search-results", | |
allow_lat_lon: true, | |
results_per_page: 10, | |
add_place_marker: add_place_marker}, | |
my); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment