Check If Service is Supported by Default Map Provider API
Use this API to check whether a specified service is supported by the default map provider configured in the active system settings.
API Definition
This API is defined in the MapProviderManager class.
public static boolean isSupportedService(ServiceName serviceName)
The serviceName parameter is defined as an enum value used to identify the service to be checked. This enum value includes:
• DIRECTION: Specifies the direction service of the map provider, which is used to get route and drive time information.
• TIMEZONE: Specifies the time zone service of the map provider, which is used to get time zone information.
• MATRIX: Specifies the matrix service of the map provider, which is used to get distance matrix information.
• GEOCODING: Specifies the geocoding service of the map provider, which is used to search locations by address segments, for example, city or street.
• REVERSE_GEOCODING: Specifies the reverse geocoding service of the map provider, which is used to search locations by latitude and longitude.
If the specified service is supported by the default map provider, returns true. Otherwise, returns false.
|
This API also returns false if no default map provider is configured in the active system settings, or if the default map provider is set to an unsupported service.
|
Example
import com.servicemax.mapproviders.MapProviderManager
import com.servicemax.mapproviders.Constants.ServiceName
MapProviderManager.isSupportedService(ServiceName.DIRECTION);
For more information: