This repository distributes a package rather than defining the complete product contract. Pair it with the owning SDK or product guide.
What this surface enables
Mappls API Kit Native for iOS distributed via the SPM (Swift Package Manager).
No durable provider record or application workflow contract was established from the source identity or bounded document evidence; view, camera, callback, and authentication sessions alone do not make a source stateful.
Authority: Conservative Default · No durable-state signal promoted from incidental vocabularyiOS
MapsSearch PlacesRoutes NavigationTracking TelematicsWorkforceGis AnalyticsCapture FeedbackIdentity Platform
Objective-CSwiftText
Oauth2Api Key
Prepare the integration
- An iOS project with Xcode and the package manager required by the source release
- OAuth client credentials issued for the intended Mappls project
- A Mappls project key restricted to the intended app, domain, or backend
- The corresponding product entitlement enabled for the developer application
Setup and usage examples
These examples were extracted from the canonical public source document and sanitized for credential-like values. Check the source branch and package version before copying into a production application.
MapplsAutoSuggestManager * autoSuggestManager = [MapplsAutoSuggestManager sharedManager];
// or
MapplsAutoSuggestManager *autoSuggestManager = [[MapplsAutoSuggestManager alloc] initWithRestKey:MapplsAccountManager.restAPIKey clientId:MapplsAccountManager.atlasClientId clientSecret:MapplsAccountManager.atlasClientSecret grantType:MapplsAccountManager.atlasGrantType];
MapplsAutoSearchAtlasOptions * autoSuggestOptions = [[MapplsAutoSearchAtlasOptions alloc] initWithQuery:@"mmi000" withRegion:MapplsRegionTypeIndia];
autoSuggestOptions.location = [[CLLocation alloc] initWithLatitude:28.2323234 longitude:72.3434123];
autoSuggestOptions.zoom = [[NSNumber alloc] initWithInt:5];
[autoSuggestManager getAutoSuggestionResultsWithOptions:autoSuggestOptions completionHandler:^(MapplsLocationResults * _Nullable locationResults, NSError * _Nullable error) {
if (error) {
NSLog(@"%@", error);
} else if (locationResults) {
MapplsAutoSuggestLocationResults * results = (MapplsAutoSuggestLocationResults *) locationResults;
if(results && results.suggestions) {
for (MapplsAtlasSuggestion * suggestion in results.suggestions) {
NSLog(@"Auto Suggest %@%@", suggestion.latitude, suggestion.longitude);
}
}
if(results && results.suggestedSearches) {
for (MapplsSearchPrediction * suggestion in results.suggestedSearches) {
NSLog(@"Auto Suggest %@", suggestion.identifier);
}
}
} else {
NSLog(@"No Results");
}
}];Topics documented by the source
01Introduction
Our APIs, SDKs, and live updating map data available for 200+ countries & territories give developers tools to build better experiences across various platforms.
1. You can get your authentication information to be used in this document here: https://auth.mappls.com/console/
2. The sample code is provided to help you understand the basic functionality of Mappls REST APIs working on iOS native development platform.
02Installation
To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter its repository URL. See Adding Package Dependencies to Your App.
03Dependencies
This library depends upon MapplsAPICore. All dependent libraries will be automatically.
04Getting Started
Mappls Map SDK for iOS lets you easily add Mappls Map and services to your own iOS app.It supports iOS SDK 9.0 and above and Xcode 10.1 or later. You can have a look at the map and features you will get in your own app by using the Mappls Map app for iOS. The SDK handles Map Display along with a bunch of controls and native gestures.
05MapplsAPICore
It is required to set Mappls keys and authenticate before using any Mappls SDK. Please see the reference here.
06API Usage and Requirements
The allowed SDK hits are described on the plans page. Note that your usage is shared between platforms, so the API hits you make from a web application, Android app or an iOS app all add up to your allowed daily limit.
07Autosuggest API
Get "type as you go" suggestion while searching for a location.
The Autosuggest API helps users to complete queries faster by adding intelligent search capabilities to your web or mobile app. This API returns a list of results as well as suggested queries as the user types in the search field.
For live demo click LIVE DEMO
The Autosuggest helps users to complete queries faster by adding intelligent search capabilities to your iOS mobile app. It takes a human readable query such as place name, address or Mappls Pin and returns a list of results.
Class used for Autosuggest search is MapplsAutoSuggestManager. Create a MapplsAutoSuggestManager object using your rest key or alternatively, you can place your rest key in the MapplsRestKey key of your application's Info.plist file, then use the shared instance of MapplsAutoSuggestManager class.
To perform auto suggest use MapplsAutoSearchAtlasOptions class to pass query parameter to get auto suggest search with an option to pass region in parameter withRegion, which is an enum of type MapplsRegionType. If no value is passed for region, It will take default value which is India.
08Request Parameters
1. location: Location is required to get location bias autosuggest results. 2. zoom: takes the zoom level of the current scope of the map (min: 4, max: 18). 3. includeTokenizeAddress: On setting value of this property to true it provides the different address attributes in a structured object in response. 4. pod: It takes place type which helps in restricting the results to certain chosen type Below mentioned are the codes for the pod - - Sublocality - Locality - City - Village - Subdistrict - District - State - Subsublocality 5. filter: This helps you restrict the result either by mentioning a bounded area or to certain Mappls Pin. Below mentioned are both types whose instance can be set to this parameter - - (a) MapplsMapplsPinFilter: to filter results on basis of Mappls Pin. - (b) MapplsBoundsFilter: to filter results on basis of geo bound. It accepts a value of type MapplsRectangular
8. responseLanguage: It is of type string it is use to get the response in specified language.
09Response Parameters
In response of auto suggest search either you will receive an error or an object of MapplsAutoSuggestLocationResults(derived from MapplsLocationResults) which contains an array of MapplsAtlasSuggestion (derived from MapplsSuggestion) and an array of suggested searches of type MapplsSearchPrediction.
Note: As class of response object will be derived from MapplsLocationResults, You will need to cast it into MapplsAutoSuggestLocationResults.
You will find below useful properties in suggestion object :
1. type: type of location POI or Country or City 2. mapplsPin: Mappls Pin of the location 6-char alphanumeric. 3. placeAddress: Address of the location. 4. placeName: Name of the location. 5. orderIndex: the order where this result should be placed 6. addressTokens:
houseNumber: house number of the location.
houseName: house name of the location.
10Swift
For more details visit our api reference documentation.
11Reverse Geocoding API
For live demo click LIVE DEMO
Gets the nearest address for a given lat long combination.
Reverse Geocoding is a process to give the closest matching address to a provided geographical coordinates (latitude/longitude). Mappls's reverse geocoding API provides real addresses along with nearest popular landmark for any such geo-positions on the map.
Class used for geocode is MapplsReverseGeocodeManager. Create a MapplsReverseGeocodeManager object using your rest key or alternatively, you can place your rest key in the MapplsRestKey key of your application's Info.plist file, then use the shared instance of MapplsReverseGeocodeManager class.
To perform the translation use MapplsReverseGeocodeOptions class to pass coordinates as parameters to reverse geocode with an option to pass region in parameter withRegion, which is an enum of type MapplsRegionType. If no value is passed for region, It will take default value which is India.
12Request Parameters
• coordinate: - language
MapplsRegionType is used to validate and get result for different countries.
13Response Parameters
In response of geocode search either you will receive an error or an array of MapplsGeocodedPlacemark. Yo will find below useful properties in suggestion object:
• houseNumber: The house number of the location. - houseName: The name of the location. - poi: The name of the POI if the location is a place of interest (POI). - poiDist: distance from nearest POI in metres. - street: The name of the street of the location. - streetDist: distance from nearest Street in metres. - subSubLocality: The name of the sub-sub-locality where the location exists. - subLocality: The name of the sub-locality where the location exists. - locality: The name of the locality where the location exists. - village: The name of the village if the location exists in a village. - district: The name of the district in which the location exists. - subDistrict: The name of the sub-district in which the location exists. - city: The name of the city in which the location exists. - state: The name of the state in which the location exists. - pincode: The pin code of the location a
• formattedAddress: The complete human readable address string that is usually the complete postal address of the result. - areaCode: The area code of region. - area: in-case the co-ordinate lies in a country the name of the country would be returned or if the co-ordinate lies in an ocean, the name of the ocean will be returned.
14Premium Response Parameters (only for India region)
1. Census Information: (as per last census) - sttCenCd(String): State's census code. - dstCenCd(String): District's census code. - sdbCenCd(String): Subdistrict's census code. - vlgCenCd(String): Village's census code, if address is rural. - twnCenCd(String): Town's census code, if address is within any census town.
Note: Here town means a census town - an urban agglomeration defined by GoI during census; which is different from a city.
• twnName(String): Town's name as per last census.
1. Local Government Directory (LGD Information) - sttLgdCd(String): State's LGD code. - dstLgdCd(String): District's LGD code. - sdbLgdCd(String): Subdistrict's LGD code. - vlgLgdCd(String): Village's LGD code, if address is rural. - twnLgdCd(String): Town's LGD code, if address is within any census town.
15Swift
For more details visit our api reference documentation.
16Nearby API
For live demo click LIVE DEMO
Nearby Places API, enables you to add discovery and search of nearby places by searching for a generic keyword used to describe a category of places or via the unique code assigned to that category.
Class used for nearby search is MapplsNearByManager. Create a MapplsNearByManager object using your rest key or alternatively, you can place your rest key in the MapplsRestKey key of your application's Info.plist file, then use the shared instance of MapplsNearByManager class.
To perform nearby search use MapplsNearbyAtlasOptions class to pass keywords/categories and a reference location as parameters to get Nearby search results with an option to pass region in parameter withRegion, which is an enum of type MapplsRegionType. If no value is passed for region, It will take default value which is India.
MapplsRegionType is used to validate and get result for different countries.
Additionally you can also set location and zoom in object of MapplsNearbyAtlasOptions location coordinate can be set in comma seprated format i.e ("latitue", "longitue") or location can be Mappls Pin for eg. ("MMI000")
17Request Parameters
1. refLocation A location provides the location around which the search will be performed it can be coordinte (latitude, longitude) or Mappls Pin in String format.
1. page: provides number of the page to provide results from.
2. sort: provides configured sorting operations for the client on cloud. Below are the available sorts: - dist:asc & dist:desc - will sort data in order of distance from the passed location (default). - name:asc & name:desc - will sort the data on alphabetically bases.
3. radius (integer): provides the range of distance to search over (default: 1000, min: 500, max: 10000).
4. sortBy: It is used to sort results based on value provided. It can accept object of MapplsSortBy or MapplsSortByDistanceWithOrder
5. searchBy: It is used to search places based on preference provided. It is of enum type MapplsSearchByType its value can be either .importance or .distance
18Response Parameters
You will find below useful properties in suggestion object :
• distance: provides the distance from the provided location bias in meters. - mapplsPin: Mappls Pin, unique id of the location 6-char alphanumeric. - email: Email for contact.
• keywords: provides an array of matched keywords or codes. - landlineNo: Email for contact.
• mobileNo : Phone number for contact. - orderIndex: the order where this result should be placed - placeAddress: Address of the location. - placeName: Name of the location. - type: Type of location POI or Country or City. - city: Name of city. - state: Name of state - pincode: Pincode of area. - categoryCode: Code of category with that result belongs to. - richInfo: A dictionary object with dynamic information - hourOfOperation: A string value which describes hour of operation. - addressTokens: - houseNumber: house number of the location. - houseName: house name of the location. - poi: name of the POI (if applicable) - street: name of the street. (if applicable) - subSubLocality: the sub-sub-locality to which the location belongs. (if applicable) - subLocality: the sub-locality to which the location belongs. (if applicable) - locality: the locality to which the location belongs. (if app
19Code Samples
For more details visit our api reference documentation.
20Place Detail
The Mappls Pin is a simple, standardised and precise PAN India digital address system. Every location has been assigned a unique digital address or an Mappls Pin. The Place Detail can be used to extract the details of a place with the help of its Mappls Pin i.e. a 6 digit code.
Class used for Mappls Pin search is MapplsPlaceDetailManager. Create a MapplsPlaceDetailManager object using your authenticated Mappls's keys or alternatively, you can use the shared instance of MapplsPlaceDetailManager class.
To perform Place Detail use MapplsPlaceDetailOptions class to pass digital address code (Mappls Pin) as parameters to get detail result with an option to pass region in parameter withRegion, which is an enum of type MapplsRegionType. If no value is passed for region, it will take default value which is India.
21Response Parameters
In response of Mappls Pin search either you will receive an error or an object of MapplsPlaceDetail.
• mapplsPin: The Mappls Pin assigned for a place in map database. A Mappls Pin is the digital identity for an address or business to identify its unique location. - latitude: The latitude of the location. - longitude: The longitude of the location. - houseNumber: The house number of the location. - houseName: The name of the location. - poi: The name of the POI if the location is a place of interest (POI). - street: The name of the street of the location. - subSubLocality: The name of the sub-sub-locality where the location exists. - subLocality: The name of the sub-locality where the location exists. - locality: The name of the locality where the location exists. - village: The name of the village if the location exists in a village. - district: The name of the district in which the location exists. - subDistrict: The name of the sub-district in which the location exists. - city: The na
Note: Not all response parameters are available by default. These parameters are available on demand as per mutually agreed use case. For details, please contact Mappls API support.
22Objective C
let placeDetailManager = MapplsPlaceDetailManager.shared let placeOptions = MapplsPlaceDetailOptions(mapplsPin: "mmi000", withRegion: .india) placeDetailManager.getResults(placeOptions) { (placeDetail, error) in if let error = error { print(error) } else if let placeDetail = placeDetail, let latitude = placeDetail.latitude, let longitude = placeDetail.longitude { print("Place Detail : \(latitude),\(longitude)") } else { print("No results") } }
MapplsAtlasGeocodeManager atlasGeocodeManager = [MapplsAtlasGeocodeManager sharedManager]; // or MapplsAtlasGeocodeManager atlasGeocodeManager = [[MapplsAtlasGeocodeManager alloc] initWithRestKey:MapplsAccountManager.restAPIKey clientId:MapplsAccountManager.atlasClientId clientSecret:MapplsAccountManager.atlasClientSecret grantType:MapplsAccountManager.atlasGrantType];
MapplsAtlasGeocodeOptions atlasGeocodeOptions = [[MapplsAtlasGeocodeOptions alloc] initWithQuery: @"237 Mappls" withRegion:MapplsRegionTypeIndia];
[atlasGeocodeManager getGeocodeResultsWithOptions:atlasGeocodeOptions completionHandler:^(MapplsAtlasGeocodeAPIResponse Nullable response, NSError Nullable error) { if (error) { NSLog(@"%@", error); } else if (response!= nil && response.placemarks.count > 0) { NSLog(@"Forward Geocode %@%@", response.placemarks[0].latitude, response.placemarks[0].longitude); } else { NSLog(@"No results"); } }];
let atlasGeocodeManager = MapplsAtlasGeocodeManager.shared // or let atlasGeocodeManager = MapplsAtlasGeocodeManager(restKey: MapplsAccountManager.restAPIKey(), clientId: MapplsAccountManager.atlasClientId(), clientSecret: MapplsAccountManager.atlasClientSecret(), grantType: MapplsAccountManager.atlasGrantType())
let atlasGeocodeOptions = MapplsAtlasGeocodeOptions(query: "237 Mappls", withRegion: .india)
Service references found
URLs are sanitized during ingestion and may include documentation or legacy hosts. Use them to trace the source, not as a substitute for the current API contract.
https://www.mapmyindia.com/apihttps://github.com/MapmyIndia/mapmyindia-rest-api/blob/master/docs/countryISO.mdhttps://auth.mappls.com/console/](https://auth.mappls.com/console/https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app).https://about.mappls.com/api/advanced-maps/doc/sample/mapmyindia-maps-auto-suggest-api-example.phphttps://about.mappls.com/api/advanced-maps/doc/autosuggest-api#/Autosuggest%20API/AutoSuggestAPI).https://about.mappls.com/api/advanced-maps/doc/sample/mapmyindia-maps-reverse-geocoding-rest-api-examplehttps://about.mappls.com/api/advanced-maps/doc/reverse-geocoding-api#/Reverse%20Geocode%20API/ReverseGeocodeAPI).https://about.mappls.com/api/advanced-maps/doc/sample/mapmyindia-maps-near-by-api-examplehttps://about.mappls.com/api/advanced-maps/doc/nearby-api#/Nearby%20API/AtlasNearbyAPI).https://about.mappls.com/api/advanced-maps/doc/sample/mapmyindia-atlas-geocoding-rest-api-examplehttps://about.mappls.com/app/features/mapplspin/).https://about.mappls.com/api/advanced-maps/doc/geocoding-api#/Geocode%20API/AtlasGeocodeAPI).https://about.mappls.com/api/advanced-maps/doc/sample/mapmyindia-maps-route-adv-api-examplehttps://about.mappls.com/app/features/mapplspin/https://about.mappls.com/api/advanced-maps/doc/sample/mapmyindia-maps-distance-matrix-api-example