Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Update gl-native #326

Merged
merged 26 commits into from
Jul 6, 2020
Merged

Update gl-native #326

merged 26 commits into from
Jul 6, 2020

Conversation

julianrex
Copy link
Contributor

@julianrex julianrex commented Jul 2, 2020

This PR updates the Mapbox Maps SDK for iOS to use a pre-built GL Native binary rather than building from source as a submodule dependency. GL Native is changing some of its development workflows to build some Mapbox platform-specific features internally, similar to Chrome/Chromium development.

How to build
Going forward, updates to the build process are as follows:

  • Sign up or login to your Mapbox account.
  • Go to your Mapbox account's access tokens page (https://account.mapbox.com/access-tokens/) and create a secret token with the downloads:read scope.
  • Create a ~/.netrc file which looks like this
     machine api.mapbox.com
     login mapbox
     password <INSERT API TOKEN>
    
  • If using Cocoapods, build the project as you would have before.
  • If using Carthage, you will need to make a few quick updates
    • Update cartfile:
    binary "https://api.mapbox.com/downloads/v2/carthage/mobile-maps/mapbox-ios-sdk-dynamic.json" ~> 5.10.0-alpha.1
    github "mapbox/mapbox-events-ios" ~> 0.10
    
    • Install dependencies via carthage update appending --use-netrc :
      carthage update --platform iOS --use-netrc
  • Direct Downloads are not supported in this alpha release

License update for Mapbox builds of GL Native
New binary releases of GL Native are now licensed under the Mapbox Terms of Service. The Mapbox Maps SDKs repos will continue to be public and licensed under BSD-2.

If you have any questions about how this change does or doesn’t impact your use of the Maps SDK please don’t hesitate to reach out to Mapbox Support to connect with the Mapbox team.

@julianrex julianrex requested a review from 1ec5 as a code owner July 2, 2020 20:41
@julianrex julianrex requested a review from a team July 2, 2020 20:41
@julianrex julianrex removed request for a team and 1ec5 July 2, 2020 22:42
@nishant-karajgikar nishant-karajgikar self-assigned this Jul 6, 2020
Comment on lines 10 to 31
- Source Modularization.
Introduces a SourceManager + *SourceFactory classes similar to the work done on layer modularization.

- [core] Enable source "volatile" flag initialization in style.

The source `volatile` flag value can be defined in the style as following:

```
"example_source": {
"volatile": true
}
```

For the sources with the `volatile` flag set, the tiles are not stored in the local storage. The `volatile` flag is applicable for all source types, which allow loading tiles from a remote server i.e. `vector`, `raster`, `raster-dem` source types. For other source types this setting is ignored.

- [core] Enable `Renderer::collectPlacedSymbolData()` API for all map modes.

Before, it was functional only for the `Tile` map mode.

- [core] Add `emphasis-circle-color` and `emphasis-circle-radius` properties to LocationIndicator layer.

LocationIndicator layer gets the ability to draw an additional circle, controlled via these two properties, to create effects that emphasize the indicator.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think any of these changes are applicable to the iOS or macOS map SDK yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@1ec5 what do you think is missing / blocking the availability of the source volatile flag? GL Native enabled customers setting the flag in the style, and I thought that should flow through to the iOS SDK, particularly since caching is controlled in native

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I overlooked that one. It should work fine, but we should mention it as an option in style JSON. To my knowledge, we haven’t hooked it up to MGLTileSourceOption in the runtime styling API. It would be an easy change but it just hasn’t happened yet.

platform/ios/CHANGELOG.md Outdated Show resolved Hide resolved
platform/ios/CHANGELOG.md Outdated Show resolved Hide resolved
Comment on lines 37 to 52
The `GeoJSON` geometry will be clipped based on the tile of the evaluated feature if its contained points are over the `GeometryPointsThreshold`.

- [core] Introduce `DatabaseFileSource::prefetchAmbientCache()`.
This method pre-fetches resources from network and populates the ambient cache.

- Introduce LRU queue and setting to control queue size.

Last recently used (LRU) access events are recorded for single resource or tile request, therefore, reduce performance and deteriorate storage. LRU queue size setting allows to control how often queue is flushed to the database. Default queue size is 50.

- [core] Batch API to pre-fetch ambient cache.
Now OfflineDownloadParameters can be initialized with a list of locations. Each location is represented with a `LatLngBoundsZoom` instance.

Thus, we can fetch multiple areas with a single `DatabaseFileSource::prefetchAmbientCache()` API call (and parsing the style only once).

- [core] Introduce `hashLayout()` function for Layer::Impl.
`hashLayout()` is used to generate aggregated hash value for layout properties. It will replace `stringifyLayout()` when grouping layout.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think any of these changes apply to the iOS or macOS map SDK yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

platform/ios/CHANGELOG.md Outdated Show resolved Hide resolved
platform/ios/CHANGELOG.md Outdated Show resolved Hide resolved

Before, it was functional only for the `Tile` map mode.

- [core] Add `emphasis-circle-color` and `emphasis-circle-radius` properties to LocationIndicator layer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LocationIndicatorLayer is not used on iOS Hydrogen.


### ✨ New features

- Source Modularization.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot be accessed on iOS SDK yet.


For the sources with the `volatile` flag set, the tiles are not stored in the local storage. The `volatile` flag is applicable for all source types, which allow loading tiles from a remote server i.e. `vector`, `raster`, `raster-dem` source types. For other source types this setting is ignored.

- [core] Enable `Renderer::collectPlacedSymbolData()` API for all map modes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the impact of this change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this applies to iOS developers, we should rephrase and reformat to match the rest of our changelog entries.

Comment on lines 10 to 31
- Source Modularization.
Introduces a SourceManager + *SourceFactory classes similar to the work done on layer modularization.

- [core] Enable source "volatile" flag initialization in style.

The source `volatile` flag value can be defined in the style as following:

```
"example_source": {
"volatile": true
}
```

For the sources with the `volatile` flag set, the tiles are not stored in the local storage. The `volatile` flag is applicable for all source types, which allow loading tiles from a remote server i.e. `vector`, `raster`, `raster-dem` source types. For other source types this setting is ignored.

- [core] Enable `Renderer::collectPlacedSymbolData()` API for all map modes.

Before, it was functional only for the `Tile` map mode.

- [core] Add `emphasis-circle-color` and `emphasis-circle-radius` properties to LocationIndicator layer.

LocationIndicator layer gets the ability to draw an additional circle, controlled via these two properties, to create effects that emphasize the indicator.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@1ec5 what do you think is missing / blocking the availability of the source volatile flag? GL Native enabled customers setting the flag in the style, and I thought that should flow through to the iOS SDK, particularly since caching is controlled in native

Comment on lines 37 to 52
The `GeoJSON` geometry will be clipped based on the tile of the evaluated feature if its contained points are over the `GeometryPointsThreshold`.

- [core] Introduce `DatabaseFileSource::prefetchAmbientCache()`.
This method pre-fetches resources from network and populates the ambient cache.

- Introduce LRU queue and setting to control queue size.

Last recently used (LRU) access events are recorded for single resource or tile request, therefore, reduce performance and deteriorate storage. LRU queue size setting allows to control how often queue is flushed to the database. Default queue size is 50.

- [core] Batch API to pre-fetch ambient cache.
Now OfflineDownloadParameters can be initialized with a list of locations. Each location is represented with a `LatLngBoundsZoom` instance.

Thus, we can fetch multiple areas with a single `DatabaseFileSource::prefetchAmbientCache()` API call (and parsing the style only once).

- [core] Introduce `hashLayout()` function for Layer::Impl.
`hashLayout()` is used to generate aggregated hash value for layout properties. It will replace `stringifyLayout()` when grouping layout.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

nishant-karajgikar and others added 4 commits July 6, 2020 15:16
Co-authored-by: Minh Nguyễn <mxn@1ec5.org>
Co-authored-by: Minh Nguyễn <mxn@1ec5.org>
Co-authored-by: Minh Nguyễn <mxn@1ec5.org>
Co-authored-by: Minh Nguyễn <mxn@1ec5.org>
platform/ios/CHANGELOG.md Outdated Show resolved Hide resolved
platform/ios/CHANGELOG.md Outdated Show resolved Hide resolved
platform/ios/CHANGELOG.md Outdated Show resolved Hide resolved
platform/ios/CHANGELOG.md Outdated Show resolved Hide resolved
platform/ios/CHANGELOG.md Outdated Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants