How to display businesses on map

Using the search example, I am able to view 2 businesses as pictured below.

However, in my own implementation, the majority of businesses, including the 2 pictured, are not on the map at all.

is this something I’m doing wrong?

fyi, i’m not planning on implementing search in our product.

I’d suggest to compare the request originated from the example and the request originated from your implementation. Have a look at the parameters used, a single parameter might change the response from the service.

The requests seem to be the same, other than the fact that I’m supplying the language parameter

According to the search API documentation the language parameter is only used for the response, so it doesn’t affect the query. Inspect as well the response of both requests, if they have similar results it could be something wrong in your implementation.

Well the responses for tile requests are .pbf format, so not easy to compare.

On further digging, it seems the search example is rendering those businesses because they are in the search results. The example code is then doing the following to manually render the results as markers.

var searchMarkersManager = new SearchMarkersManager(map)
// ...
searchMarkersManager.draw(resp.data.results);

I couldn’t find SearchMarkersManager anywhere else in the docs.

I guess the businesses I’m interested just aren’t part of this tileset. I have all the coordinates so maybe i could render business icons myself using GeoJSON + SVG.

Yes, I was referring to the results from the search API service. The searchMarkersManager is a class defined in an external file used by that example. In the code section, hover over the Javascript button and you will be able to see the code of external JS files.

Hope this helps.

2 Likes