Hi Brendanc-
There's no way currently to do this, you'd have to use the raw Local Search
API. We are working on improvements to the GoogleBar now, though, so please
file a feature request for this ability in the issue tracker, and we'll look
into supporting that kind of customization in the future.
- pamela
On Fri, Oct 10, 2008 at 5:18 PM, Brendanc <[EMAIL PROTECTED]>wrote:
>
> Hi Pamela,
> That page is very helpful.
> However there is one bit of functionality that might go a lonmg way to
> improve the success of the GoogleBar.
> I am using traditional geocoding on my Gmap through a form, and I have
> customised searches on this form so that all searches are based on my
> locality.
> Using JavaScript I have a default hidden value of " Dublin Ireland".
> Therefore whatever is typed into the box will always contain the
> string " Dublin Ireland" at the end, and this is unknown to the User.
> This takes away the age-old problem of ambiguous searches for
> placenames in Ireland.
>
> The GoogleBar does not seem as easy to customize.
> Is it possible to build in functionality where the search box in the
> GoogleBar will contain a hidden search suffix, like the " Dublin
> Ireland" example outlined above.
> I'd appreciate any help with this.
>
> Thanks Pamela & co.
>
> Brendan
>
>
> My current "form" geocoding sample is as follows:
>
> // Start of GeoCoding - Brendan C
> // ====== Create a Client Geocoder ======
> var dublin= ' Dublin Ireland';
> function showAddressDublin(search)
> { showAddress(search + dublin)
>
> }
>
> var geo = new GClientGeocoder();
>
> // ====== Array for decoding the failure codes ======
> var reasons=[];
> reasons[G_GEO_SUCCESS] = "Success";
> reasons[G_GEO_MISSING_ADDRESS] = "Missing Address: The
> address was either missing or had no value.";
> reasons[G_GEO_UNKNOWN_ADDRESS] = ". Please check your
> spelling or refine your address search with more detail (eg, 'Main
> Street Ballyhale' instead of 'Main Street').";
> reasons[G_GEO_UNAVAILABLE_ADDRESS]= "Unavailable Address: The
> geocode for the given address cannot be returned due to legal or
> contractual reasons.";
> reasons[G_GEO_BAD_KEY] = "Bad Key: The API key is
> either invalid or does not match the domain for which it was given";
> reasons[G_GEO_TOO_MANY_QUERIES] = "Too Many Queries: The daily
> geocoding quota for this site has been exceeded.";
> reasons[G_GEO_SERVER_ERROR] = "Server error: The geocoding
> request could not be successfully processed.";
>
> // ====== Plot a marker after positive reponse to "did you
> mean" ======
> function place(lat,lng) {
> var point = new GLatLng(lat,lng);
> map.setCenter(point,14);
> // map.addOverlay(new GMarker(point));
> document.getElementById("message").innerHTML = "";
> }
>
> // ====== Geocoding ======
> function showAddress() {
> var search = document.getElementById("search").value + dublin;
> // ====== Perform the Geocoding ======
> geo.getLocations(search, function (result)
> {
> map.clearOverlays();
> if (result.Status.code == G_GEO_SUCCESS) {
> // ===== If there was more than one result, "ask did you
> mean" on them all =====
> if (result.Placemark.length > 1) {
> document.getElementById("message").innerHTML = "Did
> you mean:";
> // Loop through the results
> for (var i=0; i<result.Placemark.length; i++) {
> var p = result.Placemark[i].Point.coordinates;
> document.getElementById("message").innerHTML +=
> "<br>"+(i+1)+": <a href='javascript:place(" +p[1]+","+p[0]+")'>"+
> result.Placemark[i].address+"</a>";
> }
> }
>
>
>
>
>
>
> On Sep 25, 12:55 am, "pamela (Google Employee)" <[EMAIL PROTECTED]>
> wrote:
> > Hi Yutaka -
> >
> > Play with this explorer:
> http://gmaps-samples.googlecode.com/svn/trunk/googlebar/googlebaropti...
> >
> > It should give you the answer re the default text question.
> >
> > - pamela
> >
> > On Sep 24, 4:22 pm, yutaka <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > I have this carpool application and registration page, where user type
> > > start location and destination and so on.
> http://apps.facebook.com/carpoolz/AddTripv1
> > > (need to login to actually add data)
> >
> > > I used google map so that people can fill in information easily.
> >
> > > To do that, user need to
> > > 1. Type in location in google bar and click search.
> > > 2. Marker will show popup html says set as destination or start point.
> >
> > > However,,,,
> > > In my application case, default google bar is not obvious to many
> > > people that it is the place to search location. So, I want to
> > >customizeit to make it more like user would type in location. Maybe
> > > make it larger and have a default text says "type in your location".
> > > From Google Map API Reference page, I don't see anything I can use to
> > >customizeGoogle Bar default UI except shownOnLoad. Others are not for
> > > UI.
> >
> > > I directly try tocustomizeby setting value of gsc-input, but could
> > > not do.
> >
> > > Is it possible to set value of google bar on map?
> > > Or any suggestion to improve UI is appreciated.
> >
> > > thanks
> > > -yutaka- Hide quoted text -
> >
> > - Show quoted text -
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---