Unfortunately, I don't know that there is an easy way to do this with  
the google.maps.LocalSearch control.  You could, however, add an  
onGenerateMarkerHtml callback that would set a timeout of, say, 100  
milliseconds to call map.closeInfoWindow().  Something like this would  
close the infowindow almost immediately after it was opened:

lsc.onGenerateMarkerHtmlCallback=function(){setTimeout({function() 
{map.closeInfoWindow();},100);}; // where lsc is the LocalSearch  
control, and map is the map it's on.

Then, to re-allow the infowindow, you would call  
lsc.onGenerateMarkerHtmlCallback=null;

You might also be able to override LocalSearch.prototype.bootComplete  
before you initialize the control so that, instead of using  
GEvent.bind to assign the click listener, it calls an enable routine  
that would look something like this:

google.maps.LocalSearch.prototype.enableMarkerClick=function(){
var lsc=this;
lsc 
.clickListener 
=GEvent.addListener(lsc.gmap,'click',function(marker,point) 
{lsc.onMapClick(marker,point);});
}

Then you could add a disable routine like this:

google.maps.LocalSearch.prototype.disableMarkerClick=function(){
var lsc=this;
if(lsc.clickListener){GEvent.removeListener(lsc.clickListener);}
lsc.clickListener=null;
}

Beware, I haven't tested any of this, so it might not work at all.   
Just brainstorming.

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
http://jgeerdes.blogspot.com
http://jgeerdes.wordpress.com
[email protected]

Unless otherwise noted, any price quotes contained within this  
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights  
Wesleyan Church!

And check out my blog, Adventures in Web Development, at 
http://jgeerdes.blogspot.com 
  !


On Feb 12, 2009, at 1:26 PM, sarris wrote:

>
> Hi there, i am using the LocalSearch control.
> I would like to be able to disallow the users to click on the results
> on the map under certain circumstances. Is there a way to implement
> this? Is there a way to remove the clicking event from the markers?
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" 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-AJAX-Search-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to