繁体   English   中英

在Google地图上从Foursquare绘制场地

[英]Plot venues from foursquare on google maps

我正在尝试使用Foursquare和Google API接收我的当前位置,并从那里显示一系列场所,例如。 特定半径的餐厅,并使用自定义标记在地图上绘制每个餐厅。

我已经能够使用google api显示我的当前位置,但是我从未使用过Foursquare API,而且似乎有些棘手,我们将不胜感激。

您将要使用场所/搜索场所/探索端点在位置周围进行搜索。

作为使用搜索的示例,此JQuery getJSON调用将调用搜索终结点,以查找给定场所100m内“ nightspots”类别中的场所:

var ll = latitude + "," + longitude;        
$.getJSON("https://api.foursquare.com/v2/venues/search", {
    ll: ll,
    radius: 100,
    limit: 50
    intent: "browse",
    categoryId: "4d4b7105d754a06376d81259",
    client_id: foursq_client_id,
    client_secret: foursq_client_secret,
    v: 20130420
 }).done(function(data) {
    $.each(data.response.venues, function(i, item) {
        console.log(item);
    });
});

暂无
暂无

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

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