From 152988622cfe6428792b2c03f64c63b32de57243 Mon Sep 17 00:00:00 2001 From: Sakshi Tyagi Date: Thu, 25 Feb 2016 13:06:21 +0530 Subject: [PATCH 1/5] added option , '_system' for opening maps --- widget/controllers/widget.home.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widget/controllers/widget.home.controller.js b/widget/controllers/widget.home.controller.js index 3a51c4b..9439a07 100644 --- a/widget/controllers/widget.home.controller.js +++ b/widget/controllers/widget.home.controller.js @@ -152,9 +152,9 @@ WidgetHome.onAddressClick = function (long, lat) { if (WidgetHome.device && WidgetHome.device.platform == 'ios') - buildfire.navigation.openWindow("maps://maps.google.com/maps?daddr=" + lat + "," + long) + buildfire.navigation.openWindow("maps://maps.google.com/maps?daddr=" + lat + "," + long, '_system'); else - buildfire.navigation.openWindow("http://maps.google.com/maps?daddr=" + lat + "," + long) + buildfire.navigation.openWindow("http://maps.google.com/maps?daddr=" + lat + "," + long, '_system'); } }]) From 0e3c492e10a1622cc0f48f228eceb64b2a94d5bc Mon Sep 17 00:00:00 2001 From: Sakshi Tyagi Date: Thu, 25 Feb 2016 13:29:53 +0530 Subject: [PATCH 2/5] Testing open maps in new tab --- widget/controllers/widget.home.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widget/controllers/widget.home.controller.js b/widget/controllers/widget.home.controller.js index 9439a07..4c735a7 100644 --- a/widget/controllers/widget.home.controller.js +++ b/widget/controllers/widget.home.controller.js @@ -152,9 +152,9 @@ WidgetHome.onAddressClick = function (long, lat) { if (WidgetHome.device && WidgetHome.device.platform == 'ios') - buildfire.navigation.openWindow("maps://maps.google.com/maps?daddr=" + lat + "," + long, '_system'); + Buildfire.navigation.openWindow("maps://maps.google.com/maps?daddr=" + lat + "," + long, '_system'); else - buildfire.navigation.openWindow("http://maps.google.com/maps?daddr=" + lat + "," + long, '_system'); + Buildfire.navigation.openWindow("http://maps.google.com/maps?daddr=" + lat + "," + long, '_system'); } }]) From 3a107776bec2ad94d6c7ea44f25de39378d73230 Mon Sep 17 00:00:00 2001 From: Sakshi Tyagi Date: Thu, 25 Feb 2016 13:43:08 +0530 Subject: [PATCH 3/5] Corrected on marker click for maps --- widget/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widget/app.js b/widget/app.js index 32edd77..63f11a1 100644 --- a/widget/app.js +++ b/widget/app.js @@ -76,9 +76,9 @@ map.setMapTypeId("Report Error Hide Style"); marker.addListener('click', function () { if (buildfire.context.device && buildfire.context.device.platform == 'ios') - window.open("maps://maps.google.com/maps?daddr=" + scope.coordinates[1] + "," + scope.coordinates[0]); + buildfire.navigation.openWindow("maps://maps.google.com/maps?daddr=" + scope.coordinates[1] + "," + scope.coordinates[0]); else - window.open("http://maps.google.com/maps?daddr=" + scope.coordinates[1] + "," + scope.coordinates[0]); + buildfire.navigation.openWindow("http://maps.google.com/maps?daddr=" + scope.coordinates[1] + "," + scope.coordinates[0]); }); } From 9bc4b0a2bf95f15d8196afa53536a9b903bcebcd Mon Sep 17 00:00:00 2001 From: Sakshi Tyagi Date: Thu, 25 Feb 2016 14:06:47 +0530 Subject: [PATCH 4/5] Fixed test cases --- test/widget/widget.home.controller.spec.js | 6 +++--- widget/app.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/widget/widget.home.controller.spec.js b/test/widget/widget.home.controller.spec.js index 911c4cf..4a6622b 100644 --- a/test/widget/widget.home.controller.spec.js +++ b/test/widget/widget.home.controller.spec.js @@ -146,13 +146,13 @@ describe('Unit : contactUs Plugin widget.home.controller.js', function () { it('should pass if it returns html when valid string is passed', function () { WidgetHome.device = {platform: 'ios'}; WidgetHome.onAddressClick(1, 1); - expect(spy).toHaveBeenCalledWith('maps://maps.google.com/maps?daddr=1,1'); - }) + expect(spy).toHaveBeenCalledWith('maps://maps.google.com/maps?daddr=1,1', '_system'); + }); it('should pass if it returns html when valid string is passed', function () { WidgetHome.device = {platform: 'android'}; WidgetHome.onAddressClick(1, 1); - expect(spy).toHaveBeenCalledWith('http://maps.google.com/maps?daddr=1,1'); + expect(spy).toHaveBeenCalledWith('http://maps.google.com/maps?daddr=1,1', '_system'); }); }); diff --git a/widget/app.js b/widget/app.js index 63f11a1..9c648f0 100644 --- a/widget/app.js +++ b/widget/app.js @@ -76,9 +76,9 @@ map.setMapTypeId("Report Error Hide Style"); marker.addListener('click', function () { if (buildfire.context.device && buildfire.context.device.platform == 'ios') - buildfire.navigation.openWindow("maps://maps.google.com/maps?daddr=" + scope.coordinates[1] + "," + scope.coordinates[0]); + buildfire.navigation.openWindow("maps://maps.google.com/maps?daddr=" + scope.coordinates[1] + "," + scope.coordinates[0], '_system'); else - buildfire.navigation.openWindow("http://maps.google.com/maps?daddr=" + scope.coordinates[1] + "," + scope.coordinates[0]); + buildfire.navigation.openWindow("http://maps.google.com/maps?daddr=" + scope.coordinates[1] + "," + scope.coordinates[0], '_system'); }); } From 503c188581ce65c1c6c6005fe4b42e01eff630d3 Mon Sep 17 00:00:00 2001 From: Sakshi Tyagi Date: Thu, 25 Feb 2016 14:07:17 +0530 Subject: [PATCH 5/5] Fixed test cases --- widget/controllers/widget.home.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widget/controllers/widget.home.controller.js b/widget/controllers/widget.home.controller.js index 4c735a7..64f778d 100644 --- a/widget/controllers/widget.home.controller.js +++ b/widget/controllers/widget.home.controller.js @@ -152,9 +152,9 @@ WidgetHome.onAddressClick = function (long, lat) { if (WidgetHome.device && WidgetHome.device.platform == 'ios') - Buildfire.navigation.openWindow("maps://maps.google.com/maps?daddr=" + lat + "," + long, '_system'); + buildfire.navigation.openWindow("maps://maps.google.com/maps?daddr=" + lat + "," + long, '_system'); else - Buildfire.navigation.openWindow("http://maps.google.com/maps?daddr=" + lat + "," + long, '_system'); + buildfire.navigation.openWindow("http://maps.google.com/maps?daddr=" + lat + "," + long, '_system'); } }])