Mapbox polygons not displayed in ios 7 app - ios

I have designed my required map on https://www.mapbox.com/editor/ with several polygons, however when I load the same map using the id on my ios 7 test app the map is displayed ok but the polygons are not visible/added in the ios app.
Here is the code I am using which is the sample code given on the mapbox site...
RMMapboxSource *tileSource = [[RMMapboxSource alloc] initWithMapID:#"ID_OF_MAPBOX_MAP"];
RMMapView *mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:tileSource];
[self.view addSubview:mapView];
Have tried many different changes but at this point I am trying to figure out if this is actually supported.

The API you want for this is -[RMMapboxSource initWithTileJSON:enablingDataOnMapView:]. However, only points are automatically supported right now. The relevant code is here if you are interested in submitting a patch, however.

Related

blue arrow in gmsmapview won't update whichever way i am facing

I am using google map SDK 1.9.1. And i have to display blue arrow at direction which ever direction i am facing. but In new SDK i am not find any property to enable it. In old SDK it display that arrow but in new SDK it don't display that arrow
#pragma mark
#pragma mark - setup the google map
-(void) setupMap
{
GMSMapView *mapView = [[GMSMapView alloc] init];
mapView.delegate = self;
[mapView setMyLocationEnabled:YES];
[mapView.settings setCompassButton:YES];
[mapView.settings setMyLocationButton:YES];
[[self getGoogleMapView] addSubview:mapView];
}
Edited
hi after some research i found that direction is not display in ipod only but if you used google map in iphone it display direction arrow.
The reason being that was a part of sensor parameter in the Direction API which is now Deprecated in all Google Maps Display.
Read the official Google Documentation. Scroll Down to the bottom of page and you will see that.

Mapbox caching in ios app

In the application I have some mapViews, and I want to support offline mode(caching). So: user installed app, the main screen contains mapView and it should cache it. Then user turns off the Wi-Fi and 3G, and tries to take a look at another mapView ( another viewController). It's not downloaded now. But the main screen's map is okay. Am I in the wrong way to cache?
the code for configuring the map is the same:
[[RMConfiguration sharedInstance] setAccessToken:#"pk.***"];
RMMapboxSource *tileSource = [[RMMapboxSource alloc] initWithMapID:kMapboxMapID];
[tileSource setCacheable:YES];
[self.mapView.tileCache setBackgroundCacheDelegate:self];
[self.mapView.tileCache beginBackgroundCacheForTileSource:tileSource southWest:CLLocationCoordinate2DMake(55.767363, 37.592843) northEast:CLLocationCoordinate2DMake(55.799801, 37.671229) minZoom:11 maxZoom:11];
self.mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:tileSource];
self.mapView.delegate=self;
[self.view addSubview:self.mapView];
If you aren't using RMTileCache's download methods to pre-fetch an area of the map, this will only work if the map area trying to be viewed in the second view controller is the same as that already viewed in the first.

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.

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

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

Google Maps SDK for iOS v1.2 markers not tappable

I've been using Google Maps SDK for iOS v1.1 without any problems, but just updated to v1.2 (and v1.2.1, released today). Now, when I create a GMSMarker, it can't be tapped to open the info window. The same also happens in the demo application bundled with the SDK, so I'm sure it's not just me.
I'm using the following code:
GMSMarker* marker = [GMSMarker markerWithPosition:CLLocationCoordinate2DMake(result.lat, result.lng)];
marker.title = result.shortName;
marker.tappable = YES;
marker.animated = YES;
marker.map = self.mapView;
I don't see what I could be doing wrong - it seems like a major issue with the updated SDK.
I've implemented all of the delegate methods on GMSMapViewDelegate, and I get nothing called when the marker is tapped.
Can anyone from Google Maps team help? Thanks.
Edit: I've done some further testing, and I believe that this is dependent on the orientation of the device!
Open SDK test application, 'Marker event' demo with device in portrait mode > Markers are tappable.
Open SDK test application, 'Marker event' demo with device in upside-down portrait mode > Markers are not tappable.
This issue has been fixed since version 1.2.2

Resources