【问题标题】:Convert google maps urls to maps api markers将谷歌地图网址转换为地图 api 标记
【发布时间】:2012-09-10 18:50:14
【问题描述】:

【问题讨论】:

    标签: javascript google-maps-api-3


    【解决方案1】:

    url中的ll参数是餐厅的经纬度。如果您解析 url,您可以获取餐厅的位置并使用此数据在 JS 中创建标记。我使用 RichMarkers 并这样做:

    var location = new google.maps.LatLng(lat,lo);
    var marker = new RichMarker({
                        position: location.getLatLng(),
                        map: me.map,
                        content: 'some content'
                    });
    

    希望对你有用。

    【讨论】:

    • 嗨,垫子,不幸的是,'ll' 参数不是确切的位置或餐厅。似乎“遗嘱”是 Google 搜索地址的粗略位置。
    • 嗯,这是餐厅的经纬度。如果您想获取地址,您可以进行反向地理编码 (developers.google.com/maps/documentation/javascript/…) 但我想从 url 中您无法获取地点详细信息...也许您可以尝试使用来自 URL 的数据的 Google Places(搜索字符串和纬度,经度)你可以获得这个地方..在这里检查:developers.google.com/places/documentation/search
    猜你喜欢
    • 2015-09-20
    • 2013-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-12
    • 2012-06-14
    • 2018-04-02
    • 1970-01-01
    相关资源
    最近更新 更多