the #property showsIndoorMap is invalid in MAMapView of AMap3DMap Pod - ios

- (void)viewDidLoad
{
[super viewDidLoad];
[MAMapServices sharedServices].apiKey = #"xxx";
self.mapView = [[MAMapView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds))];
self.mapView.delegate = self;
self.mapView.showsIndoorMap = YES;
self.mapView.showsCompass = NO;
[self.view addSubview:self.mapView];
}
I use the code above to show the map in my app. I want to use "self.mapView.showsIndoorMap = YES;" to show the indoor map but it failed. How can i see the indoor map ?

Related

IOS MKMapView not called delegate

I had created a MKMapView and set delegate for this. But, it's not called delegate for this MKMapView.
- (id)initWith_latitudeObject:(NSString *)latitudeObject longitudeObject:(NSString *)longitudeObject fromUser:(NSString *)fromUser
{
CGRect frame = CGRectMake(0, 0, 200, 200);
self = [super initWithFrame:frame];
if (self) {
// Initialization code
_mkMapView = [[MKMapView alloc] initWithFrame:frame];
[_mkMapView setDelegate:self];
MKCoordinateRegion mapRegion;
mapRegion.center.latitude = [latitudeObject doubleValue];
mapRegion.center.longitude = [longitudeObject doubleValue];
mapRegion.span.latitudeDelta = 0.005;
mapRegion.span.longitudeDelta = 0.005;
_mkMapView.region = mapRegion;
[self addSubview:_mkMapView];
[self getLocationMapView];
}
return self;
}
It's not call:
- (void)mapViewDidFinishRenderingMap:(MKMapView *)mapView fullyRendered:(BOOL)fullyRendered{
UIImage *img = [self renderToImage:mapView];
}
How to I can resolve this problem! Please help me.
I had set delegate for this, but it's not called delegate for this MKMapView

how to show custom map in MapBox IOS sdk

I am new in MapBox IOS sdk and i have no idea,how to load custom Map in MapBox.
Here my Custom Map:
https://api.tiles.mapbox.com/v4/faridullah.loj1n5f3/page.html?access_token=pk.eyJ1IjoiZmFyaWR1bGxhaCIsImEiOiJVU3ZCNS1VIn0.Owqu7VB5OZQbGj3LBBpPOA#16/33.6471/72.9881
and my code:
#define kMapboxMapID #"faridullah.loj1n5f3"
- (void)viewDidLoad {
[super viewDidLoad];
RMMapboxSource *onlineSource = [[RMMapboxSource alloc] initWithMapID:kMapboxMapID];
RMMapView *mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:onlineSource];
mapView.zoom = 5;
mapView.delegate = self;
mapView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[self.view addSubview:mapView];
mapView.showsUserLocation=YES;
}
but the markers doesnot display on device...
Just follow this example and implement the needed or delegate methods
https://www.mapbox.com/mapbox-ios-sdk/examples/marker-custom-image/

UIImagePickerController and a small custom preview

I want to use an UIImagePickerController non-modally, with a small square preview. However, I get a big black bar at the bottom of the preview, which I can't get rid of (see the screenshot). Why is it there, and how can I get rid of it?
Code:
- (void)viewDidLoad
{
[super viewDidLoad];
_imagePickerVC = [[UIImagePickerController alloc] init];
_imagePickerVC.sourceType = UIImagePickerControllerSourceTypeCamera;
_imagePickerVC.mediaTypes = #[ (NSString *)kUTTypeImage ];
_imagePickerVC.wantsFullScreenLayout = NO;
_imagePickerVC.delegate = (id)self;
_imagePickerVC.navigationBarHidden = YES;
_imagePickerVC.allowsEditing = NO;
_imagePickerVC.showsCameraControls = NO;
_imagePickerVC.cameraDevice = UIImagePickerControllerCameraDeviceFront;
CGRect previewFrame = CGRectMake(0, 0, 150, 150);
[_imagePickerVC.view setFrame:previewFrame];
_imagePickerVC.view.autoresizesSubviews = YES;
[self.view addSubview:_imagePickerVC.view];
[_imagePickerVC viewWillAppear:YES];
[_imagePickerVC viewDidAppear:YES];
}
This is a misuse of UIImagePickerController. To make your own image-capture interface, simply use AVFoundation.

How to add a toolbar over GMSMapView

I am making an iPhone application that uses a GMSMapView and I want to be able to add a toolbar on top of the map. This is my code:
#import "MapViewController.h"
#import <GoogleMaps/GoogleMaps.h>
#interface MapViewController ()
#end
#implementation MapViewController
{
GMSMapView *mapView_;
id<GMSMarker> myMarker;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)back:(id)sender
{
[self dismissViewControllerAnimated:YES completion:NULL];
}
// You don't need to modify the default initWithNibName:bundle: method.
- (void)loadView
{
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:30.616083 longitude:-96.338908 zoom:13];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.myLocationEnabled = YES;
mapView_.delegate = self;
self.view = mapView_;
GMSMarkerOptions *options = [[GMSMarkerOptions alloc] init];
options.position = CLLocationCoordinate2DMake(30.616083, -96.338908);
options.title = #"College Station";
options.snippet = #"Texas";
[mapView_ addMarkerWithOptions:options];
}
#pragma mark - GMSMapViewDelegate
- (void)mapView:(GMSMapView *)mapView
didTapAtCoordinate:(CLLocationCoordinate2D)coordinate
{
[myMarker remove];
NSLog(#"You tapped at %f,%f", coordinate.latitude, coordinate.longitude);
GMSMarkerOptions *marker = [[GMSMarkerOptions alloc] init];
marker.position = CLLocationCoordinate2DMake(coordinate.latitude, coordinate.longitude);
marker.title = #"Tap Event";
// (icon for marker) marker.icon = [UIImage imageNamed:#"house"];
myMarker = [mapView_ addMarkerWithOptions:marker];
}
#end
In my storyboard i have a toolbar but I do not know how to get it to be displayed over the GMSMapView. Im new to iOS and have searched for solutions online but haven't had any luck with GMSMapView.
Because you set the view to the mapView_, the view made in StoryBoard is overriden. I've added a toolbar with an Segmented Control and an button using the following code:
CGRect screenBounds = [[UIScreen mainScreen] bounds];
UINavigationBar *navBar = [[UINavigationBar alloc]initWithFrame:CGRectMake(0, 0, screenBounds.size.width, 44)];
UINavigationItem *navItems = [[UINavigationItem alloc]init];
UIBarButtonItem *barButtonRight = [[UIBarButtonItem alloc]initWithTitle:#"" style:UIBarButtonItemStylePlain target:self action:#selector(SettingsButtonPressed)];
UISegmentedControll *segControl = [[UISegmentedControl alloc]initWithItems:[NSArray arrayWithObjects:#"Opt1",#"Opt2",#"Opt3", nil]];
UIImage *imageSettings= [UIImage imageNamed:#"36-toolbox.png"];
[segControl setSegmentedControlStyle:UISegmentedControlStyleBar];
[segControl setSelectedSegmentIndex:0];
[segControl setFrame:CGRectMake(10, 5, 150, 32)];
[segControl addTarget:self action:#selector(KiesVC:) forControlEvents:UIControlEventValueChanged];
[barButtonRight setImage:imageSettings];
[navItems setRightBarButtonItem:barButtonRight];
[navItems setTitleView:segControl];
[navBar setItems:[NSArray arrayWithObject:navItems] animated:NO];
You then add the toolbar by calling :
[self.view addSubview:navBar];
Hope it helps

Why does my CvVideoCamera cover the whole view?

I'm using a CvVideo Camera thus:
- (void)viewDidLoad
{
[super viewDidLoad];
self.videoCamera = [[CvVideoCamera alloc] initWithParentView:imageView];
self.videoCamera.delegate = self;
self.videoCamera.defaultAVCaptureDevicePosition = AVCaptureDevicePositionBack;
self.videoCamera.defaultAVCaptureSessionPreset = AVCaptureSessionPresetiFrame960x540;
self.videoCamera.defaultAVCaptureVideoOrientation = AVCaptureVideoOrientationPortrait;
self.videoCamera.defaultFPS = 30;
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.videoCamera start];
}
My storyboard looks like this:
When the view loads, the bar is visible briefly with the rest of the view white. Then when the camera starts it fills the whole screen. Why is it doing this?
Have you tried with a different parent view?
UIView *camView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 300, 400)];
[self.view addSubview:camView];
self.videoCamera = [[CvVideoCamera alloc] initWithParentView:camView];

Resources