Location:

Real 3D Module View

[Navinfo Navigation SDK for iOS] provides Real3D data view function. In the navigation process, when encountering multiple lane selection, simulate real road condition information, so that the user can accurately select the lane.

The specific use of the MBReal3dViewDelegate protocol is required to implement the Real3D related display agent. The specific code is as follows:

            - (void)viewWillAppearInReal3dView:(MBReal3dView *)view {
                [view setHidden:NO];
                [view enableDraw:YES];
            }

            - (void)viewWillDisappearInReal3dView:(MBReal3dView *)view {
                [view setHidden:YES];
                [view enableDraw:NO];
            }
            
            - (void)needsDisplayInReal3dView:(MBReal3dView *)view {
                [view setNeedsDisplay];
            }
            
        

The specific use needs to create MBReal3dView type view, the specific implementation is as follows:

            (For complete code, see MBNaviController.m in the SDKDemo project)

            // Specific size users can customize according to their needs
            self.real3dView = [[MBReal3dView alloc] initWithFrame:CGRectMake(100, 200, 200, 200)];
            // Set to close sharing with other GLKView
            [self.real3dView setSurfaceShared:NO];
            self.real3dView.viewDelegate = self;
            [self.real3dView setHidden:YES];
            [self.mapView addSubview:self.real3dView];

            // Turn on true 3D function
            [self.real3dView dataDriverRerouteWillBegin];

            // Call after the completion of the calculation
            [self.real3dView dataDriverNewRouteTaken:routeBase];
        

In addition, you need to add resource files. For details, see the real3d folder in the SDKDemo data directory.


The actual operation effect is as follows:

Real 3d视图效果
TOP