POI Helper

POI HELPER

To provide you with a convenient way to handle POI representation there is a poiCategoryHelper property in NMSdk singleton instance. This property is a NMPoiCategoryHelper instance. There are three groups in with all the POIs are divided in Navmii SDK:

  • road events
  • speed cameras 
  • all the other POIs

You can retrieve a NSArray of NMPoiCategories belonging to each of this groups separately using these readonly properties: roadEventCategories, speedCameraCategories and poiCategories respectively. For the info on NMPoiCategory please refer to POI CATEGORY section.

NSArray <NMPoiCategory *> *roadEvents = [NMSdk sharedInstance].poiCategoryHelper.roadEventCategories;
NSArray <NMPoiCategory *> *speedCameras = [NMSdk sharedInstance].poiCategoryHelper.speedCameraCategories;
NSArray <NMPoiCategory *> *poiCategories = [NMSdk sharedInstance].poiCategoryHelper.poiCategories;

The NMPoiHelper allows to:

  • check if a category with the ID number exists
  • check if a category is displayed on the map
  • make a category displayed/hidden on the map
  • get an UIImage for a category
  • get a NMPoiCategory from a NSInteger representing the category ID number
NMPoiCategoryHelper *helper = [NMSdk sharedInstance].poiCategoryHelper;
//logs out 1 if the category exists or 0 if it doesn't
NSLog(@"POI category with number %d exists - %d", someInt, (int)[helper isPoiCategoryExist:someInt]);
//logs out 1 if the category is displayed on the map and 0 if it isn't
NSLog(@"POI category with number %d is shown on map - %d", number, (int)[helper isPoiCategoryDisplayedOnMap:number]);
//hides all POIs belonging to the category
[helper setPoiCategory:number displayedOnMap:NO];
//fetches the image associated with the category
UIImage *image = [helper poiCategoryImage:categoryNumber];
//creates a NMPoiCategory from a number
NMPoiCategory *poiCategory = [helper poiCategoryById:categoryNumber];

POI CATEGORY

NMPoiCategory has the following info:

  • name
  • category ID number
  • zoom level
  • BOOL value indicating if POIs belonging to the category should be displayed on the map
NSLog(@"category name - %@", category.name);
NSLog(@"category ID number - %d", (int)category.categoryId);
NSLog(@"category zoom level - %d", category. zoomLevel);
NSLog(@"should be displayed on map - %d", category.shouldDisplayOnMap);

You can instantiate a NMPoiCategory using initWithName:categoryId:zoomLevel:shouldDisplayOnMap: method.