Nearby Search Widget - Advanced Details
Mappls Nearby Search Widget is highly configurable widget, it provides options to customized almost everything.
For installation / basic information click here
Advanced Configurations
To set advanced configurations in Nearby Search widget.
Using MapplsNearbyFragment
Java
MapplsNearbyFragment nearbyFragment = MapplsNearbyFragment.newInstance(nearbyOptions);
                        //OR
MapplsNearbyFragment nearbyFragment = MapplsNearbyFragment.newInstance(nearbyUiOptions);
                       //OR
MapplsNearbyFragment nearbyFragment = MapplsNearbyFragment.newInstance(nearbyOption,nearbyUiOptions);                       
nearbyFragment.setCategoryList(categories);                       
getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, nearbyFragment, MapplsNearbyFragment.class.getSimpleName())  
        .commit();
Kotlin
val nearbyFragment: MapplsNearbyFragment= MapplsNearbyFragment.newInstance(nearbyOptions)
                  //OR
val nearbyFragment: MapplsNearbyFragment= MapplsNearbyFragment.newInstance(nearbyUIOptions)  
                 //OR
val nearbyFragment: MapplsNearbyFragment= MapplsNearbyFragment.newInstance(nearbyOptions,nearbyUIOptions)                                 
nearbyFragment.setCategoryList(categories)
supportFragmentManager.beginTransaction().add(R.id.fragment_container, nearbyFragment, MapplsNearbyFragment::class.java.simpleName)  
        .commit()
Using MapplsNearbyActivity
Java
Intent intent = new MapplsNearbyWidget.IntentBuilder().nearbyUIOptions(nearbyUIOptions).nearbyOptions(nearbyOptions).setCategoryList(categoryList).build(this);   
 startActivityForResult(intent, 101); 
Kotlin
val intent = MapplsNearbyWidget.IntentBuilder().nearbyUIOptions(nearbyUIOptions).nearbyOptions(nearbyOptions).setCategoryList(categoryList).build(this)   
startActivityForResult(intent, 101)  
CategoryCode
This class is used to set the information for the nearby categories to show in Nearby Widget. It contains the following properties in constructor:
- category (String): Name of the category that display on a view
- icon(Integer): To show icon of category
- categoryCode (List<String>): List of category codes
- markerIcon (Integer): Marker icon to display on a map
- isSelected (Boolean): To set the category is selected or not
NearbyUIOption
This class is used to set the UI configurations of the Nearby Widget It contains the following properties:
- toolbarColor(Integer): To set the toolbar color of nearby result screen
- backgroundColor(Integer): To set the background color of nearby category selection screen
- nearbyToolbarIcon(Integer): To set the toolbar icon on category selection screen
- toolbarTintColor(Integer): To set text and icon color of toolbar of nearby selection screen
- nearbyToolbarColor(Integer): To set the toolbar color of nearby category selection screen
- nearbyToolbarTintColor(Integer): To set the toolbar text color of nearby category selection screen
- locationDetailsBackgroundColor(Integer): To set background color of location detail view
- locationDetailsInfoLabelText(String): To set location detail information text
- locationDetailInfoTextColor(Integer): To set location detail information text color
- locationDetailFormattedAddressTextColor(Integer): To set selected location Address text color
- changeLocationButtonTextColor(Integer): To set change location button Text color
- useCurrentLocationButtonTextColor(Integer): To set use current location Button text color
- selectedCategoryBackgroundColor(Integer): To set selected category item background color
- selectedCategoryTextColor(Integer): To set selected category item text color
- selectedCategoryTintColor(Integer): To set selected category item icon color
- categoryBackgroundColor(Integer): To set category item background color
- categoryTextColor(Integer): To set Category item text color
- categoryTintColor(Integer): To set Category item icon color
- submitButtonColor(Integer): To set background color of submit button
- submitButtonTextColor(Integer): To set submit button text color
- submitButtonText(String): To set submit button text
- paginationBackgroundColor(Integer): To set background color of page selection view
- tabTextColor(Integer): To set tab text color
- tabBackgroundColor(Integer): To set tab background color
- selectedTabTextColor(Integer): To set selected tab text color
- tabIndicatorColor(Integer): To set selected tab indicator color
- tabIconTint(Integer): To set tab icon color (can use selector color)
- placeNameTextColor(Integer): To set result item place name text color
- distanceTextColor(Integer): To set result item distance text color
- placeAddressTextColor(Integer): To set result item address text color
- refLocationIcon(Integer): To set reference location marker icon
- refLocationCircleColor(Integer): To set circle color around reference location
- refLocationCircleAlpha(Float): To set circle alpha for reference location
NearbyOption
This class is used to set the properties related to nearby search It contains the following properties:
- radius(Integer): provides the range of distance to search over(default: 1000, min: 500, max: 10000)
- sortBy(String): provides configured sorting operations for the client on cloud.Below are the available sorts:- NearbyCriteria.DISTANCE_ASCENDING
- NearbyCriteria.DISTANCE_DESCENDING will sort the data on distance basis.
- NearbyCriteria.NAME_ASCENDING
- NearbyCriteria.NAME_DESCENDING will sort the data on alphabetically basis.
 
- searchBy(String): provides configurable search operations for the client on cloud. Below are the available sorts:- NearbyCriteria.DISTANCE
- NearbyCriteria.IMPORTANCE - will search data in order of prominence of the place.
 
- bounds(String): Allows the developer to send in map bounds to provide a nearby search within the bounds.
 {e.g. (bounds("28.56812,77.240519;28.532790,77.290854"))
- pod(String): it takes in the place type code which helps in restricting the results to certain chosen type. Access to this parameter is controlled from the backend. This parameter if provided will override any values provided in- keywordsrequest param.
 Below mentioned are the codes for the pod- NearbyCriteria.POD_SUB_LOCALITY
- NearbyCriteria.POD_LOCALITY
- NearbyCriteria.POD_CITY
- NearbyCriteria.POD_STATE
 
- filter(String): This parameter helps you get a specific type of EV charging Station- filter= model:(string);brandId:(string);plugType:(string)
 
- richData(Boolean): Rich Data related to POI
- userName(String): Use to set the user name