Search code examples
javascripthere-api

HERE Map's platform.getPlacesService() API is not returning phone number


Can anyone suggest which API of HERE MAP's returns place details along with phone number (Just like Google map : places.PlacesService()/textSearch()) ?

I am using HERE maps getPlacesService() to search any user input and this API is not returning a phone number.

For Sample Code : https://developer.here.com/apiexplorer-v2-sample-data/template-web-two-box/examples/search-for-places/index.html


Solution

  • // Assumption: the platform is instantiated
    var places = platform.getPlacesService()
    var entryPoint = H.service.PlacesService.EntryPoint;
    
    places.request(entryPoint.SEARCH, { 'at': '52.5044,13.3909', 'q': 'pizza'}, function(resp) {
     console.log(resp);
    }, function(resp) {
     console.log('ERROR: '+resp);
    });
    
    NOTE : you can pass 'at' and 'q' dynamically