如何设置事件的纬度和经度

发布于 2024-12-27 16:29:09 字数 411 浏览 1 评论 0原文

在我的网站上,我使用 PHP SDK 进行 api 调用。有了它,我就可以创建一个事件并随后对其进行编辑。但我无法做的是设置事件的纬度和经度。

我搜索了一些类似的问题,这帮助我设置了一些场地字段,例如街道和城市。值得注意的是,Facebook 似乎正在检查一个城市是否存在。当我将“安特卫普”作为城市值时,它并没有保存它。但当我使用“安特卫普”作为城市值时,它添加了城市、州和国家场地字段。

当我在 Facebook 网站上选择事件的位置并在 Graph API 浏览器中检查该事件时,我确实看到了纬度和经度值。它们也是红色的。这是否意味着 Facebook 不允许您自行设置纬度和经度设置?

长话短说,我得到了一些带有名称、开始日期、结束日期和地理位置的事件。我想将它们推送到 Facebook 活动,但我在尝试设置纬度和经度时遇到了困难。有人可以帮助我吗?

On my website i'm using the PHP SDK to make api calls. And with it I am able to create an event and edit it afterwards. But what I am not able to do is to set the latitude and longitude of the event.

I've searched for some similar questions, which helped me to set some of the venue fields, like street and city. Something to note is that it seems like Facebook is checking if a city exist. When I had "Antwerpen" as city value, it didn't saved it. But when I used "Antwerp" as city value it added the city, state and country fields of venue.

When I choose a location for an event on the facebook website, and I inspect the event in the Graph API explorer I do see the latitude and longitude values. They are also colored red. Does this mean facebook doesn't allow you to set latitude and longitude settings yourself?

Long story short, I got some events with a name, start_date, end_date and geolocations. And I want to push them to Facebook Events, but I get stuck trying to set the latitude and longitude.. Can somebody help me out?

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

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

发布评论

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

评论(2

半寸时光 2025-01-03 16:29:09

在 API 的当前实现中,您无法为事件设置长/纬度。我知道还有其他人想要这种能力。我给您的建议是在 http://developers.facebook.com/bugs 记录错误并查看他们是否会将您的想法优先列为愿望清单项目。一旦你这样做了,然后在这里发布链接,我相信你会吸引一些人订阅它,从而提高 Facebook 的意识,让我们知道不止一个人希望拥有这种能力。


编辑

来自:使用具有 Graph API 的场地

有一个(当前未记录的)参数将标记已创建的
事件发生在特定地点 - 创建事件时
添加location_id参数并将其设置为Facebook的ID
你想要的地方。

但是,您的地点 ID 必须存在。但我仍然认为你应该能够在没有地点 ID 的情况下计算某个位置的纬度/经度

With the current implementation of the API, you cannot set long/lat for events. I know there's others out there that would like this ability. My suggestion to you is to log a bug at http://developers.facebook.com/bugs and see if they will prioritize your idea as a wishlist item. Once you do, then post the link to it here, and I'm sure you will get a few people to subscribe to it, raising awareness with Facebook that more than one of us would like to have this ability.


EDIT

from: Create event with a venue with Graph API

There's a (currently undocumented) parameter which will mark a created
event as taking place at a particular Place - When creating the event
add the location_id parameter and set it to the ID of the Facebook
Place you want.

However, your place id must exist. But still I think you should be able to do lat/long of a location without a place id

ぃ弥猫深巷。 2025-01-03 16:29:09

我也只是在研究这个,我考虑使用 Google 地图地理编码器

在 Facebook 活动的位置字段中,有时您会有一个地址(当然取决于创建者..),当我尝试将其复制并粘贴到 GoogleMaps 搜索中时,它有时会找到一个位置,有时则找不到,
这样你就可以获得一些事件的地点。

不过我还没有在代码中尝试过这个..

i was just looking into this too, i thought about doing it with Google Maps Geocoder

in the location field of a facebook event sometimes you will have an address (depends on the creator of course.. ), when i tried to copy and paste it into GoogleMaps search it would sometimes find a location, and sometimes not,
this way you can get some of the locations of the events.

i haven't tried this yet in code though..

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