Is there a way to change what the disclosure button in Apple Maps does? - ios

I have tried to use MapView, but after finding out that I won't be able to add directions, I am switching to Apple Maps. At first I wanted to add a navigation bar so that I could go back to my app from Apple Maps, but I have been informed that that's not possible. So now, I want to know if I can change the page that opens when I click an annotation view disclosure button in Apple Maps, and possibly lead it back to my app that way by opening one of my local view controllers.
Apple is giving me a hard time with navigating these maps...
If it is possible, please give a code sample or something, or explain what else I can do to lead Apple Maps back to my app.
So far, I use this code to open Apple Maps:
- (IBAction)mapPressed1:(id)sender
{
CLLocationCoordinate2D miamizoo = CLLocationCoordinate2DMake(25.613336,-80.398437);
MKPlacemark *placemark = [[MKPlacemark alloc] initWithCoordinate:miamizoo addressDictionary:nil];
MKMapItem *item = [[MKMapItem alloc] initWithPlacemark:placemark];
item.name = #"Miami Zoo";
[item openInMapsWithLaunchOptions:nil];
}
Thanks; all help is appreciated.

my initial quess is that it will not be possible because apple maps is an independent app from the one you're writing.
Apple maps is a ready, closed up application without any modification possibilities, so you will not be able to change the behavior of the disclosure button / add a bar into apple maps.
Anyone, please prove me wrong, because I also was puzzled about the missing direction feature in the map API.You will either have to use overlays for directions in map API or you bite the bullet and buy a ready made direction api for maps.
The way I'm currently doing it is similar to yours. I start up apple maps with a direction request and change into it, no overlays.
I hope they will make up for that in ios7.
They do make up for it. Didnt have the chance to put my hands on the ios7 beta, but it will be there.
El

Related

Here Map SDK IOS (Premium) tap on the marker

Good afternoon, who once worked with heremap sdk premium for ios. How do I make it possible to click on the NMAMapMarker? What they have written in the documentation does not describe it, but maybe I'm wrong.
there are different option available for NMAMapMarker to use.
This represents a marker used to display an icon on a geographical position on a map. The map handles proper placement of icons on the screen as well as panning and rotation.
+mapMarkerWithGeoCoordinates:
+mapMarkerWithGeoCoordinates:icon:
+mapMarkerWithGeoCoordinates:image:
coordinates
icon
draggable
draggingOffsetEnabled
anchorOffset
-initWithGeoCoordinates:
-initWithGeoCoordinates:icon:
-initWithGeoCoordinates:image:
-setAnchorOffsetUsingLayoutPosition:
-setSize:forZoomLevel:
-setSize:forZoomRange:
-resetIconSize
Check for more details : https://developer.here.com/documentation/ios-premium/3.18/api_reference_jazzy/Classes/NMAMapMarker.html#%2Fc:objc(cs)NMAMapMarker(im)initWithGeoCoordinates.
Please revert with your code implementation in case of any further concern.

google drive options is not visible in UIDocumentMenuViewController in IOS10

We have developed chat application and in that app there is one feature of file sharing like whatsapp, Its all working fine in up to iOS9.x, but when I test it in iOS10, google drive option immediately disappear.
That is what I am trying to describe in the case
Tried to send a file,but the google drive dissapear before I even get to select it.
Here is the steps taken before the bug happens :-
•On chat
•Select "Send File"
•Select "More"
•Able to see "Google Drive" for half second before it dissapear(See Attached photo) Options
But up to iOS9.x we there a option of google drive. I search lot on google and on Stackoverflow but Can't find any solution about iOS specific.
we write following code for this:
UIDocumentMenuViewController *documentProviderMenu = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:#[(NSString*)kUTTypeCompositeContent] inMode:UIDocumentPickerModeImport];
documentProviderMenu.delegate = self;
documentProviderMenu.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:documentProviderMenu animated:YES completion:nil];
new edit:
I get one thing, its hide by UIDocumentMenuViewController because see in second image, if I drag row upside then its appear and google drive available in row number -1. If I re arrange it then I can get it in second row, but first row is disappear by default (not displaying in the screen).
I apply following things but not succeeded.
http://www.openradar.me/radar?id=5065803028234240
http://openradar.appspot.com/19385063
http://www.openradar.me/radar?id=6144449704886272
http://openradar.appspot.com/radar?id=6144449704886272
Please any one tell me what is the issue? Thanks in advance...
I have also faced the same issue. I was able to solve the issue by making navigation bar translucent. You may also use
UINavigationBar.appearance().isTranslucent = true
This appears to be a bug and there is also a similar issue reported here http://www.openradar.me/24564847

How to remove an arrow from Google Maps geolocation marker (iOS)?

How do you remove an arrow from Google Maps geolocation marker (iOS)?
This is an arrow I'm talking about
If you really want to remove that arrow everywhere in your app from Google Maps SDK, it might be easiest to modify asset in GoogleMaps.framework.
Just navigate (cd) to GoogleMaps.framework/Versions/A/Resources/GoogleMaps.bundle/GMSCoreResources.bundle/ and notice the following files:
GMSSprites-0-1x.png
GMSSprites-0-2x.png
GMSSprites-0-3x.png
If you open these files, you can notice the arrow is there. So just edit directly in the asset by replacing arrow by nothing (transparent pixels).
Note: I haven't test it myself and this is not tested solution, but I believe it should work.
Disclaimer: I'm not sure, but I think this modification might violate Terms & Conditions for using the SDK. I don't get any responsibility for such modification, it's your call...
There is no way to do this with current version of the SDK (1.9.1), and actually there is an open issue with this request: Look here.
As a work around, you can hide the default button with:
_map.myLocationEnabled = NO;
Then create a custom GMSMarker
GMSMarker *pointMarker = [GMSMarker markerWithPosition:currentPosition];
pointMarker.icon = [UIImage imageNamed:#"YourImage"];
pointMarker.map = _map;
And change the position of it using a CLLocationManager, so it always show the current position. It's a bit tricky but is the only way, I could think, that you can achieve this. If you need a more complete example let me know.

MapBox iOS SDK - First steps

I'm having problems taking the first few steps with MapBox iOS SDK (1.4.1).
I've started with the suggested code over here: https://www.mapbox.com/mapbox-ios-sdk/examples/
- (void)viewDidLoad {
[super viewDidLoad];
self.mapBoxView.tileSource = [[RMMapboxSource alloc] initWithMapID:#"my_map_id" enablingDataOnMapView:_mapBoxView];
self.mapBoxView.userTrackingMode = RMUserTrackingModeNone;
CLLocationCoordinate2D centerLocation;
centerLocation.latitude = NRMapStartLatitude;
centerLocation.longitude = NRMapStartLongitude;
[self.mapBoxView setCenterCoordinate:centerLocation];
[self.mapBoxView setZoom:7 animated:YES];
}
No matter what I do the map starts at a location in Washington D.C. but I've set the center coordinate to be somewhere in Europe.
The same with the zoom. No matter what value I try it has no effect on the map.
There's something with the NSLog output that confuses me. At startup it says:
Using watermarked example map ID examples.map-z2effxa8. Please go to
https://mapbox.com and create your own map style.
I was assuming that this is something that I already did by registering for a free account there and starting with my first project.
Added the tilesource 'My First Map' to the container
Origin is calculated at: 120.786199, -85.000000 Map initialised. tileSource:RMMapboxSource:
Mapbox iOS Example, zooms 0-19, no interactivity, minZoom:2.000000, maxZoom:18.000000,
zoom:18.000000 at {-77.032458,38.913175}
Apparently the sample project in the iOS SDK is loaded and ignoring everything else I try to configure.
So, how do I configure the map so I can interact with the API. What am I missing?
Any kind of help is highly appreciated. Thank you!
OK, whoever is struggling with that. The trick is to set the zoom BEFORE you set the center coordinate..
..for whatever reason.

Does hiding "Legal" in MKMapView result in an App Store rejection?

I'm displaying an MKMapView in a somewhat small square. It's small enough that the "Legal" text pretty much blocks half the map, so I'd like to get rid of it.
Is this allowed:
for (UIView *view in mapView.subviews) {
if ([NSStringFromClass([view class]) isEqualToString:#"MKAttributionLabel"]) {
view.hidden = YES;
break;
}
}
Not sure if I am risking App Store rejection by hiding it or using this method?
Yes, it will probably get rejected. Either because having the link is a legal requirement, or it'll be detected that you're using a private class (MKAttributionLabel).
That being said, you might get away with it for a few releases, if they don't notice.
Have you thought about using a static image instead of an MKMapView?
You are using undocumented features/classes. Since your map feature is very limited, you are better off using google's static map api instead of linking to a full feature framework just to show a small square of a map.

Resources