比其他活动“place_changed”谷歌地图自动完成 [英] Events other than 'place_changed' for Google Maps Autocomplete

查看:223
本文介绍了比其他活动“place_changed”谷歌地图自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正确触发上place_changed。一个应用程序

不过,我想,当用户选择自动完成条目分支搜索行为不同,当他们已进入文本对自己没有自动完成的协助。

我应该使用什么样的事件监听器来进行区分?我找不到其他事件谷歌地图自动完成的任何文档。

我现在有:

  VAR GMaps实现。=新google.maps.places.Autocomplete($(#searchproperties)。得到(0)
{类​​型:['地理code'],componentRestrictions:{国家:'我们'}});google.maps.event.addListener(GMaps实现,'place_changed',函数(){
    // FIRE搜索
});


解决方案

有只有一个在谷歌地图JavaScript API V3记录事件的的 google.maps.places.Autocomplete类 place_changed

您可以添加标准的HTML事件侦听器给它(不知道这会影响自动完成功能)。

I have an app that currently fires correctly on place_changed.

However, I want to branch search to behave differently when a user has selected an autocomplete entry, and when they have entered text on their own without the assistance of autocomplete.

What kind of event listener should I use to make the distinction? I cannot find any documentation on other events for Google Maps Autocomplete.

what I have now:

var gmaps = new google.maps.places.Autocomplete($("#searchproperties").get(0), 
{ types: ['geocode'], componentRestrictions: {country: 'us'} });

google.maps.event.addListener(gmaps, 'place_changed', function () {
    //FIRE SEARCH
});

解决方案

There is only one documented event in the Google Maps Javascript API v3 for the google.maps.places.Autocomplete class, place_changed

You can add standard HTML event listeners to it (not sure if that will affect the Autocomplete functionality).

这篇关于比其他活动“place_changed”谷歌地图自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆