Skip to content

Commit 7618580

Browse files
animateCamera with target increases the zoomLevel to maximum in iOS #215
1 parent 3c1f075 commit 7618580

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

.travis.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ android:
88
- sys-img-armeabi-v7a-android-21
99

1010
before_cache:
11-
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
11+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
1212

1313
cache:
1414
directories:
1515
- .nvm
1616
- $HOME/.gradle/caches/
1717
- $HOME/.gradle/wrapper/
1818

19+
before_install:
20+
- yes | sdkmanager "platforms;android-26"
21+
1922
install:
2023
- echo no | npm install -g nativescript
2124
- tns usage-reporting disable
@@ -33,13 +36,13 @@ matrix:
3336
language: node_js
3437
os: linux
3538
node_js: "6"
36-
script: "npm run ci.tslint"
39+
script: "npm run ci.tslint"
3740
- stage: "WebPack"
3841
os: osx
3942
env:
4043
- Webpack="iOS"
4144
osx_image: xcode8.3
42-
language: node_js
45+
language: node_js
4346
node_js: "6"
4447
jdk: oraclejdk8
4548
before_install:
@@ -54,7 +57,7 @@ matrix:
5457
before_install: nvm install 6.10.3
5558
script: cd ../demo && tns build android --bundle
5659
- stage: "Build"
57-
env:
60+
env:
5861
- BuildAndroid="25"
5962
language: android
6063
os: linux
@@ -63,16 +66,15 @@ matrix:
6366
script:
6467
- cd ../demo && tns build android
6568
- os: osx
66-
env:
69+
env:
6770
- BuildiOS="10.3"
6871
- Xcode="8.3"
6972
osx_image: xcode8.3
70-
language: node_js
73+
language: node_js
7174
node_js: "6"
7275
jdk: oraclejdk8
7376
before_install:
7477
- gem install cocoapods
7578
- pod repo update
7679
script:
7780
- cd ../demo && tns build ios
78-

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
## [4.0.0](https://github.com/EddyVerbruggen/nativescript-mapbox/tree/4.0.0) (2018-05-07)
44
[Full Changelog](https://github.com/EddyVerbruggen/nativescript-mapbox/compare/3.3.0...4.0.0)
55

6+
**Fixed bugs:**
7+
8+
- The App crashs on Android when using nativescript-vue - missing toHumanReadableAscii method[\#216](https://github.com/EddyVerbruggen/nativescript-mapbox/issues/216)
9+
610
**Implemented enhancements:**
711

812
- Polygons for iOS [\#204](https://github.com/EddyVerbruggen/nativescript-mapbox/issues/204)
13+
- animateCamera with target increases the zoomLevel to maximum in iOS [\#215](https://github.com/EddyVerbruggen/nativescript-mapbox/issues/215)
914
- Bump Mapbox iOS SDK to 4.0.0 and Android to 6.0.1 [\#219](https://github.com/EddyVerbruggen/nativescript-mapbox/issues/219)
1015

11-
1216
## [3.3.0](https://github.com/EddyVerbruggen/nativescript-mapbox/tree/3.3.0) (2018-01-20)
1317
[Full Changelog](https://github.com/EddyVerbruggen/nativescript-mapbox/compare/3.2.0...3.3.0)
1418

demo/app/main-view-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ export class HelloWorldModel extends Observable {
450450
altitude: 500, // iOS
451451
bearing: 270,
452452
tilt: 50,
453-
duration: 10000
453+
duration: 7000
454454
}
455455
).then(
456456
result => {

src/mapbox.android.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ const _showLocation = (theMapView, mapboxMap) => {
193193
}
194194

195195
const locationLayerPlugin = new com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerPlugin(theMapView, mapboxMap, _locationEngine);
196-
locationLayerPlugin.setCameraMode(com.mapbox.mapboxsdk.plugins.locationlayer.modes.CameraMode.TRACKING);
196+
// with the foloowing line enabled, the camera moves to the user's location once it's determined
197+
// locationLayerPlugin.setCameraMode(com.mapbox.mapboxsdk.plugins.locationlayer.modes.CameraMode.TRACKING);
197198
};
198199

199200
const _getClickedMarkerDetails = (clicked) => {
@@ -816,7 +817,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
816817
return;
817818
}
818819

819-
const cameraPositionBuilder = new com.mapbox.mapboxsdk.camera.CameraPosition.Builder()
820+
const cameraPositionBuilder = new com.mapbox.mapboxsdk.camera.CameraPosition.Builder(theMap.mapboxMap.getCameraPosition())
820821
.target(new com.mapbox.mapboxsdk.geometry.LatLng(target.lat, target.lng));
821822

822823
if (options.bearing) {

src/mapbox.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ export class Mapbox extends MapboxCommon implements MapboxApi {
537537
return;
538538
}
539539

540-
let cam = MGLMapCamera.camera();
540+
let cam = theMap.camera;
541541

542542
cam.centerCoordinate = CLLocationCoordinate2DMake(target.lat, target.lng);
543543

0 commit comments

Comments
 (0)