Closed TdoubleG closed 5 years ago
Please share your project files on GitHub.
I removed the plugin and platform and reinstalled everything again. The error is gone but it the camera target doesn't change.
Here is what I'm doing:
followUser(position: Geoposition) {
const userPos: LatLng = new LatLng(position.coords.latitude, position.coords.longitude);
this.map.animateCamera({
target: userPos,
bearing: 0,
zoom: this.map.getCameraZoom(),
duration: 500
}).then( () => {
this.map.setCameraTarget(userPos);
console.log(userPos);
});
}
The console.log is correct but when I change the user location, the camera doesn't update
As I said,
Please share your project files on GitHub.
Found the issue. Was inside my code where I reload the map every time I got a new location. Sorry for the inconvenience.
I'm submitting a ... (check one with "x")
If you choose 'problem or bug report', please select OS: (check one with "x")
cordova information: (run
$> cordova plugin list
)Current behavior:
I want to set the map center via
this.map.setCameraTarget()
but I get this error:InvalidValueError: setCenter: not a LatLng or LatLngLiteral: not an Object
My LatLng looks like this:
I also tried with ionic-native LatLng but same issue.
I don't know why i get this kind of error