全球位置输入自动完成 [英] Global location input autocomplete

查看:23
本文介绍了全球位置输入自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个插件来创建一个智能位置表单字段,该字段具有建议的自动完成功能.我找不到任何合适的东西(谷歌地理编码本身太不可靠,而且它不是为此而设计的)所以我建立了自己的.我觉得 2011 年没有像这样的开源全球位置输入插件很疯狂,所以开始尝试一下.

演示在这里

I was looking for a plugin to create a smart location form field which has a suggested autocomplete. I was unable to find anything suitable (Google Geocode is too unreliable on its own, and it isn't designed for this) so I built my own. I thought it was crazy that in 2011 an open-source global location input plugin like this didn't exist so set out to give it a go.

The demo is here http://labs.unxposed.net/unxposed/geocode/ and is working on Chrome and Firefox 4. Download is here https://github.com/unxposed/geocode

There is one major issue I am having with it. Sometimes it works great like so. On typing Ban in the input I get a list of suggestions back. The input is autofilled with the first suggestion back matching Ban and the input text after Ban is selected (much like the Chrome address bar).

However, much of the time the autofill selected text in the input becomes unhighlighted and the cursor then moves to the end of the input (which is really annoying). Like so - after I type Banbur.

I am pretty sure this is related to Google Maps as if I remove the secondary source (Google Geocode) the issue is resolved and autofill/input select works great consistently, but why is this happening, and how can I fix it?

Any other improvements/optimisations/suggestions would be greatly appreciated too!

Thanks

解决方案

OSClass.org provides its theme for free which has location autocomplete with all areas being populated automatically. This you can check in their demo and download the code from within their theme files. Demo (login and go to Settings->location section) : http://demo.osclass.org/general/oc-admin/index.php?page=login

这篇关于全球位置输入自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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