Reverse Geocoding
Reverse geocoding, also known as address resolution, refers to the conversion of services from known geographic coordinates to corresponding address descriptions (such as provinces, cities, neighborhoods, floors, rooms, etc.).
[Navinfo Navigation SDK for iOS] only supports reverse geocoding and reverse geocoding services in China, and does not support English or Chinese Pinyin Chinese map data.
Reverse geocoding is divided into online reverse geography and offline inverse geography (default online). The reverseGeocodeFromPoint message is sent through MBReverseGeocoder and the proxy callback is set to obtain the inverse geographic information.
(For complete code, see MBReverseGeocodeController.m in the SDKDemo project) // Take the center of the map as an example for inverse geography // Initialize MBReverseGeocoder reverseGeocoder = [[MBReverseGeocoder alloc]init]; // Set the proxy reverseGeocoder.delegate = self; // Get the map center point MBPoint worldCenter = mapView.worldCenter; // Initiate a reverse geo request [reverseGeocoder reverseGeocodeFromPoint:&worldCenter]; // Reverse geography successful callback - (void)reverseGeocoder:(nonnull MBReverseGeocoder *)reverseGeocoder reverseGeocodeSucceededWithResult:(nonnull MBReverseGeocoderResult *)rgResult { if (rgResult){ reverseGeocodeObject = rgResult; CGPoint pivot = {0.5,0.5}; // Add bubbles (please refer to map overlays - bubble display) annotation = [[MBAnnotation alloc]initWithZLevel:1 pos: rgResult.postion iconId:1004 pivot:pivot]; annotation.title = rgResult.poiName; [baseMapView addAnnotation:annotation]; MBCalloutStyle calloutStyle = annotation.calloutStyle; calloutStyle.anchor.x = 0.5f; calloutStyle.anchor.y = 0; annotation.calloutStyle = calloutStyle; [annotation showCallout:YES]; } }
After running, click on the reverse geocode to display the results: