Posts

Showing posts from February, 2018

Google map api - use multiple keywords in place searches

Image
In order to google Place Search   and Place Library documentation there no option to use multiple keywords for searching. Therefore I have done this; I've created two PlaceService objects because I need to look at 'Pizza Hut' and 'KFC' both in single click. var service = new google.maps.places.PlacesService(map);             service.nearbySearch({                 location: pyrmont,                 radius: 50000,                 keyword: ['KFC']             }, callback); var service2 = new google.maps.places.PlacesService(map);             service2.nearbySearch({                 location: pyrmont,                 radius: 50000,                 keyword: ['Pizzahut']             }, callback); and It's working well. KFC Layer KFC + Pizza Hut Layer KFC + Pizza Hut + Subway Layer Full source code: <!DOCTYPE html> <html> <head>     <title>         Map     </title>     <script async