Skip to content

tuyen-vuduc/mapbox-ios-objective-c

Repository files navigation

Mapbox in Objective-C

Mapbox is a well-known service which provide mapping and navigation services across platforms from iOS/Android and Web. Their SDK for iOS was migrated to Swift entirely and no longer fully compatible with Objective-C, if not say very little.

This library is to provide Objective-C compabatible APIs to work with Mapbox fully in Objective-C and other cross platform frameworks like Xamarin. This repo is built as an input for the libaray Xamarin.iOS for Mapbox.iOS.

Usage

CLLocationCoordinate2D centerLocation = CLLocationCoordinate2DMake(55.665957, 12.550343);
    
TMBCameraOptions* cameraOptions = [[TMBCameraOptions alloc] initWithCenter:centerLocation padding:UIEdgeInsetsMake(0, 0, 0, 0) anchor:CGPointMake(0, 0) zoom:8 bearing:0 pitch:0];

MapInitOptions* options= [MapInitOptionsFactory createWithMapOptions:nil cameraOptions:cameraOptions styleURI:nil styleJSON:nil antialiasingSampleCount:1];

self.mapView = [MapViewFactory createWithFrame:self.view.bounds
                                options:options];
self.mapView.autoresizingMask = (UIViewAutoresizingFlexibleWidth |
                                    UIViewAutoresizingFlexibleHeight);

[self.view addSubview:self.mapView];

Installation

pod 'MapboxMapObjC', '11.0.0'

Ported Examples

# Example Ported
1 AddMarkersSymbolExample
2 AddOneMarkerSymbolExample OK
3 AdvancedViewportGesturesExample
4 AnimateGeoJSONLineExample
5 AnimateImageLayerExample
6 AnimateLayerExample
7 AnimatedMarkerExample
8 BasicLocationPulsingExample
9 BasicMapExample OK
10 BuildingExtrusionsExample OK
11 CameraAnimationExample
12 CameraAnimatorsExample
13 CircleAnnotationExample OK
14 ColorExpressionExample
15 Custom2DPuckExample
16 Custom3DPuckExample
17 CustomLayerExample
18 CustomLocationProviderExample
19 CustomPointAnnotationExample
20 CustomStyleURLExample OK
21 DataDrivenSymbolsExample
22 DataJoinExample
23 DebugMapExample OK
24 DistanceExpressionExample
25 ExternalVectorSourceExample
26 FeatureStateExample
27 FeaturesAtPointExample
28 FrameViewAnnotationsExample
29 GlobeExample
30 GlobeFlyToExample
31 HeatmapLayerGlobeExample
32 IconSizeChangeExample
33 LargeGeoJSONPerformanceExample
34 LayerPositionExample
35 LineAnnotationExample
36 LineGradientExample
37 LiveDataExample
38 LocalizationExample
39 MultipleGeometriesExample
40 NavigationSimulatorExample
41 OfflineManagerExample OK
42 OfflineRegionManagerExample
43 PitchAndDistanceExample
44 PointAnnotationClusteringExample
45 PointClusteringExample
46 PolygonAnnotationExample OK
47 RasterTileSourceExample
48 ResizableImageExample
49 RestrictCoordinateBoundsExample
50 SceneKitExample OK
51 ShowHideLayerExample
52 SkyLayerExample OK
53 SnapshotterCoreGraphicsExample
54 SnapshotterExample
55 SpinningGlobeExample
56 StoryboardMapViewExample OK
57 SwitchStylesExample
58 SymbolClusteringExample
59 TerrainExample OK
60 TrackingModeExample
61 ViewAnnotationAnimationExample
62 ViewAnnotationBasicExample
63 ViewAnnotationMarkerExample
64 ViewAnnotationWithPointAnnotationExample
65 ViewportExample
66 VoiceOverAccessibilityExample

Maintainer

This project is maintained by tuyen-vuduc in his spare time and/or when requested.

If you find this project is helpful, please give it a star, become a sponsor of the project and/or buy him a coffee.

"Buy Me A Coffee"

LICENSE

This library is release under The BSD 3-Clause License. You are freely to use and make changes. However, this license doesn't override the license from Mapbox.