简体   繁体   English

使用geokit浏览位置

[英]Browse location with geokit

My user model is using geokit to find the address from an ip address. 我的用户模型使用geokit从ip地址中查找地址。 How do I let the user select a different country, state or city? 如何让用户选择其他国家,州或城市? I have checked all the documentation and I can't figure out how to retrieve a list of countries, states or cities. 我已经检查了所有文档,但无法弄清楚如何检索国家,州或城市的列表。

Your question isn't 100% clear but you may be trying to do something Geokit isn't designed for. 您的问题不是100%清楚,但您可能正在尝试做Geokit并非为之设计的事情。

Geokit basically does one thing: it takes an IP address, or a physical address, and gives you the lat/long. Geokit基本上会做一件事:它需要一个IP地址或一个物理地址,并为您提供经纬度。 When you install it as a Rails plugin, you can geocode your models (usually with a street address) and it adds some useful stuff to your model classes. 当您将其安装为Rails插件时,您可以对模型进行地理编码(通常使用街道地址),然后它将一些有用的东西添加到模型类中。 These extra things let you compute distances between your model objects. 这些额外的内容使您可以计算模型对象之间的距离。

AFAIK, you can't get a list of countries from Geokit. AFAIK,您无法从Geokit获得国家列表。 On my projects I've either used one of the free online lists, exported a list from another application, or subscribed to a service. 在我的项目中,我要么使用了免费的在线列表之一,要么从另一个应用程序导出了列表,要么订阅了一项服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM