Skip to content

Instantly share code, notes, and snippets.

@deciob
Created September 7, 2012 16:00
Show Gist options
  • Save deciob/3667410 to your computer and use it in GitHub Desktop.
Save deciob/3667410 to your computer and use it in GitHub Desktop.
ol geonames search
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