Google Places API library use without map - javascript

后端 未结 1 1020
我寻月下人不归
我寻月下人不归 2021-02-14 19:17

I need to get the closest establishments in 100m radius from specific coordinates. I found the Google Places API sample code, but I don\'t use a map in my application, since thi

1条回答
  •  终归单人心
    2021-02-14 19:46

    $attrib probably is not a Node, I guess it's a jQuery-object.

    Use

    service = new google.maps.places.PlacesService($attrib[0]);
    

    or without jQuery:

    service = new google.maps.places
              .PlacesService(document.getElementById('main')
                             .appendChild(document.createElement('div')));
    

    0 讨论(0)
提交回复
热议问题