Last changes before Metal release (#2024)

This commit is contained in:
Bart Louwers
2024-01-17 01:28:40 +07:00
committed by GitHub
parent 7479d8c899
commit f1cdc20daa
6 changed files with 16 additions and 59 deletions

View File

@@ -208,7 +208,7 @@ jobs:
- name: Build XCFramework
run: |
bazel build --compilation_mode=opt --//:renderer=metal --//:maplibre_platform=ios //platform/ios:MapLibre.dynamic
bazel build --compilation_mode=opt --//:renderer=metal --//:maplibre_platform=ios //platform/ios:MapLibre.dynamic --embed_label=maplibre_ios_"$(cat VERSION)"
echo xcframework="$(bazel info execution_root)"/"$(bazel cquery --output=files --compilation_mode=opt --//:renderer=metal --//:maplibre_platform=ios //platform/ios:MapLibre.dynamic)" >> "$GITHUB_ENV"
- name: Get version (release)

View File

@@ -1,6 +1,7 @@
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_xcframework", "apple_xcframework")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_framework")
load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle")
load("@build_bazel_rules_apple//apple:versioning.bzl", "apple_bundle_version")
load(
"@rules_xcodeproj//xcodeproj:defs.bzl",
"top_level_target",
@@ -120,6 +121,17 @@ apple_static_xcframework(
deps = ["//platform:ios-sdk"],
)
apple_bundle_version(
name = "maplibre_ios_version",
build_label_pattern = "maplibre_ios_{version}",
build_version = "{version}",
capture_groups = {
"version": "[0-9]+.[0-9]+.[0-9]+",
},
fallback_build_label = "maplibre_ios_1.2.3456789",
short_version_string = "{version}",
)
apple_xcframework(
name = "MapLibre.dynamic",
bundle_id = "com.maplibre.mapbox",
@@ -139,6 +151,7 @@ apple_xcframework(
minimum_os_versions = {"ios": "12.0"},
public_hdrs = public_hdrs,
umbrella_header = "umbrella_header",
version = ":maplibre_ios_version",
visibility = ["//visibility:public"],
deps = ["//platform:ios-sdk-dynamic"],
)

View File

@@ -8,14 +8,13 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C
* This is the first release that uses **Metal** for rendering. This is a graphics API from Apple that replaces OpenGL ES on Apple platforms.
* Note that the [snapshotter](https://github.com/maplibre/maplibre-native/issues/1862) has not been implemented yet for the Metal renderer. Hold off updating if your application requires this functionality.
* While we had a long period of pre-releases and testing leading up to this release, and no crashes have been reported, it is possible that you come across inconsistencies or problems in production apps. Please report them on [GitHub](https://github.com/maplibre/maplibre-native/issues/1609).
* While we had a long period of pre-releases and testing leading up to this release, and no crashes have been reported, it is possible that you come across inconsistencies or problems in production apps. Please report them on GitHub.
* 💥 Breaking: Changed the prefix of files, classes, methods, variables and everything from `MGL` to `MLN`. ([#919](https://github.com/maplibre/maplibre-native/pull/919)).
> To migrate:
> Change all your `MGL` prefixes to `MLN`. If you are using `NSKeyedArchiver` or similar mechanishm to save the state, the app may crash after this change when trying to unarchive the state using old names of the classes. You need to clean the saved state of the app and save it using new classes.
* 💥 Breaking: The OpenGL ES renderer now uses OpenGL ES 3.0. This means that only iOS Devices with an Apple A7 GPU or later are supported. https://developer.apple.com/library/archive/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/BestPracticesforAppleA7GPUsandLater/BestPracticesforAppleA7GPUsandLater.html
* Add `MLNMapView.setLatLngBounds` and `MLNMapView.clearLatLnBounds`
* Add `flyToCamera` with `edgePadding` for `MLNMapView`
* The Swift package needs to be imported with `import MapLibre` instead of `import Mapbox`.
## 5.13.0 - January 05, 2023

View File

@@ -38,11 +38,6 @@ static const MLNCoordinateBounds colorado = {
.ne = { .latitude = 40.989329, .longitude = -102.062592},
};
static const MLNCoordinateBounds areaAroundBelgium = {
.sw = { .latitude = 52.2782, .longitude = 8.289179999999988},
.ne = { .latitude = 48.5584, .longitude = 1.0162300000000073},
};
static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXViewControllerAnnotationViewReuseIdentifer";
typedef NS_ENUM(NSInteger, MBXSettingsSections) {
@@ -118,7 +113,6 @@ typedef NS_ENUM(NSInteger, MBXSettingsRuntimeStylingRows) {
};
typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
MBXSettingsMiscellaneousLatLngBoundsConstraints,
MBXSettingsMiscellaneousWorldTour,
MBXSettingsMiscellaneousRandomTour,
MBXSettingsMiscellaneousScrollView,
@@ -248,7 +242,6 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
BOOL _isTouringWorld;
BOOL _contentInsetsEnabled;
UIEdgeInsets _originalContentInsets;
BOOL _hasLatLngBoundConstraints;
}
// MARK: - Setup & Teardown
@@ -455,7 +448,6 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
break;
case MBXSettingsMiscellaneous:
[settingsTitles addObjectsFromArray:@[
_hasLatLngBoundConstraints ? @"Remove LatLng bound constraints" : @"Set LatLng bound box constraint",
@"Start World Tour",
@"Random Tour",
@"Embedded Map View",
@@ -689,9 +681,6 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
case MBXSettingsMiscellaneous:
switch (indexPath.row)
{
case MBXSettingsMiscellaneousLatLngBoundsConstraints:
[self setLatLngBoundsConstraints];
break;
case MBXSettingsMiscellaneousLocalizeLabels:
[self toggleStyleLabelsLanguage];
break;
@@ -1506,20 +1495,6 @@ CLLocationCoordinate2D randomWorldCoordinate(void) {
}
}
-(void)setLatLngBoundsConstraints
{
if(_hasLatLngBoundConstraints) {
[self.mapView clearLatLnBounds];
[self.mapView resetPosition];
} else {
MLNMapCamera *newCamera = [self.mapView cameraThatFitsCoordinateBounds: areaAroundBelgium];
[self.mapView setCamera: newCamera];
[self.mapView setLatLngBounds: areaAroundBelgium];
}
_hasLatLngBoundConstraints = !_hasLatLngBoundConstraints;
}
-(void)toggleStyleLabelsLanguage
{
_localizingLabels = !_localizingLabels;

View File

@@ -1383,18 +1383,6 @@ MLN_EXPORT
*/
- (CGPoint)anchorPointForGesture:(UIGestureRecognizer *)gesture;
/**
* Sets a LatLngBounds that constraints map transformations to this bounds.
* @param latLngBounds the bounds to constrain the map with
*/
- (void)setLatLngBounds:(MLNCoordinateBounds)latLngBounds;
/**
* Clears the bounds that were set via `setLatLngBounds`
*/
- (void)clearLatLnBounds;
/**
The distance from the edges of the map view’s frame to the edges of the map
view’s logical viewport.

View File

@@ -2695,7 +2695,6 @@ public:
currentCameraOptions.anchor = anchor;
MLNCoordinateBounds bounds = MLNCoordinateBoundsFromLatLngBounds(self.mbglMap.latLngBoundsForCamera(currentCameraOptions));
return [self cameraThatFitsCoordinateBounds:bounds];
}
@@ -3834,23 +3833,6 @@ static void *windowScreenContext = &windowScreenContext;
self.mbglMap.setBounds(mbgl::BoundOptions().withMinZoom(minimumZoomLevel));
}
- (void)clearLatLnBounds
{
mbgl::BoundOptions newBounds = mbgl::BoundOptions().withLatLngBounds(mbgl::LatLngBounds());
self.mbglMap.setBounds(newBounds);
}
- (void)setLatLngBounds:(MLNCoordinateBounds)latLngBounds
{
mbgl::LatLng sw = {latLngBounds.sw.latitude, latLngBounds.sw.longitude};
mbgl::LatLng ne = {latLngBounds.ne.latitude, latLngBounds.ne.longitude};
mbgl::BoundOptions newBounds = mbgl::BoundOptions().withLatLngBounds(mbgl::LatLngBounds::hull(sw, ne));
self.mbglMap.setBounds(newBounds);
}
- (double)minimumZoomLevel
{
return *self.mbglMap.getBounds().minZoom;