有没有办法根据地址生成位置的坐标?

发布于 2024-10-03 14:57:11 字数 187 浏览 2 评论 0原文

我有一个名为 Dealer 的节点,它具有以下 CCK 字段;
标题
身体
位置(位置类型)
电话(文本类型)
网站(文本类型)
Divsion(节点引用)

有没有办法根据输入的位置在 gmap 上显示节点的位置?我将导入大约 1000 个节点,并且没有其中任何一个的坐标,但只有每个节点的地址。

I have a node called Dealer that has the following CCK fields;
Title
Body
Location (of type Location)
Phone (of type text)
Website ( of type text)
Divsion (Node Refrence)

Is there a way to display the location of the node on a gmap, based on the inputted location? I'll be importing around 1000 nodes, and don't have the co-ordinates for any of these, but only have the address of each.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

牵强ㄟ 2024-10-10 14:57:11

您正在寻找的是两个功能:位置数据的地理编码和结果的(Google)地图显示。通常,地理编码是在节点创建时完成的,或者使用某种 cron 作业完成。而地图显示是在节点视图(预告片、整页、视图等)上完成的。

这两个功能都应由 Gmap 项目的模块提供。 OpenLayersOpenLayers Geocoder 项目也应该提供它们。最后,Google 地图工具可能是第三种选择。

所有项目都提供某种视图集成,允许您使用熟悉的工具为节点构建地图。

对于坐标的地理编码(和存储),还有 Geo地理编码 项目。但地理编码似乎不支持位置字段。

What you are looking for is two features: geocoding of Location data and a (Google) map display of the result. Usually Geocoding is done at node creation time, or using some kind of cron job. While map display is done on node view (teaser, full page, views, etc.).

Both features should be provided by the Gmap project's modules. The OpenLayers and OpenLayers Geocoder projects should also provide them. Finally the Google Map Tools may be a third alternative.

All projects provide some kind of Views integration that allow you to build map(s) for your nodes using familiar tools.

For geocoding (and storage) of the coordinates, there is also the Geo and Geocode projects. But it seems Geocode doesn't support Location fields.

岁吢 2024-10-10 14:57:11

您可以使用以下两个模块。

http://drupal.org/project/openlayers

drupal.org/project/openlayers_geocoder

它可以对您的地址进行地理编码你可以使用谷歌地图来显示它。
不确定这种模块组合是否适用于以编程方式创建的节点,但这只是一个开始。

You can use the following two modules.

http://drupal.org/project/openlayers

drupal.org/project/openlayers_geocoder

It can geocode your address and you can use google maps to show it.
Not sure if this combination of modules will work with programatically created nodes but it is a start.

枫以 2024-10-10 14:57:11

我使用 location (drupal.org/project/location) 和 gmap (drupal.org/project/gmap) 模块实现了地理编码。您需要激活“节点位置”和“位置搜索”子模块,并在 admin/settings/location/geocoding 中设置地理编码选项,从而提供一种对现有经销商进行批量地理编码的方法。

您不需要“位置 CCK”字段,只需使用“节点位置”提供的设置(编辑您的经销商内容类型)。

I implemented geocoding using the location (drupal.org/project/location) and gmap (drupal.org/project/gmap) modules. You need "node location" and "location search" submodules activated, and set up your geocoding options in admin/settings/location/geocoding , offering a way to bulk geocode the existing Dealers too.

You won't need the Location CCK field, just use the setup provided by "node location" (edit your Dealer content type).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文