searchByCategory method

Future<List<PowerMapSearchResult>> searchByCategory(
  1. String categoryId,
  2. LatLng location, {
  3. int dist = 5,
  4. String lang = 'auto',
})

Searches for places nearby by category ID.

categoryId is the numeric type code (e.g. '2100' for Restaurant, '4500' for Fuel Station). location is the center point to search from. dist is the search radius in kilometers (default: 5).

Example:

final results = await controller.searchByCategory('2100', myLatLng, dist: 5);

Implementation

Future<List<PowerMapSearchResult>> searchByCategory(
  String categoryId,
  LatLng location, {
  int dist = 5,
  String lang = 'auto',
}) async {
  return await searchAPI.searchByCategory(
    categoryId,
    location,
    dist: dist,
    lang: lang,
  );
}