From a89ae1517289b81fa0c5ef26042f77e650b8e3f7 Mon Sep 17 00:00:00 2001 From: Spiridon Alexandru Date: Fri, 1 Mar 2013 16:41:29 +0200 Subject: [PATCH 1/5] MOSYNC-2884: changed the bing maps api key; added a Readme file to the native ui MapTest program --- testPrograms/native_ui_lib/MapTest/MainScreen.cpp | 2 +- testPrograms/native_ui_lib/MapTest/Readme.txt | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 testPrograms/native_ui_lib/MapTest/Readme.txt diff --git a/testPrograms/native_ui_lib/MapTest/MainScreen.cpp b/testPrograms/native_ui_lib/MapTest/MainScreen.cpp index 271aa33ff..4df847187 100644 --- a/testPrograms/native_ui_lib/MapTest/MainScreen.cpp +++ b/testPrograms/native_ui_lib/MapTest/MainScreen.cpp @@ -97,7 +97,7 @@ void MainScreen::createMainLayout() { mMainLayout->addChild(mSetCenterButton); // create the main map and add it to the main layout - mMap = new Map("google test credentials", "AsIe6nHOHjIuf9MQS4fW7up92BO6HuCwspKJqYwffZiqUJsgXuLIXeBdCf9EM4yz"); + mMap = new Map("google test credentials", "AuQ7GMB3AJPFp5GPHbuQ2WVyhQUd9DjYJ6u5aR6a_uXZZdX5KuHJ7XMU4GNvO6mh"); mMap->fillSpaceHorizontally(); mMap->fillSpaceVertically(); diff --git a/testPrograms/native_ui_lib/MapTest/Readme.txt b/testPrograms/native_ui_lib/MapTest/Readme.txt new file mode 100644 index 000000000..07df877f2 --- /dev/null +++ b/testPrograms/native_ui_lib/MapTest/Readme.txt @@ -0,0 +1,13 @@ +Purpose: +The test program shows the native ui map functionality and provides UI elements for doing +the following: + - add/remove multiple random map pins + - set/get visible area + - set zoom level + - center the map + - a map control is visible and available for interraction to the user + +IMPORTANT: + ADD YOU OWN MAP CREDENTIALS INSIDE THE MAP CONSTRUCTOR: + MainScreen.cpp: + mMap = new Map("google maps test credentials", "bing maps test credentials"); \ No newline at end of file From 6f43fe36074fc1711ce2fb54d08b42fcc661cef7 Mon Sep 17 00:00:00 2001 From: Spiridon Alexandru Date: Fri, 1 Mar 2013 17:38:39 +0200 Subject: [PATCH 2/5] MOSYNC-2884: small wp7 runtime map widget refactorization --- .../mosyncRuntime/Source/Modules/NativeUI/MoSyncMap.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncMap.cs b/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncMap.cs index 0c73f4edf..81d2c1bfb 100644 --- a/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncMap.cs +++ b/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncMap.cs @@ -60,6 +60,8 @@ public class Map : WidgetBaseWindowsPhone // used to center the map on an area described by the upper left corner and the lower right corner System.Device.Location.GeoCoordinate mVisibleAreaLowerRightCorner; + private CredentialsProvider mCredentialsProvider; + /** * Constructor */ @@ -149,7 +151,8 @@ public string ApiKey { set { - mBingMap.CredentialsProvider = new ApplicationIdCredentialsProvider(value); + mCredentialsProvider = new ApplicationIdCredentialsProvider(value); + mBingMap.CredentialsProvider = mCredentialsProvider; } } From e2bfbb104de3f2dd865c700035c722df37caed26 Mon Sep 17 00:00:00 2001 From: Spiridon Alexandru Date: Mon, 4 Mar 2013 11:38:10 +0200 Subject: [PATCH 3/5] MOSYNC-2884: added a readme file to the NativeUIMap example program --- examples/cpp/NativeUIMap/Readme.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 examples/cpp/NativeUIMap/Readme.txt diff --git a/examples/cpp/NativeUIMap/Readme.txt b/examples/cpp/NativeUIMap/Readme.txt new file mode 100644 index 000000000..07df877f2 --- /dev/null +++ b/examples/cpp/NativeUIMap/Readme.txt @@ -0,0 +1,13 @@ +Purpose: +The test program shows the native ui map functionality and provides UI elements for doing +the following: + - add/remove multiple random map pins + - set/get visible area + - set zoom level + - center the map + - a map control is visible and available for interraction to the user + +IMPORTANT: + ADD YOU OWN MAP CREDENTIALS INSIDE THE MAP CONSTRUCTOR: + MainScreen.cpp: + mMap = new Map("google maps test credentials", "bing maps test credentials"); \ No newline at end of file From d78472d81a45000cfc7ec79df481f55e22adb212 Mon Sep 17 00:00:00 2001 From: Spiridon Alexandru Date: Wed, 6 Mar 2013 16:28:38 +0200 Subject: [PATCH 4/5] MOSYNC-2884: - fixed - the crash was due to a string to double conversion: on Lumia 920, '.' was not considered as a separator of the integer and fractional part of the number so the resulting parsed double value was very large and setting a label font size to a very large value lead to an unhandled exception -> a crash. The parsing now takes into consideration the dot as a separator. --- .../mosyncRuntime/Source/Modules/NativeUI/MoSyncLabel.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncLabel.cs b/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncLabel.cs index dc114801d..2831a7cb2 100644 --- a/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncLabel.cs +++ b/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncLabel.cs @@ -16,6 +16,7 @@ using System.Text.RegularExpressions; using System.Reflection; using System.Windows.Media; +using System.Globalization; namespace MoSync { @@ -207,7 +208,9 @@ public String fontSize set { double size = 0; - if (double.TryParse(value, out size)) + NumberStyles style = NumberStyles.AllowDecimalPoint; + IFormatProvider provider = CultureInfo.InvariantCulture; + if (Double.TryParse(value, style, provider, out size)) { // for some values better use the default size of the platform mLabel.FontSize = size <= 0 ? 11 : size; From d2115ae0c238f443bd8dbe876b2d5ac7feb31359 Mon Sep 17 00:00:00 2001 From: Spiridon Alexandru Date: Thu, 7 Mar 2013 16:28:21 +0200 Subject: [PATCH 5/5] MOSYNC-2884: small code review issue fixed --- .../mosyncRuntime/Source/Modules/NativeUI/MoSyncMap.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncMap.cs b/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncMap.cs index 81d2c1bfb..0c73f4edf 100644 --- a/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncMap.cs +++ b/runtimes/csharp/windowsphone/mosync/mosyncRuntime/Source/Modules/NativeUI/MoSyncMap.cs @@ -60,8 +60,6 @@ public class Map : WidgetBaseWindowsPhone // used to center the map on an area described by the upper left corner and the lower right corner System.Device.Location.GeoCoordinate mVisibleAreaLowerRightCorner; - private CredentialsProvider mCredentialsProvider; - /** * Constructor */ @@ -151,8 +149,7 @@ public string ApiKey { set { - mCredentialsProvider = new ApplicationIdCredentialsProvider(value); - mBingMap.CredentialsProvider = mCredentialsProvider; + mBingMap.CredentialsProvider = new ApplicationIdCredentialsProvider(value); } }