Location:

Bubble Display

Why do you want to click on the logo of the map to pop up the bubble? In order to display the location information of the map dot identification more clearly and in more detail, and some functions that need to be implemented after clicking the bubble. Implementation method: an identification point of the map dot is created to create an Annotation object, and the click event is responded to by the monitoring point, and the corresponding bubble display function is implemented in the click event.

                (For complete code, see MBNewSearchMapController.m of the SDKDemo project)
                // analog point
                MBPoint pos = {11617606,3971098};
                // Offset of x and y axes
                CGPoint pivotPoint = {0.5,0.5};
                // Initialize MBAnnotation
                annotation = [[MBAnnotation alloc] initWithZLevel:1 pos:pos iconId:8001 pivot:pivotPoint];
                // set the title
                Annotation.title = @"title";
                // set the subtitle
                annotation.subTitle = @"subtitle";
                // Add MBAnnotation to MBMapView
                [mapView addAnnotation:annotation];
                // Set the map center point to pos
                mapView.worldCenter = pos;
                // Get the bubble style
                MBCalloutStyle calloutStyle = annotation.calloutStyle;
                // Set the anchor offset
                calloutStyle.anchor.x = 0.5f;
                calloutStyle.anchor.y = 0;
                annotation.calloutStyle = calloutStyle;
                // Set MBAnnotation can be displayed (YES: display, NO: not displayed, default NO)
                [annotation showCallout:YES];
            

Bubble display:

bubble
TOP