I'm using a different localsearch control but I can get a listener
that responds to "Clear Results" to re-center and re-zoom the map back
to my defaults:

GEvent.addListener(marker, "infowindowclose", function() {map.setCenter
(mapCenter, mapZoomLevel);});

I think if you do that but also add map.openInfoWindowHtml
(formatted_address) to get your infowindow back.

I'm using google.maps.LocalSearch() instead of the GoogleBar, so it
might not work the same, but I get the "infowindowclose" event when I
click on "Clear Results" or if I close an infowindow that was not
opened by the search control. If the infowindow was opened by the
search control, just closing it without clicking "Clear Results"
doesn't trigger the event.

You can see the implementation at
http://www.healthypetmobilevet.com/area.shtml
though the scripts are not in the html; look at
http://www.healthypetmobilevet.com/map.js
for the javascript if you want.

-Brian

On Aug 8, 3:58 am, Sawtooth500 <[email protected]> wrote:
> On Aug 8, 2:27 am, "[email protected]" <[email protected]>
> wrote:
>
>
>
> > On Aug 7, 8:37 pm, Sawtooth500 <[email protected]> wrote:
>
> > > Reference:
>
> > >http://rent2ownsb.com/map.php?pid=1&address=55151+Moss+Rd.,+South+Ben...
>
> > > So as you can see, I have local search in the bottom left. Also, there
> > > is an info box showing the property that comes up when you first load
> > > the page.
>
> > > So if someone does a local search, it erases the infobox showing the
> > > property. The marker for the property remains. Is there a way so that
> > > when someone hits "clear results" on the search that the property info
> > > box comes back? Thanks!
>
> > Yes,  you can even make it so that if someone clicks on the marker,
> > the infoWindow comes back.  See Mike Williams' 
> > tutorial:http://econym.org.uk/gmap/
>
> >   -- Larry
>
> Ok, so I think I want to use the function onIdleCallback, but what
> would the syntax for me using that be? I apologize, but I'm trying
> really hard to learn javascript here and get this done, so I really
> appreciate the help.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to