@nativescript-community/ui-mapbox 7.0.11 → 7.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [7.0.12](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.11...v7.0.12) (2025-11-12)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **ios:** marker anchor fix ([d087251](https://github.com/nativescript-community/ui-mapbox/commit/d0872511ce9b17e9f52e2ee67c2add6d7ab0a5cd))
|
|
11
|
+
|
|
6
12
|
## [7.0.11](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.10...v7.0.11) (2025-11-07)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nativescript-community/ui-mapbox",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.12",
|
|
4
4
|
"description": "Interactive, thoroughly customizable maps powered by vector tiles and OpenGL.",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@nativescript-community/perms": "^3.0.4"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "594cf940edc6d9adc7944567379a2d42b871b231"
|
|
59
59
|
}
|
|
@@ -125,6 +125,8 @@ public class MapboxBridge: NSObject {
|
|
|
125
125
|
private var imageRegistry: [String: UIImage] = [:]
|
|
126
126
|
private var viewAnnotationByMarkerId: [String: ViewAnnotation] = [:]
|
|
127
127
|
|
|
128
|
+
private var defaultPinImageHeight: CGFloat = 0
|
|
129
|
+
|
|
128
130
|
// Camera handling
|
|
129
131
|
private var cameraIdleWorkItem: DispatchWorkItem?
|
|
130
132
|
private var cameraChangeCallback: (([String: Any]) -> Void)? = nil
|
|
@@ -201,8 +203,11 @@ public class MapboxBridge: NSObject {
|
|
|
201
203
|
|
|
202
204
|
// Register this bridge for the created MapView
|
|
203
205
|
MapboxBridge.registerBridge(self, for: mv)
|
|
204
|
-
|
|
205
|
-
|
|
206
|
+
let defaultPinImage = UIImage(named: "default_pin")
|
|
207
|
+
if (defaultPinImage != nil) {
|
|
208
|
+
self.defaultPinImageHeight = defaultPinImage!.size.height
|
|
209
|
+
addImage("default_pin", defaultPinImage)
|
|
210
|
+
}
|
|
206
211
|
|
|
207
212
|
if let options = optionsOpt {
|
|
208
213
|
if ((options["hideLogo"] as? Bool) == true) {
|
|
@@ -456,7 +461,7 @@ public class MapboxBridge: NSObject {
|
|
|
456
461
|
else { theId = String(NSDate().timeIntervalSince1970) }
|
|
457
462
|
}
|
|
458
463
|
var pa = PointAnnotation(id:theId! , coordinate: CLLocationCoordinate2D(latitude: lat, longitude: lng))
|
|
459
|
-
|
|
464
|
+
pa.iconAnchor = .bottom
|
|
460
465
|
// userInfo
|
|
461
466
|
var userInfo = JSONObject()
|
|
462
467
|
|
|
@@ -544,8 +549,8 @@ public class MapboxBridge: NSObject {
|
|
|
544
549
|
annotation.allowOverlap = true
|
|
545
550
|
annotation.allowOverlapWithPuck = true
|
|
546
551
|
let image = an.image
|
|
547
|
-
let imageHeight = image?.image.size.height ??
|
|
548
|
-
let offsetY = imageHeight
|
|
552
|
+
let imageHeight = image?.image.size.height ?? self.defaultPinImageHeight
|
|
553
|
+
let offsetY = imageHeight + 5
|
|
549
554
|
// TODO: variableAnchors is broken for now if multiple
|
|
550
555
|
annotation.variableAnchors = [ViewAnnotationAnchorConfig(anchor: .bottom, offsetY: offsetY)
|
|
551
556
|
// , ViewAnnotationAnchorConfig(anchor: .bottomLeft, offsetY: offsetY), ViewAnnotationAnchorConfig(anchor: .bottomRight, offsetY: offsetY)
|
|
Binary file
|