(Browser) Fix: panorama.setPov() does not work if both pitch and heading are not specified
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.4.4-beta-20180913-1700" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="2.4.4-beta-20180913-1704" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="Promise" src="www/Promise.js">
<runs/>

MODIFY
src/browser/PluginStreetViewPanorama.js
src/browser/PluginStreetViewPanorama.js
@@ -264,13 +264,18 @@ PluginStreetViewPanorama.prototype.setPov = function(onSuccess, onError, args) {
var povRequest = args[0];
if (panorama) {
- var options = {};
+ var options = {
+ pov: panorama.getPov()
+ };
+ options.pov = options.pov || {
+ heading: 0,
+ pitch: 0
+ };
+
if ('bearing' in povRequest) {
- options.pov = {};
options.pov.heading = povRequest.bearing;
}
if ('tilt' in povRequest) {
- options.pov = options.pov || {};
options.pov.pitch = povRequest.tilt;
}
if ('zoom' in povRequest) {
@@ -283,7 +288,6 @@ PluginStreetViewPanorama.prototype.setPov = function(onSuccess, onError, args) {
};
-
PluginStreetViewPanorama.prototype._onCameraEvent = function(panorama) {
var self = this;
var pov = panorama.getPov();

(Browser) Fix: panorama.setPov() does not work if both pitch and heading are not specified