It's easy like this:
----------------------------------
var input = document.getElementById('search');
mapCanvas.controls[google.maps.ControlPosition.TOP_LEFT].push(input);

var options = {
  types: ['establishment']
};

var autocomplete = new google.maps.places.Autocomplete(input,
options);
google.maps.event.addListener(autocomplete, "place_changed", function()
{
  var place = autocomplete.getPlace();
   mapCanvas.panTo(place.geometry.location);
});

----------------------------------

On 11月24日, 午前10:19, "xinyun_0...@126.com" <xinyun_0...@126.com> wrote:
> Hi Masashi.K
> We know we can make a custom control on the google maps,So how we can
> put the search bar in the custom control?Do you have any idea?
> On 11月23日, 上午9时59分, "Masashi.K" <wf9a5...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi.
>
> > How about this 
> > example?http://code.google.com/apis/maps/documentation/javascript/examples/pl...
>
> >http://code.google.com/apis/maps/documentation/javascript/places.html...
>
> > On Nov 22, 4:18 pm, Bready <bradleylin...@gmail.com> wrote:
>
> > > I wonder if i can add a search bar on my own google map application.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to