Files
MapLibreParticleLab/ios
Konstantin Käfer 47ede853c4 fixes black flicker on rotating the device
fixes #838

instead of rendering ad libitum on the map thread, we are now driving rendering from the UI thread on iOS via the map.renderSync() function. There are still white bars during the rotation, but the general content of the view is kept visible.

- upgrades GLFW to 3.1
- removes swapped/needsSwap in favor of a more explicit scheme
- View#invalidate() now replaces View#swap() and is called whenever the View needs to trigger a rerender. GLFW and Android to this right away, while iOS goes back to the main thread and does the Map redrawing as part of the GLKView update
- sets all iOS deployment targets to 7.0
- disables SQLite3 version check, since the library version changed on iOS 8.2
2015-03-12 12:16:38 +01:00
..

Mapbox GL for iOS

Use or edit this project to get access to vector maps (via Mapbox Vector Tiles) and dynamic OpenGL-based styling in your iOS apps by using MGLMapView.

Installation

Currently in flux. See the parent mapbox-gl-native project README for details on building this library yourself.

Static and dynamic prebuilt binaries are coming back, as is CocoaPods support.

Example usage

Objective-C

MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:CGRectMake(0, 0, 400, 400)
                                            accessToken:@"<access token string>"];

[mapView setCenterCoordinate:CLLocationCoordinate2DMake(28.369334, -80.743779) 
                   zoomLevel:13 
                    animated:NO];

[mapView useBundledStyleNamed:@"outdoors"];

[self.view addSubview:mapView];

Swift

let mapView = MGLMapView(frame: CGRect(x: 0, y: 0, width: 400, height: 400),
                         accessToken: "<access token string>")

mapView.setCenterCoordinate(CLLocationCoordinate2D(latitude: 46.049900, longitude: -122.095678),
        zoomLevel: 12,
        animated: false)

mapView.useBundledStyleNamed("outdoors")

view.addSubview(mapView)

Development

If you'd like to contribute to this project, go up to Mapbox GL native and clone the project.

Testing

Currently in flux and not functioning.

Requirements

  • iOS 7+
  • a sense of adventure

Styling

See the online style reference for the latest documentation. Contained within the MapboxGL.bundle assets are a couple of starter styles in JSON format.

The project will eventually get a programmatic styling API as well.