我正在寻找类似于Facebook建议列表的东西,其中包括城市和国家。当您尝试在Facebook中创建新事件时,单击添加地址,然后在城市字段中开始输入,您可以看到我确切所说的内容。
我更喜欢在jQuery中找到带有日期的有效建议工具,但带有城市/国家的数据库也可以解决问题。
我更喜欢在jQuery中找到带有日期的有效建议工具,但带有城市/国家的数据库也可以解决问题。
这是数据库链接:http://geolite.maxmind.com/download/worldcities/
这是一个与jQuery工具很容易结合的数据库,可以使用其中一个“自动完成”插件。这肯定比自己研究和构建数据库要容易得多 :-)
"type": ["/location/country"]
)或城市,并为用户提供漂亮的UI以验证他们是否谈论正确的位置。您可以从这里使用Microsoft SQL / Mysql格式的城市/国家数据库 -
http://myip.ms/info/cities_sql_database/World_Cities_SQL_Mysql_Database.html
城市/国家表结构如下:
CREATE TABLE cities (
cityID int NOT NULL,
cityName varchar(50) NOT NULL,
stateID int NOT NULL,
countryID varchar(3) NOT NULL,
latitude float NOT NULL,
longitude float NOT NULL,
PRIMARY KEY (cityID),
UNIQUE (countryID,stateID,cityID)
);
CREATE TABLE countries (
countryID varchar(3) NOT NULL,
countryName varchar(52) NOT NULL,
localName varchar(45) NOT NULL,
webCode varchar(2) NOT NULL,
region varchar(26) NOT NULL,
continent varchar(15) NOT NULL,
latitude float NOT NULL,
longitude float NOT NULL,
surfaceArea float NOT NULL,
population int NOT NULL,
PRIMARY KEY (countryID),
UNIQUE (webCode),
UNIQUE (countryName)
);
http://code.google.com/intl/sk-SK/apis/maps/documentation/javascript/places.html#places_autocomplete
请注意,使用GMA(免费版与商业版)及其功能可能会受到商业限制。在决定使用GMA之前,请查看使用条款。