Skip to content

Commit

Permalink
Bump gl-native 10.13.0-rc.1 (#1637)
Browse files Browse the repository at this point in the history
  • Loading branch information
jush authored Apr 18, 2023
1 parent 01ebb5b commit d3cde6a
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ Mapbox welcomes participation and contributions from everyone.
# 10.13.0-rc.1
## Features ✨ and improvements 🏁
* Add overloaded methods to `CameraAnimatorsFactory` allowing to set camera animator owner.
* Improve startup performance by calculating the style expressions dependencies lazily.
* Introduce a new APIs `coordinateInfoForPixel(pixel: ScreenCoordinate): CoordinateInfo` and `coordinatesInfoForPixels(pixels: List<ScreenCoordinate>): List<CoordinateInfo>` which will return record(s) containing both `coordinate` and `isOnSurface` info.

## Bug fixes 🐞
* Fix 3d location layer properties `model-scale-transition` and `model-rotation-transition`, made them non-transitionable.
* Fix raw expression parsing for list literal.
* Fix text flickering while symbol layer update if `text-field` contains `text-color` property inside the format expression.

## Dependencies
* Update gl-native to v10.13.0-rc.1 and common to v23.5.0-rc.1.


# 10.13.0-beta.1 April 05, 2023
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ License: [The Apache Software License, Version 2.0](http://www.apache.org/licens

===========================================================================

### MapboxCoreMaps,10.13.0-beta.1,Mapbox ToS,Mapbox,https://www.mapbox.com/
### MapboxCoreMaps,10.13.0-rc.1,Mapbox ToS,Mapbox,https://www.mapbox.com/

```
Mapbox Core Maps version 10.0
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Project.kt
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ object Versions {
const val mapboxGestures = "0.8.0"
const val mapboxJavaServices = "5.4.1"
const val mapboxBase = "0.8.0"
const val mapboxGlNative = "10.13.0-beta.1"
const val mapboxCommon = "23.5.0-beta.1"
const val mapboxGlNative = "10.13.0-rc.1"
const val mapboxCommon = "23.5.0-rc.1"
const val androidxCore = "1.7.0" // last version compatible with kotlin 1.5.31
const val androidxFragmentTesting = "1.5.0"
const val androidxAnnotation = "1.1.0"
Expand Down
2 changes: 2 additions & 0 deletions sdk-base/api/PublicRelease/metalava.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,9 @@ package com.mapbox.maps.plugin.delegates {
method public com.mapbox.maps.CoordinateBoundsZoom coordinateBoundsZoomForCamera(com.mapbox.maps.CameraOptions camera);
method public com.mapbox.maps.CoordinateBoundsZoom coordinateBoundsZoomForCameraUnwrapped(com.mapbox.maps.CameraOptions camera);
method public com.mapbox.geojson.Point coordinateForPixel(com.mapbox.maps.ScreenCoordinate pixel);
method public com.mapbox.maps.CoordinateInfo coordinateInfoForPixel(com.mapbox.maps.ScreenCoordinate pixel);
method public java.util.List<com.mapbox.geojson.Point> coordinatesForPixels(java.util.List<com.mapbox.maps.ScreenCoordinate> pixels);
method public java.util.List<com.mapbox.maps.CoordinateInfo> coordinatesInfoForPixels(java.util.List<com.mapbox.maps.ScreenCoordinate> pixels);
method public void dragEnd();
method public void dragStart(com.mapbox.maps.ScreenCoordinate point);
method public com.mapbox.maps.CameraBounds getBounds();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,21 @@ interface MapCameraManagerDelegate {
*/
fun coordinateForPixel(pixel: ScreenCoordinate): Point

/**
* Calculates the geographical coordinate information that corresponds to a given screen coordinate.
*
* The screen coordinate is in platform pixels, relative to the top left corner of the map (not the whole screen).
*
* The returned coordinate will be the closest position projected onto the map surface,
* in case the screen coordinate does not intersect with the map surface.
*
* @param pixel The screen coordinate on the map, in platform pixels.
*
* @return A [CoordinateInfo] record containing information about the geographical coordinate corresponding to the given screen coordinate, including whether it is on the map surface.
*
*/
fun coordinateInfoForPixel(pixel: ScreenCoordinate): CoordinateInfo

/**
* Calculates screen coordinates that corresponds to geographical coordinates
* (i.e., longitude-latitude pair).
Expand Down Expand Up @@ -214,6 +229,21 @@ interface MapCameraManagerDelegate {
*/
fun coordinatesForPixels(pixels: List<ScreenCoordinate>): List<Point>

/**
* Calculates the geographical coordinates information that corresponds to the given screen coordinates.
*
* The screen coordinates are in platform pixels, relative to the top left corner of the map (not the whole screen).
*
* The returned coordinate will be the closest position projected onto the map surface,
* in case the screen coordinate does not intersect with the map surface.
*
* @param pixels The screen coordinates on the map, in platform pixels.
*
* @return The [CoordinateInfo] records containing information about the geographical coordinates corresponding to the given screen coordinates, including whether they are on the map surface.
*
*/
fun coordinatesInfoForPixels(pixels: List<ScreenCoordinate>): List<CoordinateInfo>

/**
* Changes the map view by any combination of center, zoom, bearing, and pitch, without an animated transition.
* The map will retain its current values for any details not passed via the camera options argument.
Expand Down
2 changes: 2 additions & 0 deletions sdk/api/PublicRelease/metalava.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ package com.mapbox.maps {
method public com.mapbox.maps.CoordinateBoundsZoom coordinateBoundsZoomForCameraUnwrapped(com.mapbox.maps.CameraOptions camera);
method public com.mapbox.geojson.Point coordinateForPixel(com.mapbox.maps.ScreenCoordinate pixel);
method public com.mapbox.geojson.Point coordinateForProjectedMeters(com.mapbox.maps.ProjectedMeters projectedMeters);
method public com.mapbox.maps.CoordinateInfo coordinateInfoForPixel(com.mapbox.maps.ScreenCoordinate pixel);
method public java.util.List<com.mapbox.geojson.Point> coordinatesForPixels(java.util.List<com.mapbox.maps.ScreenCoordinate> pixels);
method public java.util.List<com.mapbox.maps.CoordinateInfo> coordinatesInfoForPixels(java.util.List<com.mapbox.maps.ScreenCoordinate> pixels);
method public void dragEnd();
method public void dragStart(com.mapbox.maps.ScreenCoordinate point);
method public void executeOnRenderThread(Runnable runnable);
Expand Down
8 changes: 8 additions & 0 deletions sdk/src/main/java/com/mapbox/maps/NativeMapImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,14 @@ internal class NativeMapImpl(val map: MapInterface) :
return map.coordinateForPixel(screenCoordinate)
}

override fun coordinateInfoForPixel(pixel: ScreenCoordinate): CoordinateInfo {
return map.coordinateInfoForPixel(pixel)
}

override fun coordinatesInfoForPixels(pixels: List<ScreenCoordinate>): List<CoordinateInfo> {
return map.coordinatesInfoForPixels(pixels)
}

override fun getDebug(): List<MapDebugOptions> {
return map.debug
}
Expand Down
35 changes: 35 additions & 0 deletions sdk/src/public/java/com/mapbox/maps/MapboxMap.kt
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,23 @@ class MapboxMap :
return nativeMap.coordinateForPixel(pixel)
}

/**
* Calculates the geographical coordinate information that corresponds to a given screen coordinate.
*
* The screen coordinate is in platform pixels, relative to the top left corner of the map (not the whole screen).
*
* The returned coordinate will be the closest position projected onto the map surface,
* in case the screen coordinate does not intersect with the map surface.
*
* @param pixel The screen coordinate on the map, in platform pixels.
*
* @return A [CoordinateInfo] record containing information about the geographical coordinate corresponding to the given screen coordinate, including whether it is on the map surface.
*/
override fun coordinateInfoForPixel(pixel: ScreenCoordinate): CoordinateInfo {
checkNativeMap("coordinateInfoForPixel")
return nativeMap.coordinateInfoForPixel(pixel)
}

/**
* Calculate geographical coordinates(i.e., longitude-latitude pair) that corresponds
* to screen coordinates.
Expand All @@ -866,6 +883,24 @@ class MapboxMap :
return nativeMap.coordinatesForPixels(pixels)
}

/**
* Calculates the geographical coordinates information that corresponds to the given screen coordinates.
*
* The screen coordinates are in platform pixels, relative to the top left corner of the map (not the whole screen).
*
* The returned coordinate will be the closest position projected onto the map surface,
* in case the screen coordinate does not intersect with the map surface.
*
* @param pixels The screen coordinates on the map, in platform pixels.
*
* @return The [CoordinateInfo] records containing information about the geographical coordinates corresponding to the given screen coordinates, including whether they are on the map surface.
*
*/
override fun coordinatesInfoForPixels(pixels: List<ScreenCoordinate>): List<CoordinateInfo> {
checkNativeMap("coordinatesInfoForPixels")
return nativeMap.coordinatesInfoForPixels(pixels)
}

/**
* Calculate distance spanned by one pixel at the specified latitude
* and zoom level.
Expand Down
16 changes: 16 additions & 0 deletions sdk/src/test/java/com/mapbox/maps/NativeMapTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,22 @@ class NativeMapTest {
verify { map.coordinateForPixel(value) }
}

@Test
fun coordinateInfoForPixel() {
val value = mockk<ScreenCoordinate>()
val nativeMap = NativeMapImpl(map)
nativeMap.coordinateInfoForPixel(value)
verify { map.coordinateInfoForPixel(value) }
}

@Test
fun coordinatesInfoForPixel() {
val value = mockk<List<ScreenCoordinate>>()
val nativeMap = NativeMapImpl(map)
nativeMap.coordinatesInfoForPixels(value)
verify { map.coordinatesInfoForPixels(value) }
}

@Test
fun pixelsForCoordinates() {
val value = mockk<MutableList<Point>>()
Expand Down

0 comments on commit d3cde6a

Please sign in to comment.