I am struggling with adding a search form to the map on all other pages. I used the tutorial in building a map using fusion tables as found here: http://derekeder.com/searchable_map_template/. I need to place a search field in the head of all pages.
Currently my form is as
<form action="<?php echo site_url();?>/find-a-school/" method="GET">
<input placeholder='Enter zip or city and state' type='text' />
</form>
The url passes this /#/?address=85027&radius=undefined
This is if I search by zip code.
The form I have does direct the user to the page but I need help in getting the same form thats on the main map page to work in the header as well. New to Javascript and Googles map API. Any help?
This is the code currently being used on the map page
MapsLib.prototype.addrFromLatLng = function (latLngPoint) {
var self = this;
self.geocoder.geocode({
'latLng': latLngPoint
}, function (results, status) {
if (status === google.maps.GeocoderStatus.OK) {
if (results[1]) {
$('#search_address').val(results[1].formatted_address);
$('.hint').focus();
self.doSearch();
}
} else {
alert("Geocoder failed due to: " + status);
}
});
};
MapsLib.prototype.doSearch = function () {
var self = this;
self.clearSearch();
var address = $("#search_address").val();
self.searchRadius = $("#search_radius").val();
self.whereClause = self.locationColumn + " not equal to ''";
//-----custom filters-----
//-----end of custom filters-----
self.getgeoCondition(address, function (geoCondition) {
self.whereClause += geoCondition;
self.submitSearch(self.whereClause, self.map);
});
};