├── .gitattributes
├── .gitignore
├── LiveTileTask
├── LiveTileTask.csproj
├── Properties
│ └── AssemblyInfo.cs
└── Update.cs
├── Prebuilt
├── Temp
│ ├── Microsoft.UI.Xaml.dll
│ ├── Microsoft.UI.Xaml.pri
│ └── Microsoft.UI.Xaml.winmd
├── arm
│ ├── Microsoft.UI.Xaml.dll
│ ├── Microsoft.UI.Xaml.pri
│ └── Microsoft.UI.Xaml.winmd
└── ffmpeg.dll
├── WinGoMapsX.sln
├── WinGoMapsX
├── App.AuSupport.xaml
├── App.DeviceFamily-Mobile.xaml
├── App.xaml
├── App.xaml.cs
├── AppCommand.cs
├── Assets
│ ├── BlackLogo.png
│ ├── BlackLogo2.png
│ ├── Branding.jpg
│ ├── DirectionsIcons
│ │ ├── fork-left.png
│ │ ├── fork-right.png
│ │ ├── merge.png
│ │ ├── ramp-left.png
│ │ ├── ramp-right.png
│ │ ├── roundabout-left.png
│ │ ├── roundabout-right.png
│ │ ├── straight.png
│ │ ├── turn-left.png
│ │ ├── turn-right.png
│ │ ├── turn-sharp-left.png
│ │ ├── turn-sharp-right.png
│ │ ├── turn-slight-left.png
│ │ ├── turn-slight-right.png
│ │ ├── uturn-left.png
│ │ └── uturn-right.png
│ ├── LargeTile.scale-100.png
│ ├── LargeTile.scale-125.png
│ ├── LargeTile.scale-150.png
│ ├── LargeTile.scale-200.png
│ ├── LargeTile.scale-400.png
│ ├── LockScreenLogo.scale-200.png
│ ├── Noise.png
│ ├── Noise3.png
│ ├── SmallTile.scale-100.png
│ ├── SmallTile.scale-125.png
│ ├── SmallTile.scale-150.png
│ ├── SmallTile.scale-200.png
│ ├── SmallTile.scale-400.png
│ ├── SplashScreen.scale-100.png
│ ├── SplashScreen.scale-125.png
│ ├── SplashScreen.scale-150.png
│ ├── SplashScreen.scale-200.png
│ ├── SplashScreen.scale-400.png
│ ├── Square150x150Logo.scale-100.png
│ ├── Square150x150Logo.scale-125.png
│ ├── Square150x150Logo.scale-150.png
│ ├── Square150x150Logo.scale-200.png
│ ├── Square150x150Logo.scale-400.png
│ ├── Square44x44Logo.altform-unplated_targetsize-16.png
│ ├── Square44x44Logo.altform-unplated_targetsize-256.png
│ ├── Square44x44Logo.altform-unplated_targetsize-32.png
│ ├── Square44x44Logo.altform-unplated_targetsize-48.png
│ ├── Square44x44Logo.scale-100.png
│ ├── Square44x44Logo.scale-125.png
│ ├── Square44x44Logo.scale-150.png
│ ├── Square44x44Logo.scale-200.png
│ ├── Square44x44Logo.scale-400.png
│ ├── Square44x44Logo.targetsize-16.png
│ ├── Square44x44Logo.targetsize-24.png
│ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── Square44x44Logo.targetsize-256.png
│ ├── Square44x44Logo.targetsize-32.png
│ ├── Square44x44Logo.targetsize-48.png
│ ├── StoreLogo.backup.png
│ ├── StoreLogo.png
│ ├── StoreLogo.scale-100.png
│ ├── StoreLogo.scale-125.png
│ ├── StoreLogo.scale-150.png
│ ├── StoreLogo.scale-200.png
│ ├── StoreLogo.scale-400.png
│ ├── Wide310x150Logo.scale-100.png
│ ├── Wide310x150Logo.scale-125.png
│ ├── Wide310x150Logo.scale-150.png
│ ├── Wide310x150Logo.scale-200.png
│ └── Wide310x150Logo.scale-400.png
├── ChangeLog.txt
├── Converter
│ └── ValueToIsEnabledConverter.cs
├── ExtendedSplashScreen.xaml
├── ExtendedSplashScreen.xaml.cs
├── Helpers
│ ├── ClassInfo.cs
│ ├── CountryCodesHelper.cs
│ ├── ExtentionMethods.cs
│ ├── GeoLocatorHelper.cs
│ ├── InternalHelper.cs
│ ├── MultilingualHelpToolkit.cs
│ ├── TileCoordinateHelper.cs
│ └── VoiceNavigationHelper.cs
├── MainPage.DeviceFamily-Mobile.xaml
├── MainPage.xaml
├── MainPage.xaml.cs
├── Microsoft.UI.Xaml
│ ├── Assets
│ │ └── NoiseAsset_256X256_PNG.png
│ └── Themes
│ │ ├── Generic.xaml
│ │ ├── rs1_themeresources.xaml
│ │ ├── rs2_generic.xaml
│ │ ├── rs2_themeresources.xaml
│ │ └── rs3_themeresources.xaml
├── Package.appxmanifest
├── Properties
│ ├── AssemblyInfo.cs
│ └── Default.rd.xml
├── Resources
│ └── CustomControls
│ │ ├── AutoSuggestionBox.xaml
│ │ ├── DirectionsButton.xaml
│ │ ├── DotButton.xaml
│ │ ├── MoreInfoHyperLink.xaml
│ │ └── TabbedPivot.xaml
├── Strings
│ ├── Be-By
│ │ └── Resources.resw
│ ├── DE-DE
│ │ └── Resources.resw
│ ├── ES
│ │ └── Resources.resw
│ ├── En-Us
│ │ └── Resources.resw
│ ├── Fa-Ir
│ │ └── Resources.resw
│ ├── Fr-Fr
│ │ └── Resources.resw
│ ├── Pt-Br
│ │ └── Resources.resw
│ ├── ar
│ │ └── Resources.resw
│ ├── cs-cz
│ │ └── Resources.resw
│ ├── it
│ │ └── Resources.resw
│ ├── ja-JP
│ │ └── Resources.resw
│ └── tr-tr
│ │ └── Resources.resw
├── View
│ ├── BookmarkAdd.xaml
│ ├── BookmarkAdd.xaml.cs
│ ├── DirectionsControls
│ │ ├── FullStepsProvider.xaml
│ │ ├── FullStepsProvider.xaml.cs
│ │ ├── NewDirections.DeviceFamily-Mobile.xaml
│ │ ├── NewDirections.xaml
│ │ ├── NewDirections.xaml.cs
│ │ ├── StepsTitleProvider.xaml
│ │ └── StepsTitleProvider.xaml.cs
│ ├── MapView.DeviceFamily-Mobile.xaml
│ ├── MapView.xaml
│ ├── MapView.xaml.cs
│ ├── OfflineMapDownloader
│ │ ├── MapDownloaderView.xaml
│ │ └── MapDownloaderView.xaml.cs
│ ├── OnMapControls
│ │ ├── ChangeViewUserControl.xaml
│ │ ├── ChangeViewUserControl.xaml.cs
│ │ ├── MyLocationUserControl.xaml
│ │ ├── MyLocationUserControl.xaml.cs
│ │ ├── SearchUserControl.DeviceFamily-Mobile.xaml
│ │ ├── SearchUserControl.xaml
│ │ ├── SearchUserControl.xaml.cs
│ │ ├── ZoomUserControl.xaml
│ │ └── ZoomUserControl.xaml.cs
│ └── SettingsView
│ │ ├── SettingsLanguageView.xaml
│ │ ├── SettingsLanguageView.xaml.cs
│ │ ├── SettingsMainView.xaml
│ │ └── SettingsMainView.xaml.cs
├── ViewModel
│ ├── MapViewVM.cs
│ ├── OfflineMapDownloader
│ │ └── MapDLHelper.cs
│ ├── OnMapControls
│ │ ├── ChangeViewUCVM.cs
│ │ └── SearchUserControlVM.cs
│ ├── PlacesControls
│ │ └── SavedPlacesVM.cs
│ └── SettingsView
│ │ ├── SettingsLanguageVM.cs
│ │ └── SettingsMainVM.cs
├── VoiceCommands.xml
└── WinGoMapsX.csproj
├── WinGoService
├── Cortana.cs
├── Properties
│ └── AssemblyInfo.cs
└── WinGoService.csproj
└── readme.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | AppCore.cs
179 | _pkginfo.txt
180 |
181 | # Visual Studio cache files
182 | # files ending in .cache can be ignored
183 | *.[Cc]ache
184 | # but keep track of directories ending in .cache
185 | !*.[Cc]ache/
186 |
187 | # Others
188 | ClientBin/
189 | ~$*
190 | *~
191 | *.dbmdl
192 | *.dbproj.schemaview
193 | *.jfm
194 | *.pfx
195 | *.publishsettings
196 | node_modules/
197 | orleans.codegen.cs
198 |
199 | # Since there are multiple workflows, uncomment next line to ignore bower_components
200 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
201 | #bower_components/
202 |
203 | # RIA/Silverlight projects
204 | Generated_Code/
205 |
206 | # Backup & report files from converting an old project file
207 | # to a newer Visual Studio version. Backup files are not needed,
208 | # because we have git ;-)
209 | _UpgradeReport_Files/
210 | Backup*/
211 | UpgradeLog*.XML
212 | UpgradeLog*.htm
213 |
214 | # SQL Server files
215 | *.mdf
216 | *.ldf
217 |
218 | # Business Intelligence projects
219 | *.rdl.data
220 | *.bim.layout
221 | *.bim_*.settings
222 |
223 | # Microsoft Fakes
224 | FakesAssemblies/
225 |
226 | # GhostDoc plugin setting file
227 | *.GhostDoc.xml
228 |
229 | # Node.js Tools for Visual Studio
230 | .ntvs_analysis.dat
231 |
232 | # Visual Studio 6 build log
233 | *.plg
234 |
235 | # Visual Studio 6 workspace options file
236 | *.opt
237 |
238 | # Visual Studio LightSwitch build output
239 | **/*.HTMLClient/GeneratedArtifacts
240 | **/*.DesktopClient/GeneratedArtifacts
241 | **/*.DesktopClient/ModelManifest.xml
242 | **/*.Server/GeneratedArtifacts
243 | **/*.Server/ModelManifest.xml
244 | _Pvt_Extensions
245 |
246 | # Paket dependency manager
247 | .paket/paket.exe
248 | paket-files/
249 |
250 | # FAKE - F# Make
251 | .fake/
252 |
253 | # JetBrains Rider
254 | .idea/
255 | *.sln.iml
256 |
257 | # CodeRush
258 | .cr/
259 |
260 | # Python Tools for Visual Studio (PTVS)
261 | __pycache__/
262 | *.pyc
--------------------------------------------------------------------------------
/LiveTileTask/LiveTileTask.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}
8 | winmdobj
9 | Properties
10 | LiveTileTask
11 | LiveTileTask
12 | en-US
13 | UAP
14 | 10.0.17134.0
15 | 10.0.14393.0
16 | 14
17 | 512
18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
19 | false
20 |
21 |
22 | AnyCPU
23 | true
24 | full
25 | false
26 | bin\Debug\
27 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
28 | prompt
29 | 4
30 |
31 |
32 | AnyCPU
33 | pdbonly
34 | true
35 | bin\Release\
36 | TRACE;NETFX_CORE;WINDOWS_UWP
37 | prompt
38 | 4
39 |
40 |
41 | x86
42 | true
43 | bin\x86\Debug\
44 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
45 | ;2008
46 | full
47 | x86
48 | false
49 | prompt
50 |
51 |
52 | x86
53 | bin\x86\Release\
54 | TRACE;NETFX_CORE;WINDOWS_UWP
55 | true
56 | ;2008
57 | pdbonly
58 | x86
59 | false
60 | prompt
61 |
62 |
63 | ARM
64 | true
65 | bin\ARM\Debug\
66 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
67 | ;2008
68 | full
69 | ARM
70 | false
71 | prompt
72 |
73 |
74 | ARM
75 | bin\ARM\Release\
76 | TRACE;NETFX_CORE;WINDOWS_UWP
77 | true
78 | ;2008
79 | pdbonly
80 | ARM
81 | false
82 | prompt
83 |
84 |
85 | x64
86 | true
87 | bin\x64\Debug\
88 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
89 | ;2008
90 | full
91 | x64
92 | false
93 | prompt
94 |
95 |
96 | x64
97 | bin\x64\Release\
98 | TRACE;NETFX_CORE;WINDOWS_UWP
99 | true
100 | ;2008
101 | pdbonly
102 | x64
103 | false
104 | prompt
105 |
106 |
107 | PackageReference
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | 6.1.5
116 |
117 |
118 | 11.0.2
119 |
120 |
121 |
122 | 14.0
123 |
124 |
125 |
132 |
--------------------------------------------------------------------------------
/LiveTileTask/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("LiveTileTask")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("LiveTileTask")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/LiveTileTask/Update.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.ApplicationModel.Background;
3 | using Windows.Data.Xml.Dom;
4 | using Windows.Devices.Geolocation;
5 | using Windows.Networking.Connectivity;
6 | using Windows.Storage;
7 | using Windows.UI.Notifications;
8 | using Windows.Web.Http;
9 |
10 | namespace LiveTileTask
11 | {
12 | public sealed class Update : IBackgroundTask
13 | {
14 | public async void Run(IBackgroundTaskInstance taskInstance)
15 | {
16 | try
17 | {
18 | var def = taskInstance.GetDeferral();
19 | if (await Geolocator.RequestAccessAsync() == GeolocationAccessStatus.Allowed)
20 | {
21 | var geolocator = new Geolocator();
22 | var Location = await geolocator.GetGeopositionAsync();
23 | var ul = Location.Coordinate.Point.Position;
24 | if(InternetConnection())
25 | {
26 | var http = new HttpClient();
27 | http.DefaultRequestHeaders.UserAgent.ParseAdd("MahStudioWinGoMaps");
28 | var res = await (await http.GetAsync(new Uri($"https://maps.googleapis.com/maps/api/staticmap?center={ul.Latitude},{ul.Longitude}&zoom=16&size=200x200", UriKind.RelativeOrAbsolute))).Content.ReadAsBufferAsync();
29 | var reswide = await (await http.GetAsync(new Uri($"https://maps.googleapis.com/maps/api/staticmap?center={ul.Latitude},{ul.Longitude}&zoom=16&size=310x150", UriKind.RelativeOrAbsolute))).Content.ReadAsBufferAsync();
30 | var resLarge = await (await http.GetAsync(new Uri($"https://maps.googleapis.com/maps/api/staticmap?center={ul.Latitude},{ul.Longitude}&zoom=16&size=310x310", UriKind.RelativeOrAbsolute))).Content.ReadAsBufferAsync();
31 | var f = await ApplicationData.Current.LocalFolder.CreateFileAsync("LiveTile.png", CreationCollisionOption.OpenIfExists);
32 | var fWide = await ApplicationData.Current.LocalFolder.CreateFileAsync("LiveTileWide.png", CreationCollisionOption.OpenIfExists);
33 | var fLarge = await ApplicationData.Current.LocalFolder.CreateFileAsync("LiveTileLarge.png", CreationCollisionOption.OpenIfExists);
34 | var str = await f.OpenAsync(FileAccessMode.ReadWrite);
35 | var strwide = await fWide.OpenAsync(FileAccessMode.ReadWrite);
36 | var strLarge = await fLarge.OpenAsync(FileAccessMode.ReadWrite);
37 | await str.WriteAsync(res);
38 | await strwide.WriteAsync(reswide);
39 | await strLarge.WriteAsync(resLarge);
40 | str.Dispose();
41 | strwide.Dispose();
42 | strLarge.Dispose();
43 | }
44 | else
45 | {
46 | try
47 | {
48 | var tc = new TileCoordinate(ul.Latitude, ul.Longitude, 16);
49 | var x = tc.x;
50 | //mah_x_{x}-y_{y}-z_{zoomlevel}.jpeg
51 | var f = await StorageFile.GetFileFromApplicationUriAsync(new Uri($"ms-appdata:///local/MahMaps/mah_x_{tc.x}-y_{tc.y}-z_16.jpeg"));
52 | await f.CopyAsync(ApplicationData.Current.LocalFolder, "LiveTile.png");
53 | }
54 | catch
55 | {
56 |
57 | }
58 | }
59 | var update = TileUpdateManager.CreateTileUpdaterForApplication();
60 | string xml = "\n";
61 | xml += "\n";
62 | xml += " \n";
63 | xml += " \n";
64 | xml += " \n";
65 | xml += " \n";
66 | xml += " \n";
67 | xml += " \n";
68 | xml += " \n";
69 | xml += " \n";
70 | xml += " \n";
71 | xml += " \n";
72 | xml += " ";
73 |
74 | XmlDocument txml = new XmlDocument();
75 | txml.LoadXml(xml);
76 | TileNotification tNotification = new TileNotification(txml);
77 |
78 | update.Clear();
79 | update.Update(tNotification);
80 | }
81 | def.Complete();
82 | }
83 | catch (Exception ex)
84 | {
85 | }
86 | }
87 | public static bool InternetConnection()
88 | {
89 | ConnectionProfile connections = NetworkInformation.GetInternetConnectionProfile();
90 | if (connections != null && connections.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess)
91 | return true;
92 | else return false;
93 | }
94 | }
95 | class TileCoordinate
96 | {
97 | public TileCoordinate(double lat, double lon, int zoom)
98 | {
99 | this.lat = lat;
100 | this.lon = lon;
101 | this.zoom = zoom;
102 | }
103 | public double y;
104 | public double x;
105 | public double lat;
106 | public double lon;
107 | public int zoom;
108 | public bool LocationCoord()
109 | {
110 | if (Math.Abs(this.lat) > 85.0511287798066)
111 | return false;
112 | double sin_phi = Math.Sin(this.lat * Math.PI / 180);
113 | double norm_x = this.lon / 180;
114 | double norm_y = (0.5 * Math.Log((1 + sin_phi) / (1 - sin_phi))) / Math.PI;
115 | this.y = Math.Pow(2, this.zoom) * ((1 - norm_y) / 2);
116 | this.x = Math.Pow(2, this.zoom) * ((norm_x + 1) / 2);
117 | return true;
118 | }
119 |
120 | public static BasicGeoposition ReverseGeoPoint(double x, double y, double z)
121 | {
122 | var Lng = 180 * ((2 * x) / (Math.Pow(2, z)) - 1);
123 | var Lat = (180 / Math.PI) *
124 | Math.Asin((Math.Pow(Math.E, (2 * Math.PI * (1 - ((2 * y) / Math.Pow(2, z))))) - 1)
125 | / (1 + Math.Pow(Math.E, (2 * Math.PI * (1 - ((2 * y) / Math.Pow(2, z)))))));
126 | return new BasicGeoposition() { Latitude = Lat, Longitude = Lng };
127 |
128 | }
129 |
130 | }
131 |
132 | }
133 |
--------------------------------------------------------------------------------
/Prebuilt/Temp/Microsoft.UI.Xaml.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/Prebuilt/Temp/Microsoft.UI.Xaml.dll
--------------------------------------------------------------------------------
/Prebuilt/Temp/Microsoft.UI.Xaml.pri:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/Prebuilt/Temp/Microsoft.UI.Xaml.pri
--------------------------------------------------------------------------------
/Prebuilt/Temp/Microsoft.UI.Xaml.winmd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/Prebuilt/Temp/Microsoft.UI.Xaml.winmd
--------------------------------------------------------------------------------
/Prebuilt/arm/Microsoft.UI.Xaml.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/Prebuilt/arm/Microsoft.UI.Xaml.dll
--------------------------------------------------------------------------------
/Prebuilt/arm/Microsoft.UI.Xaml.pri:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/Prebuilt/arm/Microsoft.UI.Xaml.pri
--------------------------------------------------------------------------------
/Prebuilt/arm/Microsoft.UI.Xaml.winmd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/Prebuilt/arm/Microsoft.UI.Xaml.winmd
--------------------------------------------------------------------------------
/Prebuilt/ffmpeg.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/Prebuilt/ffmpeg.dll
--------------------------------------------------------------------------------
/WinGoMapsX.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2042
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinGoMapsX", "WinGoMapsX\WinGoMapsX.csproj", "{FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiveTileTask", "LiveTileTask\LiveTileTask.csproj", "{F5E2423A-05F4-4877-B31D-F3C10DF6082F}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinGoService", "WinGoService\WinGoService.csproj", "{DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Debug|ARM = Debug|ARM
16 | Debug|x64 = Debug|x64
17 | Debug|x86 = Debug|x86
18 | Release|Any CPU = Release|Any CPU
19 | Release|ARM = Release|ARM
20 | Release|x64 = Release|x64
21 | Release|x86 = Release|x86
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Debug|Any CPU.ActiveCfg = Debug|x86
25 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Debug|ARM.ActiveCfg = Debug|ARM
26 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Debug|ARM.Build.0 = Debug|ARM
27 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Debug|ARM.Deploy.0 = Debug|ARM
28 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Debug|x64.ActiveCfg = Debug|x64
29 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Debug|x64.Build.0 = Debug|x64
30 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Debug|x64.Deploy.0 = Debug|x64
31 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Debug|x86.ActiveCfg = Debug|x86
32 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Debug|x86.Build.0 = Debug|x86
33 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Debug|x86.Deploy.0 = Debug|x86
34 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Release|Any CPU.ActiveCfg = Release|x86
35 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Release|ARM.ActiveCfg = Release|ARM
36 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Release|ARM.Build.0 = Release|ARM
37 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Release|ARM.Deploy.0 = Release|ARM
38 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Release|x64.ActiveCfg = Release|x64
39 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Release|x64.Build.0 = Release|x64
40 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Release|x64.Deploy.0 = Release|x64
41 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Release|x86.ActiveCfg = Release|x86
42 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Release|x86.Build.0 = Release|x86
43 | {FD6A2942-E4AC-41EC-92DC-52B3A8A43DE8}.Release|x86.Deploy.0 = Release|x86
44 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Debug|ARM.ActiveCfg = Debug|ARM
47 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Debug|ARM.Build.0 = Debug|ARM
48 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Debug|x64.ActiveCfg = Debug|x64
49 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Debug|x64.Build.0 = Debug|x64
50 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Debug|x86.ActiveCfg = Debug|x86
51 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Debug|x86.Build.0 = Debug|x86
52 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Release|Any CPU.ActiveCfg = Release|Any CPU
53 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Release|Any CPU.Build.0 = Release|Any CPU
54 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Release|ARM.ActiveCfg = Release|ARM
55 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Release|ARM.Build.0 = Release|ARM
56 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Release|x64.ActiveCfg = Release|x64
57 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Release|x64.Build.0 = Release|x64
58 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Release|x86.ActiveCfg = Release|x86
59 | {F5E2423A-05F4-4877-B31D-F3C10DF6082F}.Release|x86.Build.0 = Release|x86
60 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
61 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
62 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Debug|ARM.ActiveCfg = Debug|ARM
63 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Debug|ARM.Build.0 = Debug|ARM
64 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Debug|x64.ActiveCfg = Debug|x64
65 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Debug|x64.Build.0 = Debug|x64
66 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Debug|x86.ActiveCfg = Debug|x86
67 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Debug|x86.Build.0 = Debug|x86
68 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
69 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Release|Any CPU.Build.0 = Release|Any CPU
70 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Release|ARM.ActiveCfg = Release|ARM
71 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Release|ARM.Build.0 = Release|ARM
72 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Release|x64.ActiveCfg = Release|x64
73 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Release|x64.Build.0 = Release|x64
74 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Release|x86.ActiveCfg = Release|x86
75 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}.Release|x86.Build.0 = Release|x86
76 | EndGlobalSection
77 | GlobalSection(SolutionProperties) = preSolution
78 | HideSolutionNode = FALSE
79 | EndGlobalSection
80 | GlobalSection(ExtensibilityGlobals) = postSolution
81 | SolutionGuid = {F24CECD5-4C59-480E-BD34-AEA5BDFF7BD3}
82 | EndGlobalSection
83 | EndGlobal
84 |
--------------------------------------------------------------------------------
/WinGoMapsX/AppCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Input;
3 |
4 | namespace WinGoMapsX
5 | {
6 | public class AppCommand : ICommand
7 | {
8 | public event EventHandler CanExecuteChanged;
9 | public static AppCommand GetInstance()
10 | {
11 | return new AppCommand() { CanExecuteFunc = obj => true };
12 | }
13 | public Predicate CanExecuteFunc
14 | {
15 | get;
16 | set;
17 | }
18 |
19 | public Action ExecuteFunc
20 | {
21 | get;
22 | set;
23 | }
24 |
25 | public bool CanExecute(object parameter) => CanExecuteFunc(parameter);
26 |
27 | public void Execute(object parameter) => ExecuteFunc(parameter);
28 |
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/BlackLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/BlackLogo.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/BlackLogo2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/BlackLogo2.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Branding.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Branding.jpg
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/fork-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/fork-left.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/fork-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/fork-right.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/merge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/merge.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/ramp-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/ramp-left.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/ramp-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/ramp-right.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/roundabout-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/roundabout-left.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/roundabout-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/roundabout-right.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/straight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/straight.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/turn-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/turn-left.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/turn-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/turn-right.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/turn-sharp-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/turn-sharp-left.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/turn-sharp-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/turn-sharp-right.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/turn-slight-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/turn-slight-left.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/turn-slight-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/turn-slight-right.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/uturn-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/uturn-left.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/DirectionsIcons/uturn-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/DirectionsIcons/uturn-right.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/LargeTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/LargeTile.scale-100.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/LargeTile.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/LargeTile.scale-125.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/LargeTile.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/LargeTile.scale-150.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/LargeTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/LargeTile.scale-200.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/LargeTile.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/LargeTile.scale-400.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Noise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Noise.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Noise3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Noise3.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/SmallTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/SmallTile.scale-100.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/SmallTile.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/SmallTile.scale-125.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/SmallTile.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/SmallTile.scale-150.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/SmallTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/SmallTile.scale-200.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/SmallTile.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/SmallTile.scale-400.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/SplashScreen.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/SplashScreen.scale-125.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/SplashScreen.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/SplashScreen.scale-150.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/SplashScreen.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/SplashScreen.scale-400.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square150x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square150x150Logo.scale-125.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square150x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square150x150Logo.scale-150.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square150x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square150x150Logo.scale-400.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.altform-unplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.altform-unplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.altform-unplated_targetsize-256.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.altform-unplated_targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.altform-unplated_targetsize-32.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.altform-unplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.scale-125.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.scale-150.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.scale-400.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.targetsize-16.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.targetsize-24.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.targetsize-256.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.targetsize-32.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Square44x44Logo.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Square44x44Logo.targetsize-48.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/StoreLogo.backup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/StoreLogo.backup.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/StoreLogo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/StoreLogo.scale-125.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/StoreLogo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/StoreLogo.scale-150.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/StoreLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/StoreLogo.scale-200.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/StoreLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/StoreLogo.scale-400.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Wide310x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Wide310x150Logo.scale-125.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Wide310x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Wide310x150Logo.scale-150.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/WinGoMapsX/Assets/Wide310x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Assets/Wide310x150Logo.scale-400.png
--------------------------------------------------------------------------------
/WinGoMapsX/ChangeLog.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/WinGoMapsX/Converter/ValueToIsEnabledConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Windows.UI.Xaml.Data;
7 |
8 | namespace WinGoMapsX.Converter
9 | {
10 | class ValueToIsEnabledConverter : IValueConverter
11 | {
12 | public object Convert(object value, Type targetType, object parameter, string language)
13 | {
14 | if (value != null) return true;
15 | else return false;
16 | }
17 |
18 | public object ConvertBack(object value, Type targetType, object parameter, string language)
19 | {
20 | throw new NotImplementedException();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/WinGoMapsX/ExtendedSplashScreen.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using System.Threading.Tasks;
7 | using Windows.ApplicationModel.Activation;
8 | using Windows.Foundation;
9 | using Windows.Foundation.Collections;
10 | using Windows.Storage;
11 | using Windows.UI.StartScreen;
12 | using Windows.UI.Xaml;
13 | using Windows.UI.Xaml.Controls;
14 | using Windows.UI.Xaml.Controls.Primitives;
15 | using Windows.UI.Xaml.Data;
16 | using Windows.UI.Xaml.Input;
17 | using Windows.UI.Xaml.Media;
18 | using Windows.UI.Xaml.Navigation;
19 | using WinGoMapsX.ViewModel.PlacesControls;
20 |
21 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
22 |
23 | namespace WinGoMapsX
24 | {
25 | ///
26 | /// An empty page that can be used on its own or navigated to within a Frame.
27 | ///
28 | public sealed partial class ExtendedSplashScreen : Page
29 | {
30 | DispatcherTimer DispatcherTime;
31 | object para = null;
32 | public ExtendedSplashScreen(SplashScreen splash, object parameter = null)
33 | {
34 | this.InitializeComponent();
35 | this.Loaded += ExtendedSplashScreen_Loaded;
36 | para = parameter;
37 | DispatcherTime = new DispatcherTimer
38 | {
39 | Interval = new TimeSpan(0, 0, 20)
40 | };
41 | DispatcherTime.Tick += DispatcherTime_Tick;
42 | DispatcherTime.Start();
43 | }
44 |
45 | private async void DispatcherTime_Tick(object sender, object e)
46 | {
47 | await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, RemoveExtendedSplash);
48 | }
49 | void LoadExtendedSplashScreen()
50 | {
51 | InstallVCD();
52 | UpdateJumpList();
53 | RemoveExtendedSplash();
54 | }
55 | public async void InstallVCD()
56 | {
57 | try
58 | {
59 | var r = ApplicationData.Current.LocalSettings.Values["VCDV10"].ToString();
60 | }
61 | catch (Exception)
62 | {
63 | try
64 | {
65 | var vcdStorageFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///VoiceCommands.xml", UriKind.RelativeOrAbsolute));
66 | await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(vcdStorageFile);
67 | ApplicationData.Current.LocalSettings.Values["VCDV10"] = "";
68 | }
69 | catch
70 | {
71 | ApplicationData.Current.LocalSettings.Values["VCDV10"] = null;
72 | }
73 | }
74 | }
75 | public async void UpdateJumpList()
76 | {
77 | try
78 | {
79 | var listjump = await JumpList.LoadCurrentAsync();
80 | listjump.Items.Clear();
81 | foreach (var Place in SavedPlacesVM.GetSavedPlaces())
82 | {
83 | listjump.SystemGroupKind = JumpListSystemGroupKind.None;
84 | listjump.Items.Add(JumpListItem.CreateWithArguments($"{Place.Latitude},{Place.Longitude}", Place.PlaceName));
85 | }
86 | await listjump.SaveAsync();
87 | }
88 | catch { }
89 | }
90 | private async void ExtendedSplashScreen_Loaded(object sender, RoutedEventArgs e)
91 | {
92 | await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, LoadExtendedSplashScreen);
93 | }
94 | void RemoveExtendedSplash()
95 | {
96 | try
97 | {
98 | DispatcherTime.Stop();
99 | DispatcherTime.Tick -= DispatcherTime_Tick;
100 | DispatcherTime = null;
101 | Window.Current.Content = new MainPage(para);
102 | Window.Current.Activate();
103 | }
104 | catch (Exception ex) { throw ex; }
105 | }
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/WinGoMapsX/Helpers/ClassInfo.cs:
--------------------------------------------------------------------------------
1 | using Windows.ApplicationModel;
2 | using Windows.Foundation.Metadata;
3 | using Windows.Security.ExchangeActiveSyncProvisioning;
4 | using Windows.System.Profile;
5 |
6 | class ClassInfo
7 | {
8 | public enum DeviceTypeEnum
9 | {
10 | Phone = 1,
11 | Tablet = 2,
12 | XBOX = 3
13 | }
14 |
15 | public static DeviceTypeEnum DeviceType()
16 | {
17 | var qualifiers = Windows.ApplicationModel.Resources.Core.ResourceContext.GetForCurrentView().QualifierValues;
18 | if (qualifiers.ContainsKey("DeviceFamily") && qualifiers["DeviceFamily"].ToLower().Contains("xbox"))
19 | {
20 | return DeviceTypeEnum.XBOX;
21 | }
22 | return ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")
23 | ? DeviceTypeEnum.Phone : DeviceTypeEnum.Tablet;
24 | }
25 | }
26 |
27 | public static class ClassProInfo
28 | {
29 | public static string SystemFamily { get; }
30 | public static string SystemVersion { get; }
31 | public static string SystemArchitecture { get; }
32 | public static string ApplicationName { get; }
33 | public static string ApplicationVersion { get; }
34 | public static string DeviceManufacturer { get; }
35 | public static string DeviceModel { get; }
36 | public static string DeviceID { get; }
37 |
38 | public static bool IsWindowsMobile()
39 | {
40 | if (SystemFamily == "Windows.Mobile")
41 | return true;
42 | else return false;
43 | }
44 |
45 | public static bool IsWindowsDesktop()
46 | {
47 | if (SystemFamily == "Windows.Desktop")
48 | return true;
49 | else return false;
50 | }
51 |
52 | static ClassProInfo()
53 | {
54 | // get the system family name
55 | var ai = AnalyticsInfo.VersionInfo;
56 | SystemFamily = ai.DeviceFamily;
57 |
58 | // get the system version number
59 | string sv = AnalyticsInfo.VersionInfo.DeviceFamilyVersion;
60 | ulong v = ulong.Parse(sv);
61 | ulong v1 = (v & 0xFFFF000000000000L) >> 48;
62 | ulong v2 = (v & 0x0000FFFF00000000L) >> 32;
63 | ulong v3 = (v & 0x00000000FFFF0000L) >> 16;
64 | ulong v4 = (v & 0x000000000000FFFFL);
65 | SystemVersion = $"{v1}.{v2}.{v3}.{v4}";
66 |
67 | // get the package architecure
68 | var package = Package.Current;
69 | SystemArchitecture = package.Id.Architecture.ToString();
70 |
71 | // get the user friendly app name
72 | ApplicationName = package.DisplayName;
73 |
74 | // get the app version
75 | PackageVersion pv = package.Id.Version;
76 | ApplicationVersion = $"{pv.Major}.{pv.Minor}.{pv.Build}.{pv.Revision}";
77 |
78 | // get the device manufacturer and model name
79 | var eas = new EasClientDeviceInformation();
80 | DeviceManufacturer = eas.SystemManufacturer;
81 | DeviceModel = eas.SystemProductName;
82 | DeviceID = eas.Id.ToString();
83 | }
84 | }
--------------------------------------------------------------------------------
/WinGoMapsX/Helpers/ExtentionMethods.cs:
--------------------------------------------------------------------------------
1 | using GMapsUWP.Directions;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Windows.Devices.Geolocation;
8 |
9 | namespace WinGoMapsX
10 | {
11 | public static class ExtentionMethods
12 | {
13 | public static Dictionary DecodeQueryParameters(this Uri uri)
14 | {
15 | if (uri == null)
16 | throw new ArgumentNullException("uri");
17 |
18 | if (uri.Query.Length == 0)
19 | return new Dictionary();
20 |
21 | return uri.Query.TrimStart('?')
22 | .Split(new[] { '&', ';' }, StringSplitOptions.RemoveEmptyEntries)
23 | .Select(parameter => parameter.Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries))
24 | .GroupBy(parts => parts[0],
25 | parts => parts.Length > 2 ? string.Join("=", parts, 1, parts.Length - 1) : (parts.Length > 1 ? parts[1] : ""))
26 | .ToDictionary(grouping => grouping.Key,
27 | grouping => string.Join(",", grouping));
28 | }
29 |
30 | public static double DistanceFromRoute(this Geopoint UserLocation, DirectionsHelper.Step CurrentStep)
31 | {
32 | //Y2,Y1 , X2,X1 points of the line, X0, Y0 user one
33 | //Latitude = Y, Longitude = X
34 | var Y0 = UserLocation.Position.Latitude;
35 | var X0 = UserLocation.Position.Longitude;
36 | var Y1 = CurrentStep.StartLocation.Latitude;
37 | var Y2 = CurrentStep.EndLocation.Latitude;
38 | var X1 = CurrentStep.StartLocation.Longitude;
39 | var X2 = CurrentStep.EndLocation.Longitude;
40 | var a = ((Y2 - Y1) * X0) - ((X2 - X1) * Y0) + (X2 * Y1) - (Y2 * X1);
41 | if (a < 0) a = -1 * a;
42 | var b = Math.Sqrt((Math.Pow((Y2 - Y1), 2) + Math.Pow((X2 - X1), 2)));
43 | var dist = ((a / b));
44 | dist = dist * 60 * 1.1515;
45 | return dist * 1.609344; // Return kilometer
46 | }
47 |
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/WinGoMapsX/Helpers/GeoLocatorHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.ApplicationModel.ExtendedExecution;
3 | using Windows.Devices.Geolocation;
4 | using Windows.Foundation;
5 | using Windows.System;
6 | using Windows.UI.Core;
7 | using Windows.UI.Popups;
8 | using Windows.UI.Xaml;
9 |
10 | class GeoLocatorHelper
11 | {
12 | public static event EventHandler LocationFetched;
13 | public static event EventHandler LocationChanged;
14 | public static bool IsLocationBusy { get; set; }
15 | private static ExtendedExecutionSession session;
16 | public static Geolocator Geolocator = new Geolocator() { DesiredAccuracy = PositionAccuracy.High, ReportInterval = 500 };
17 |
18 | private static async void StartLocationExtensionSession()
19 | {
20 | try
21 | {
22 | session = new ExtendedExecutionSession();
23 | session.Description = "Location Tracker";
24 | session.Reason = ExtendedExecutionReason.LocationTracking;
25 | var result = await session.RequestExtensionAsync();
26 | if (result == ExtendedExecutionResult.Denied)
27 | {
28 | //TODO: handle denied
29 | session.Revoked += new TypedEventHandler(ExtendedExecutionSession_Revoked);
30 | }
31 | }
32 | catch { }
33 | }
34 |
35 | private static void ExtendedExecutionSession_Revoked(object sender, ExtendedExecutionRevokedEventArgs args)
36 | {
37 | try
38 | {
39 | if (session != null)
40 | {
41 | session.Dispose();
42 | session = null;
43 | }
44 | }
45 | catch { }
46 | }
47 |
48 | static GeoLocatorHelper()
49 | {
50 | IsLocationBusy = false;
51 | StartLocationExtensionSession();
52 | GetUserLocation();
53 | }
54 |
55 | public static async void GetUserLocation()
56 | {
57 | try
58 | {
59 | if (IsLocationBusy) return;
60 | IsLocationBusy = true;
61 | var access = await Geolocator.RequestAccessAsync();
62 | if (access != GeolocationAccessStatus.Allowed)
63 | {
64 | var msg = new MessageDialog(MultilingualHelpToolkit.GetString("StringLocationPrivacy", "Text"));
65 | msg.Commands.Add(new UICommand(MultilingualHelpToolkit.GetString("StringOK", "Text"), async delegate
66 | {
67 | await Launcher.LaunchUriAsync(new Uri("ms-settings:privacy-location", UriKind.RelativeOrAbsolute));
68 | Window.Current.Activated += Current_Activated;
69 | }));
70 | msg.Commands.Add(new UICommand(MultilingualHelpToolkit.GetString("StringCancel", "Text"), delegate { }));
71 | var a = await msg.ShowAsync();
72 | }
73 | Geolocator.PositionChanged += Geolocator_PositionChanged;
74 | Geolocator.StatusChanged += GeoLocate_StatusChanged;
75 | var res = Geolocator.GetGeopositionAsync();
76 | if (res != null)
77 | res.Completed += new AsyncOperationCompletedHandler(LocationGetComplete);
78 | IsLocationBusy = false;
79 | }
80 | catch { }
81 | }
82 |
83 | private static void Current_Activated(object sender, WindowActivatedEventArgs e)
84 | {
85 | if (e.WindowActivationState == CoreWindowActivationState.CodeActivated)
86 | {
87 | Window.Current.Activated -= Current_Activated;
88 |
89 | GetUserLocation();
90 | }
91 | }
92 |
93 | private static void Geolocator_PositionChanged(Geolocator sender, PositionChangedEventArgs args)
94 | {
95 | try
96 | {
97 | LocationChanged?.Invoke(null, args.Position.Coordinate);
98 | }
99 | catch (Exception ex) { }
100 | }
101 |
102 | private static void GeoLocate_StatusChanged(Geolocator sender, StatusChangedEventArgs args)
103 | {
104 | if (args.Status == PositionStatus.NoData || args.Status == PositionStatus.NotAvailable)
105 | {
106 | GetUserLocation();
107 | }
108 | }
109 |
110 | private static void LocationGetComplete(IAsyncOperation asyncInfo, AsyncStatus asyncStatus)
111 | {
112 | try
113 | {
114 | var res = asyncInfo.GetResults();
115 | LocationFetched?.Invoke(null, res);
116 | //LocationChanged?.Invoke(null, res.Coordinate);
117 | IsLocationBusy = false;
118 | }
119 | catch
120 | {
121 | }
122 | }
123 |
124 | }
125 |
--------------------------------------------------------------------------------
/WinGoMapsX/Helpers/InternalHelper.cs:
--------------------------------------------------------------------------------
1 | using Windows.Networking.Connectivity;
2 |
3 | class InternalHelper
4 | {
5 | public static bool InternetConnection()
6 | {
7 | ConnectionProfile connections = NetworkInformation.GetInternetConnectionProfile();
8 | if (connections != null && connections.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess)
9 | return true;
10 | else return false;
11 | }
12 |
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/WinGoMapsX/Helpers/MultilingualHelpToolkit.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml;
3 |
4 |
5 | class MultilingualHelpToolkit
6 | {
7 | //GetString("LanguageOptionsSubTitle","Text")l
8 | public static string GetString(string Title, string Property)
9 | {
10 | Windows.ApplicationModel.Resources.ResourceLoader loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
11 | var expected = loader.GetString(Title + "/" + Property);
12 | if (expected.Contains(@"\n"))
13 | expected = expected.Replace(@"\n", Environment.NewLine);
14 | return expected;
15 | }
16 |
17 | public FlowDirection GetObjectFlowDirection(string Title)
18 | {
19 | Windows.ApplicationModel.Resources.ResourceLoader loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
20 | var expected = loader.GetString(Title + "/FlowDirection");
21 | if (expected.StartsWith("R") || expected.StartsWith("r"))
22 | return FlowDirection.RightToLeft;
23 | else return FlowDirection.LeftToRight;
24 | }
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/WinGoMapsX/Helpers/TileCoordinateHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Windows.Devices.Geolocation;
7 |
8 | public class TileCoordinate
9 | {
10 | public TileCoordinate(double lat, double lon, int zoom)
11 | {
12 | this.lat = lat;
13 | this.lon = lon;
14 | this.zoom = zoom;
15 | }
16 | public double y;
17 | public double x;
18 | public double lat;
19 | public double lon;
20 | public int zoom;
21 | public bool locationCoord()
22 | {
23 | if (Math.Abs(this.lat) > 85.0511287798066)
24 | return false;
25 | double sin_phi = Math.Sin(this.lat * Math.PI / 180);
26 | double norm_x = this.lon / 180;
27 | double norm_y = (0.5 * Math.Log((1 + sin_phi) / (1 - sin_phi))) / Math.PI;
28 | this.y = Math.Pow(2, this.zoom) * ((1 - norm_y) / 2);
29 | this.x = Math.Pow(2, this.zoom) * ((norm_x + 1) / 2);
30 | return true;
31 | }
32 |
33 | public static BasicGeoposition ReverseGeoPoint(double x, double y, double z)
34 | {
35 | var Lng = 180 * ((2 * x) / (Math.Pow(2, z)) - 1);
36 | var Lat = (180 / Math.PI) *
37 | Math.Asin((Math.Pow(Math.E, (2 * Math.PI * (1 - ((2 * y) / Math.Pow(2, z))))) - 1)
38 | / (1 + Math.Pow(Math.E, (2 * Math.PI * (1 - ((2 * y) / Math.Pow(2, z)))))));
39 | return new BasicGeoposition() { Latitude = Lat, Longitude = Lng };
40 |
41 | }
42 |
43 | }
--------------------------------------------------------------------------------
/WinGoMapsX/MainPage.DeviceFamily-Mobile.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/WinGoMapsX/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/WinGoMapsX/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using RavinduL.LocalNotifications;
2 | using RavinduL.LocalNotifications.Notifications;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Runtime.InteropServices.WindowsRuntime;
8 | using Windows.ApplicationModel.Store;
9 | using Windows.Foundation;
10 | using Windows.Foundation.Collections;
11 | using Windows.System;
12 | using Windows.UI;
13 | using Windows.UI.Core;
14 | using Windows.UI.Popups;
15 | using Windows.UI.Xaml;
16 | using Windows.UI.Xaml.Controls;
17 | using Windows.UI.Xaml.Controls.Primitives;
18 | using Windows.UI.Xaml.Data;
19 | using Windows.UI.Xaml.Input;
20 | using Windows.UI.Xaml.Media;
21 | using Windows.UI.Xaml.Navigation;
22 | using WinGoMapsX.View;
23 | using WinGoMapsX.View.OfflineMapDownloader;
24 | using WinGoMapsX.View.SettingsView;
25 |
26 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
27 |
28 | namespace WinGoMapsX
29 | {
30 | ///
31 | /// An empty page that can be used on its own or navigated to within a Frame.
32 | ///
33 | public sealed partial class MainPage : Page
34 | {
35 | object para = null;
36 | public MainPage(object parameter = null)
37 | {
38 | this.InitializeComponent();
39 | para = parameter;
40 | OnNavigatedTo(null);
41 | }
42 |
43 | protected override async void OnNavigatedTo(NavigationEventArgs e)
44 | {
45 | if (e != null)
46 | base.OnNavigatedTo(e);
47 |
48 | Fr.Navigate(typeof(MapView), para);
49 | HMenuTopLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringMapView", "Text"), Icon = "", Tag = "Map View" });
50 | HMenuTopLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringOfflineMaps", "Text"), Icon = "", Tag = "Offline Maps" });
51 |
52 | HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringSendFeedback", "Text"), Icon = "", Tag = "Send feedback" });
53 | HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringSettings", "Text"), Icon = "", Tag = "Settings" });
54 |
55 | SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested;
56 | try
57 | {
58 | if (CurrentAppSimulator.LicenseInformation.IsTrial)
59 | {
60 | var exp = CurrentAppSimulator.LicenseInformation.ExpirationDate;
61 | if (exp.Subtract(DateTime.Now) <= new TimeSpan(4, 0, 0, 0))
62 | {
63 | await new MessageDialog("Application will be expired on " + exp.ToString()).ShowAsync();
64 | }
65 | }
66 | // HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringBuyFromIran", "Text"), Icon = "", Tag = "Buy from Iran" });
67 | }
68 | catch
69 | {
70 | //HMenuBottomLst.Items.Add(new MenuClass { Text = MultilingualHelpToolkit.GetString("StringBuyFromIran", "Text"), Icon = "", Tag = "Buy from Iran" });
71 | }
72 | }
73 | private void MainPage_BackRequested(object sender, BackRequestedEventArgs e)
74 | {
75 | e.Handled = true;
76 | try
77 | {
78 | if (Fr.CanGoBack) Fr.GoBack();
79 | else
80 | {
81 | LocalNotificationManager lnm = new LocalNotificationManager(MG);
82 | lnm.Show(new SimpleNotification
83 | {
84 | TimeSpan = TimeSpan.FromSeconds(5),
85 | Text = "Click/Tap Here to exit",
86 | Glyph = "\uE7E8",
87 | Background = (new SolidColorBrush((Color)Resources["SystemControlBackgroundAccentBrush"])),
88 | VerticalAlignment = VerticalAlignment.Bottom,
89 | Action = () => { App.Current.Exit(); },
90 | }, LocalNotificationCollisionBehaviour.Wait);
91 |
92 | }
93 | }
94 | catch
95 | {
96 |
97 | }
98 | }
99 |
100 | private void HmenuBTN_Click(object sender, RoutedEventArgs e) => Split.IsPaneOpen = !Split.IsPaneOpen;
101 |
102 | private void Fr_Navigated(object sender, NavigationEventArgs e)
103 | {
104 | if (Split.DisplayMode == SplitViewDisplayMode.Overlay || Split.DisplayMode == SplitViewDisplayMode.CompactOverlay)
105 | {
106 | if (e.SourcePageType.Name == "MapView")
107 | HmenuBTN.Visibility = Visibility.Visible;
108 | else
109 | HmenuBTN.Visibility = Visibility.Collapsed;
110 | }
111 | if (Fr.CanGoBack)
112 | SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
113 | else SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
114 | }
115 |
116 | private async void MenuItem_Click(object sender, ItemClickEventArgs e)
117 | {
118 | switch ((e.ClickedItem as MenuClass).Tag)
119 | {
120 | case "Buy from Iran":
121 | await Launcher.LaunchUriAsync(new Uri("http://winmap.winuser.ir/2018/03/20/%D8%B1%D9%88%D8%B4-%D8%AE%D8%B1%DB%8C%D8%AF-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87-%D8%A8%D8%B1%D8%A7%DB%8C-%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1%D8%A7%D9%86-%D8%A7%DB%8C%D8%B1%D8%A7%D9%86%DB%8C/", UriKind.RelativeOrAbsolute));
122 | break;
123 | case "Map View":
124 | if (Fr.Content.GetType() != typeof(MapView))
125 | Fr.Navigate(typeof(MapView));
126 | break;
127 | case "Settings":
128 | if (Fr.Content.GetType() != typeof(SettingsMainView))
129 | Fr.Navigate(typeof(SettingsMainView));
130 | break;
131 | case "Offline Maps":
132 | if (Fr.Content.GetType() != typeof(MapDownloaderView))
133 | Fr.Navigate(typeof(MapDownloaderView));
134 | break;
135 | case "Send feedback":
136 | await Launcher.LaunchUriAsync(new Uri("mailto:ngame1390@live.com"));
137 | break;
138 | default:
139 | break;
140 | }
141 | if (Split.DisplayMode == SplitViewDisplayMode.Overlay)
142 | {
143 | Split.IsPaneOpen = false;
144 | }
145 | }
146 | private class MenuClass
147 | {
148 | public string Tag { get; set; }
149 | public string Icon { get; set; }
150 | public string Text { get; set; }
151 | }
152 |
153 |
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/WinGoMapsX/Microsoft.UI.Xaml/Assets/NoiseAsset_256X256_PNG.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MahStudio/WinGo-Maps/eeab36636603133c05e239a0349bee44485d9178/WinGoMapsX/Microsoft.UI.Xaml/Assets/NoiseAsset_256X256_PNG.png
--------------------------------------------------------------------------------
/WinGoMapsX/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | WinGo Maps
7 | Mah Studios
8 | Assets\StoreLogo.png
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/WinGoMapsX/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("WinGoMapsX")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("WinGoMapsX")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/WinGoMapsX/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/WinGoMapsX/Resources/CustomControls/DirectionsButton.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/WinGoMapsX/Resources/CustomControls/DotButton.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
57 |
58 |
--------------------------------------------------------------------------------
/WinGoMapsX/Resources/CustomControls/MoreInfoHyperLink.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/BookmarkAdd.xaml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/BookmarkAdd.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.Devices.Geolocation;
3 | using Windows.UI.Popups;
4 | using Windows.UI.StartScreen;
5 | using Windows.UI.Xaml;
6 | using Windows.UI.Xaml.Controls;
7 | using WinGoMapsX.ViewModel.PlacesControls;
8 |
9 | // The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
10 |
11 | namespace WinGoMapsX.View
12 | {
13 | public class BookmarkAddNeedsClass
14 | {
15 | public string PlaceID { get; set; }
16 | public Geopoint Location { get; set; }
17 | public string PlaceName { get; set; }
18 | }
19 | public sealed partial class BookmarkAdd : ContentDialog
20 | {
21 | public BookmarkAdd(BookmarkAddNeedsClass Context)
22 | {
23 | this.InitializeComponent();
24 | DataContext = Context;
25 | }
26 |
27 | private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
28 | {
29 | var context = DataContext as BookmarkAddNeedsClass;
30 | if (DefaultName.IsChecked.Value)
31 | {
32 | try
33 | {
34 | SavedPlacesVM.AddNewPlace(new SavedPlacesVM.SavedPlaceClass() { PlaceName = context.PlaceName, Latitude = context.Location.Position.Latitude, Longitude = context.Location.Position.Longitude });
35 | if (PinLiveTile.IsChecked.Value)
36 | {
37 | //var pd = await ViewModel.PlaceControls.PlaceDetailsHelper.GetPlaceDetails((DataContext as BookmarkAddNeedsClass).PlaceID);
38 | Uri square150x150Logo = new Uri("ms-appx:///Assets/Square150x150Logo.scale-100.png");
39 | SecondaryTile tile = new SecondaryTile(new Random(1).Next(Int32.MaxValue).ToString(), "Home", $"{context.Location.Position.Latitude},{context.Location.Position.Longitude}", square150x150Logo, TileSize.Square150x150);
40 | tile.DisplayName = PlaceNameText.Text;
41 | tile.VisualElements.ShowNameOnSquare150x150Logo = true;
42 | tile.VisualElements.ShowNameOnWide310x150Logo = true;
43 | tile.VisualElements.ShowNameOnSquare310x310Logo = true;
44 | tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/Wide310x150Logo.scale-200.png");
45 | tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/LargeTile.scale-200.png");
46 | await tile.RequestCreateAsync();
47 | }
48 | }
49 | catch (Exception ex)
50 | {
51 | await new MessageDialog(ex.Message).ShowAsync();
52 | await this.ShowAsync();
53 | }
54 | }
55 | else
56 | {
57 | try
58 | {
59 | SavedPlacesVM.AddNewPlace(new SavedPlacesVM.SavedPlaceClass() { PlaceName = PlaceNameText.Text, Latitude = context.Location.Position.Latitude, Longitude = context.Location.Position.Longitude });
60 | if (PinLiveTile.IsChecked.Value)
61 | {
62 | Uri square150x150Logo = new Uri("ms-appx:///Assets/Square150x150Logo.scale-100.png");
63 | SecondaryTile tile = new SecondaryTile(new Random(1).Next(Int32.MaxValue).ToString(), "Home", $"{context.Location.Position.Latitude},{context.Location.Position.Longitude}", square150x150Logo, TileSize.Square150x150);
64 | tile.DisplayName = PlaceNameText.Text;
65 | tile.VisualElements.ShowNameOnSquare150x150Logo = true;
66 | tile.VisualElements.ShowNameOnWide310x150Logo = true;
67 | tile.VisualElements.ShowNameOnSquare310x310Logo = true;
68 | tile.VisualElements.Wide310x150Logo = new Uri("ms-appx:///Assets/Wide310x150Logo.scale-200.png");
69 | tile.VisualElements.Square310x310Logo = new Uri("ms-appx:///Assets/LargeTile.scale-200.png");
70 | await tile.RequestCreateAsync();
71 | }
72 | }
73 | catch (Exception ex)
74 | {
75 | await new MessageDialog(ex.Message).ShowAsync();
76 | await this.ShowAsync();
77 | }
78 | }
79 | }
80 |
81 | private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
82 | {
83 | }
84 |
85 | private void RadioButtons_Checked(object sender, RoutedEventArgs e)
86 | {
87 | try
88 | {
89 | if (CustomName.IsChecked.Value)
90 | {
91 | PlaceNameText.IsEnabled = true;
92 | }
93 | else PlaceNameText.IsEnabled = false;
94 | }
95 | catch { }
96 | }
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/DirectionsControls/FullStepsProvider.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/DirectionsControls/FullStepsProvider.xaml.cs:
--------------------------------------------------------------------------------
1 | using GMapsUWP;
2 | using GMapsUWP.Directions;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Runtime.InteropServices.WindowsRuntime;
8 | using Windows.Foundation;
9 | using Windows.Foundation.Collections;
10 | using Windows.UI.Xaml;
11 | using Windows.UI.Xaml.Controls;
12 | using Windows.UI.Xaml.Controls.Primitives;
13 | using Windows.UI.Xaml.Data;
14 | using Windows.UI.Xaml.Input;
15 | using Windows.UI.Xaml.Media;
16 | using Windows.UI.Xaml.Media.Imaging;
17 | using Windows.UI.Xaml.Navigation;
18 |
19 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
20 |
21 | namespace WinGoMapsX.View.DirectionsControls
22 | {
23 | ///
24 | /// An empty page that can be used on its own or navigated to within a Frame.
25 | ///
26 | public sealed partial class FullStepsProvider : Page
27 | {
28 | private class Instruction
29 | {
30 | public string Distance { get; set; }
31 | public string Text { get; set; }
32 | public BitmapImage Image { get; set; }
33 | }
34 | public FullStepsProvider(DirectionsHelper.Route CurrentRoute)
35 | {
36 | this.InitializeComponent();
37 | var inst = new List();
38 | foreach (var Leg in CurrentRoute.Legs)
39 | {
40 | foreach (var CurrentStep in Leg.Steps)
41 | {
42 | inst.Add(new Instruction()
43 | {
44 | Text = CurrentStep.HtmlInstructions.NoHTMLString(),
45 | Distance = CurrentStep.Distance.Text,
46 | Image = new BitmapImage(new Uri("ms-appx:///Assets/DirectionsIcons/" + CurrentStep.Maneuver + ".png", UriKind.RelativeOrAbsolute))
47 | });
48 | }
49 | }
50 | DataContext = inst;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/DirectionsControls/NewDirections.DeviceFamily-Mobile.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/DirectionsControls/NewDirections.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/DirectionsControls/NewDirections.xaml.cs:
--------------------------------------------------------------------------------
1 | using GMapsUWP.Directions;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using Windows.Devices.Geolocation;
6 | using Windows.UI;
7 | using Windows.UI.Popups;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Maps;
11 | using Windows.UI.Xaml.Media;
12 | using WinGoMapsX.Helpers;
13 | using WinGoMapsX.ViewModel.SettingsView;
14 |
15 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
16 |
17 | namespace WinGoMapsX.View.DirectionsControls
18 | {
19 | public sealed partial class NewDirections : UserControl
20 | {
21 | public Geopoint Origin { get; set; }
22 | public Geopoint Destination { get; set; }
23 | public List Waypoints { get; set; }
24 |
25 | DirectionsHelper.DirectionModes Mode = DirectionsHelper.DirectionModes.walking;
26 |
27 | public MapControl Map { get; set; }
28 | public StepsTitleProvider StepsTitleProvider { get; set; }
29 | public NewDirections()
30 | {
31 | this.InitializeComponent();
32 | this.Loaded += NewDirections_Loaded;
33 | Waypoints = new List();
34 | }
35 |
36 | private void NewDirections_Loaded(object sender, RoutedEventArgs e)
37 | {
38 | var c = (Color)Resources["SystemControlBackgroundAccentBrush"];
39 | WalkBTN.Foreground = new SolidColorBrush(c);
40 | Mode = DirectionsHelper.DirectionModes.walking;
41 | }
42 |
43 | private async void NavMode_Click(object sender, RoutedEventArgs e)
44 | {
45 | #region Setting background / foreground / mode
46 | SolidColorBrush bg;
47 | if (Mode != DirectionsHelper.DirectionModes.walking)
48 | {
49 | bg = WalkBTN.Foreground as SolidColorBrush;
50 | }
51 | else
52 | {
53 | bg = DriveBTN.Foreground as SolidColorBrush;
54 | }
55 | WalkBTN.Foreground = bg;
56 | DriveBTN.Foreground = bg;
57 | TransitBTN.Foreground = bg;
58 | var c = (Color)Resources["SystemControlBackgroundAccentBrush"];
59 | (sender as Button).Foreground = new SolidColorBrush(c);
60 | switch ((sender as Button).Name)
61 | {
62 | case "WalkBTN":
63 | Mode = DirectionsHelper.DirectionModes.walking;
64 | break;
65 | case "DriveBTN":
66 | Mode = DirectionsHelper.DirectionModes.driving;
67 | break;
68 | case "TransitBTN":
69 | Mode = DirectionsHelper.DirectionModes.transit;
70 | break;
71 | default:
72 | break;
73 | }
74 | #endregion
75 |
76 | if (Destination == null || Origin == null) return;
77 | await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, DirectionFinder);
78 | }
79 | public async void DirectionFinder()
80 | {
81 | MapPolyline CurrentDrawed = null;
82 | try
83 | {
84 | foreach (var item in Map.MapElements)
85 | {
86 | if (item.GetType() == typeof(MapPolyline))
87 | CurrentDrawed = (MapPolyline)item;
88 | }
89 | }
90 | catch { }
91 |
92 | if (Destination == null) return;
93 | await VoiceNavigationHelper.ReadText("calculating route");
94 | var r = await DirectionsHelper.GetDirections(Origin.Position, Destination.Position, Mode, Waypoints);
95 |
96 | if (r == null) { await new MessageDialog(MultilingualHelpToolkit.GetString("StringNoWayToDestination", "Text")).ShowAsync(); return; }
97 | if (r.Status == "OVER_QUERY_LIMIT") { await new MessageDialog("OVER_QUERY_LIMIT").ShowAsync(); return; }
98 |
99 | if (CurrentDrawed != null)
100 | Map.MapElements.Remove(CurrentDrawed);
101 |
102 | var polyline = DirectionsHelper.GetDirectionAsRoute(r.Routes.FirstOrDefault(), (Color)Resources["SystemControlBackgroundAccentBrush"]);
103 | Map.MapElements.Add(polyline);
104 |
105 | new VoiceNavigationHelper(r.Routes.FirstOrDefault());
106 | StepsTitleProvider.SetRoute(r.Routes.FirstOrDefault());
107 |
108 | var distance = GetDistance(r.Routes.FirstOrDefault());
109 | var estime = DirectionsHelper.GetTotalEstimatedTime(r.Routes.FirstOrDefault());
110 | await new MessageDialog($"distance : {distance} estimated time : {estime}").ShowAsync();
111 | }
112 |
113 | public static string GetDistance(DirectionsHelper.Route Route)
114 | {
115 | var Distance = 0;
116 | foreach (var item in Route.Legs)
117 | {
118 | Distance += item.Distance.Value;
119 | }
120 | if (SettingsSetters.GetLengthUnit() == 0)
121 | {
122 | //Metric
123 | if (Distance <= 2000)
124 | return $"{Distance} {MultilingualHelpToolkit.GetString("StringMeters", "Text")}";
125 | else return $"{Distance / 1000f} {MultilingualHelpToolkit.GetString("StringKiloMeters", "Text")}";
126 | }
127 | else if (SettingsSetters.GetLengthUnit() == 1)
128 | {
129 | //Imperial
130 | if (Distance <= 2000)
131 | return $"{string.Format("{0:0.00}", Distance * 1.093613f)} {MultilingualHelpToolkit.GetString("StringYards", "Text")}";
132 | else return $"{string.Format("{0:0.00}", Distance * 0.000621371f)} {MultilingualHelpToolkit.GetString("StringMiles", "Text")}";
133 | }
134 | else
135 | {
136 | //US
137 | if (Distance <= 2000)
138 | return $"{string.Format("{0:0.00}", Distance * 3.28084f)} {MultilingualHelpToolkit.GetString("StringFeet", "Text")}";
139 | else return $"{string.Format("{0:0.00}", Distance * 0.000621371f)} {MultilingualHelpToolkit.GetString("StringMiles", "Text")}";
140 | }
141 | }
142 | }
143 | }
144 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/DirectionsControls/StepsTitleProvider.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/DirectionsControls/StepsTitleProvider.xaml.cs:
--------------------------------------------------------------------------------
1 | using GMapsUWP;
2 | using GMapsUWP.Directions;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Runtime.InteropServices.WindowsRuntime;
8 | using Windows.Devices.Geolocation;
9 | using Windows.Foundation;
10 | using Windows.Foundation.Collections;
11 | using Windows.UI.Core;
12 | using Windows.UI.Xaml;
13 | using Windows.UI.Xaml.Controls;
14 | using Windows.UI.Xaml.Controls.Primitives;
15 | using Windows.UI.Xaml.Data;
16 | using Windows.UI.Xaml.Input;
17 | using Windows.UI.Xaml.Media;
18 | using Windows.UI.Xaml.Media.Imaging;
19 | using Windows.UI.Xaml.Navigation;
20 | using WinGoMapsX.ViewModel;
21 |
22 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
23 |
24 | namespace WinGoMapsX.View.DirectionsControls
25 | {
26 | public sealed partial class StepsTitleProvider : UserControl
27 | {
28 | DirectionsHelper.Route CurrentRoute { get; set; }
29 | DirectionsHelper.Leg CurrentLeg { get; set; }
30 | DirectionsHelper.Step CurrentStep { get; set; }
31 | public bool IsBusy { get; set; }
32 | public MapView MapView { get; set; }
33 |
34 | public StepsTitleProvider()
35 | {
36 | this.InitializeComponent();
37 | this.Visibility = Visibility.Collapsed;
38 | }
39 |
40 | public void SetRoute(DirectionsHelper.Route Route)
41 | {
42 | GeoLocatorHelper.LocationChanged += GeoLocatorHelper_LocationChanged;
43 | CurrentRoute = Route;
44 | CurrentLeg = Route.Legs.FirstOrDefault();
45 | CurrentStep = CurrentLeg.Steps.FirstOrDefault();
46 | this.Visibility = Visibility.Visible;
47 | UpdateStep();
48 | FullList_Click(null, null);
49 | }
50 |
51 | private async void GeoLocatorHelper_LocationChanged(object sender, Geocoordinate e)
52 | {
53 | if (CurrentRoute == null || IsBusy) return;
54 | IsBusy = true;
55 | await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, delegate
56 | {
57 | var cp = e.Point.Position;
58 | var ds = DistanceTo(CurrentStep.EndLocation.Latitude, CurrentStep.EndLocation.Longitude, cp.Latitude, cp.Longitude, 'K');
59 | if (ds < 0.010)
60 | {
61 | //Next Step/Leg
62 | var slist = CurrentLeg.Steps.ToList();
63 | var sind = slist.FindIndex(x => x == CurrentStep);
64 | if (sind < (slist.Count - 1))
65 | CurrentStep = slist[(++sind)];
66 | else
67 | {
68 | var llist = CurrentRoute.Legs.ToList();
69 | var lind = llist.FindIndex(x => x == CurrentLeg);
70 | if (lind < (llist.Count - 1))
71 | CurrentLeg = llist[(++lind)];
72 | else this.Visibility = Visibility.Visible;//end of navigation
73 | }
74 | CurrentLeg.Steps.Where(x => x == CurrentStep);
75 | }
76 | IsBusy = false;
77 | });
78 | }
79 |
80 | async void UpdateStep()
81 | {
82 | await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, delegate
83 | {
84 | ComandInstructions.Text = CurrentStep.HtmlInstructions.NoHTMLString();
85 | ComandImage.Source = new BitmapImage(new Uri("ms-appx:///Assets/DirectionsIcons/" + CurrentStep.Maneuver + ".png", UriKind.RelativeOrAbsolute));
86 | });
87 | }
88 |
89 | double DistanceTo(double lat1, double lon1, double lat2, double lon2, char unit = 'K')
90 | {
91 | double rlat1 = Math.PI * lat1 / 180;
92 | double rlat2 = Math.PI * lat2 / 180;
93 | double theta = lon1 - lon2;
94 | double rtheta = Math.PI * theta / 180;
95 | double dist =
96 | Math.Sin(rlat1) * Math.Sin(rlat2) + Math.Cos(rlat1) *
97 | Math.Cos(rlat2) * Math.Cos(rtheta);
98 | dist = Math.Acos(dist);
99 | dist = dist * 180 / Math.PI;
100 | dist = dist * 60 * 1.1515;
101 | switch (unit)
102 | {
103 | case 'K': //Kilometers -> default
104 | return dist * 1.609344;
105 | case 'N': //Nautical Miles
106 | return dist * 0.8684;
107 | case 'M': //Miles
108 | return dist;
109 | }
110 | return dist;
111 | }
112 |
113 | private void FullList_Click(object sender, RoutedEventArgs e)
114 | {
115 | (MapView.FindName("RightPaneGrid") as Grid).Children.Clear();
116 | (MapView.FindName("RightPaneGrid") as Grid).Children.Add(new FullStepsProvider(CurrentRoute) { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch });
117 | (MapView.DataContext as MapViewVM).RightPaneOpen = true;
118 | }
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/OfflineMapDownloader/MapDownloaderView.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | This tool will let you to download offline map for a selected range of world map. Please select a region and hit start download.
21 |
22 | Touch 2 points on map to select region. First point Top Left, Second point Bottom Right. If you want to change pointers position click on the flag and try to set it in any position you want
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/OnMapControls/ChangeViewUserControl.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/OnMapControls/ChangeViewUserControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Maps;
11 | using Windows.UI.Xaml.Controls.Primitives;
12 | using Windows.UI.Xaml.Data;
13 | using Windows.UI.Xaml.Input;
14 | using Windows.UI.Xaml.Media;
15 | using Windows.UI.Xaml.Navigation;
16 |
17 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
18 |
19 | namespace WinGoMapsX.View.OnMapControls
20 | {
21 | public sealed partial class ChangeViewUserControl : UserControl
22 | {
23 | public MapControl Map { set => ChangeViewUCVM.Map = value; }
24 | public ChangeViewUserControl()
25 | {
26 | this.InitializeComponent();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/OnMapControls/MyLocationUserControl.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/OnMapControls/MyLocationUserControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using System.Threading.Tasks;
7 | using Windows.Devices.Sensors;
8 | using Windows.Foundation;
9 | using Windows.Foundation.Collections;
10 | using Windows.UI.Core;
11 | using Windows.UI.Popups;
12 | using Windows.UI.Xaml;
13 | using Windows.UI.Xaml.Controls;
14 | using Windows.UI.Xaml.Controls.Primitives;
15 | using Windows.UI.Xaml.Data;
16 | using Windows.UI.Xaml.Input;
17 | using Windows.UI.Xaml.Media;
18 | using Windows.UI.Xaml.Navigation;
19 | using WinGoMapsX.ViewModel;
20 |
21 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
22 |
23 | namespace WinGoMapsX.View.OnMapControls
24 | {
25 | public sealed partial class MyLocationUserControl : UserControl
26 | {
27 | int count = 0;
28 | public MapViewVM MapViewVM { get; set; }
29 | public MyLocationUserControl()
30 | {
31 | this.InitializeComponent();
32 | }
33 |
34 | private async void Button_Click(object sender, RoutedEventArgs e)
35 | {
36 | await AppCore.Dispatcher.TryRunAsync(CoreDispatcherPriority.Normal, RunBTNClick);
37 | }
38 |
39 | private async void RunBTNClick()
40 | {
41 | count++;
42 | await Task.Delay(350);
43 | if (count == 0) return;
44 | if (count == 1)
45 | {
46 | try
47 | {
48 | await Task.Delay(10);
49 | GeoLocatorHelper.GetUserLocation();
50 | }
51 | catch { }
52 | }
53 | else
54 | {
55 | try
56 | {
57 | if (Compass.GetDefault() == null) return;
58 | if (thisbtn.Content.ToString() == "")
59 | {
60 | MapViewVM.CompassMode = true;
61 | thisbtn.Content = "";
62 | }
63 | else
64 | {
65 | MapViewVM.CompassMode = false;
66 | thisbtn.Content = "";
67 | }
68 | //if (MapViewVM.Compass != null)
69 | //{
70 | // MapViewVM.CompassEnabled = !MapViewVM.CompassEnabled;
71 | // if (MapViewVM.CompassEnabled)
72 | // thisbtn.Content = "";
73 | // else thisbtn.Content = "";
74 | //}
75 | }
76 | catch (Exception ex)
77 | {
78 | await new MessageDialog(ex.Message).ShowAsync();
79 | }
80 | }
81 | count = 0;
82 | }
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/OnMapControls/SearchUserControl.DeviceFamily-Mobile.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/OnMapControls/SearchUserControl.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/OnMapControls/SearchUserControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Maps;
11 | using Windows.UI.Xaml.Controls.Primitives;
12 | using Windows.UI.Xaml.Data;
13 | using Windows.UI.Xaml.Input;
14 | using Windows.UI.Xaml.Media;
15 | using Windows.UI.Xaml.Navigation;
16 |
17 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
18 |
19 | namespace WinGoMapsX.View.OnMapControls
20 | {
21 | public sealed partial class SearchUserControl : UserControl
22 | {
23 | private MapControl _map;
24 | public MapControl Map { get => _map; set { _map = value; SearchUserControlVM.Map = value; } }
25 | public SearchUserControl()
26 | {
27 | this.InitializeComponent();
28 | }
29 |
30 | private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
31 | {
32 | if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
33 | SearchUserControlVM.TextChangedCmd.Execute(sender.Text);
34 | }
35 |
36 | private void AutoSuggestBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args)
37 | {
38 |
39 | SearchUserControlVM.SuggestChoosenCmd.Execute(args.SelectedItem);
40 | autoSuggestBox.Text = "";
41 |
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/OnMapControls/ZoomUserControl.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/OnMapControls/ZoomUserControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.UI.Xaml;
3 | using Windows.UI.Xaml.Controls;
4 | using Windows.UI.Xaml.Controls.Maps;
5 |
6 | // The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
7 |
8 | namespace WinGoMapsX.View.OnMapControls
9 | {
10 | public sealed partial class ZoomUserControl : UserControl
11 | {
12 | private MapControl _map { get; set; }
13 | public MapControl Map { get => _map; set { _map = value; Map.HeadingChanged += Map_HeadingChanged; } }
14 |
15 | public ZoomUserControl() => this.InitializeComponent();
16 |
17 | private async void ZoomOut_Click(object sender, RoutedEventArgs e) => await Map.TryZoomOutAsync();
18 |
19 | private async void ZoomIn_Click(object sender, RoutedEventArgs e)=> await Map.TryZoomInAsync();
20 |
21 | private async void North_Click(object sender, RoutedEventArgs e)=> await Map.TryRotateToAsync(0);
22 |
23 | private void Map_HeadingChanged(MapControl sender, object args)
24 | {
25 | if (Map.Heading != 0) North.IsEnabled = true;
26 | else North.IsEnabled = false;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/SettingsView/SettingsLanguageView.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Translators
49 |
50 | Arabic
51 |
52 | Ahmad Karaki
53 |
54 | Belarusian
55 |
56 | Deerslayer
57 |
58 | Czech
59 |
60 | Roman Praslička
61 |
62 | French
63 |
64 | Cretenet Thierry
65 |
66 | German
67 |
68 | Loris Oberländer
69 |
70 | Italian
71 |
72 | Filippo Fedeli
73 |
74 | Japanese
75 |
76 | Mamoru Satoh
77 |
78 | Persian
79 |
80 | Maryam Garaeli Shekh, Ali Noshahi
81 |
82 | Portuguese (Brazil)
83 |
84 | Marcus Malvar Corbacho
85 |
86 | Spanish
87 |
88 | Sergio Fernández-Pacheco Rico, Elías Puma
89 |
90 | Turkish
91 |
92 | Hadi Dana
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/SettingsView/SettingsLanguageView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Primitives;
11 | using Windows.UI.Xaml.Data;
12 | using Windows.UI.Xaml.Input;
13 | using Windows.UI.Xaml.Media;
14 | using Windows.UI.Xaml.Navigation;
15 |
16 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
17 |
18 | namespace WinGoMapsX.View.SettingsView
19 | {
20 | ///
21 | /// An empty page that can be used on its own or navigated to within a Frame.
22 | ///
23 | public sealed partial class SettingsLanguageView : Page
24 | {
25 | public SettingsLanguageView()
26 | {
27 | this.InitializeComponent();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/SettingsView/SettingsMainView.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | Access to contacts
42 |
43 | Some description about why we need
44 |
45 |
46 |
47 |
48 |
49 |
50 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | About
69 |
70 | WinGoMaps
71 |
72 |
73 | © 2018 MahStudio
74 |
75 | Developers Team
76 |
77 | Ali Noshahi, Mohsen Seifi, Poura Riyahi, Mehdi Ardakani, Maryam Garaeli Shekh, Shivanand Anchalkar
78 |
79 | Design Team
80 |
81 | Mohammad Alidoost, Amir Estefad
82 |
83 | Special thanks to
84 |
85 | Microsoft Bing Maps Enterprise Team, For their hep in fixing location pointer bug and more on mobile.
86 |
87 | Joost van Schaik, Windows Development MVP for his helps in solving application's bug on Mobile
88 |
89 | Ahmad Karaki for his calculations and formulas
90 |
91 | Ali Ghamari and Filippo Fedeli for his testings and reporting lots of issues
92 |
93 | Insiders on Telegram who have provide many ideas and did lots of debugging to make this app better
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/WinGoMapsX/View/SettingsView/SettingsMainView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Primitives;
11 | using Windows.UI.Xaml.Data;
12 | using Windows.UI.Xaml.Input;
13 | using Windows.UI.Xaml.Media;
14 | using Windows.UI.Xaml.Navigation;
15 |
16 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
17 |
18 | namespace WinGoMapsX.View.SettingsView
19 | {
20 | ///
21 | /// An empty page that can be used on its own or navigated to within a Frame.
22 | ///
23 | public sealed partial class SettingsMainView : Page
24 | {
25 | public SettingsMainView() => this.InitializeComponent();
26 |
27 | private void LanguageSets_Click(object sender, RoutedEventArgs e) => Frame.Navigate(typeof(SettingsLanguageView));
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/WinGoMapsX/ViewModel/OnMapControls/ChangeViewUCVM.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Windows.Networking.Connectivity;
8 | using Windows.UI.Core;
9 | using Windows.UI.Xaml;
10 | using Windows.UI.Xaml.Controls.Maps;
11 | using WinGoMapsX.ViewModel.SettingsView;
12 |
13 | namespace WinGoMapsX.ViewModel.OnMapControls
14 | {
15 | public enum MapMode
16 | {
17 | Standard,
18 | RoadsOnly,
19 | Satellite,
20 | Hybrid
21 | }
22 | class ChangeViewUCVM : INotifyPropertyChanged
23 | {
24 | private bool _showtraffic;
25 | private bool _isDefaultMapViewOn;
26 | private bool _isSatelliteMapViewOn;
27 | private bool _isHybridMapViewOn;
28 | private bool _isRoadsOnlyViewOn;
29 | public event PropertyChangedEventHandler PropertyChanged;
30 | void Update(string propname)
31 | {
32 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propname));
33 | }
34 | public bool ShowTraffic
35 | {
36 | get => _showtraffic; set
37 | {
38 | _showtraffic = value;
39 | UseGoogleMaps(CurrentMapMode, ShowTraffic, true, AllowOverstretch, FadeAnimationEnabled);
40 | Update("ShowTraffic");
41 | }
42 | }
43 | public bool IsDefaultMapViewOn
44 | {
45 | get => _isDefaultMapViewOn; set
46 | {
47 | _isDefaultMapViewOn = value;
48 | if (value) UseGoogleMaps(MapMode.Standard, ShowTraffic, true, AllowOverstretch, FadeAnimationEnabled);
49 | Update("IsDefaultMapViewOn");
50 | }
51 | }
52 | public bool IsSatelliteMapViewOn
53 | {
54 | get => _isSatelliteMapViewOn; set
55 | {
56 | _isSatelliteMapViewOn = value;
57 | if (value) UseGoogleMaps(MapMode.Satellite, ShowTraffic, true, AllowOverstretch, FadeAnimationEnabled);
58 | Update("IsSatelliteMapViewOn");
59 | }
60 | }
61 | public bool IsHybridMapViewOn
62 | {
63 | get => _isHybridMapViewOn; set
64 | {
65 | _isHybridMapViewOn = value;
66 | if (value) UseGoogleMaps(MapMode.Hybrid, ShowTraffic, true, AllowOverstretch, FadeAnimationEnabled);
67 | Update("IsHybridMapViewOn");
68 | }
69 | }
70 | public bool IsRoadsOnlyViewOn
71 | {
72 | get => _isRoadsOnlyViewOn; set
73 | {
74 | _isRoadsOnlyViewOn = value;
75 | if (value) UseGoogleMaps(MapMode.RoadsOnly, ShowTraffic, true, AllowOverstretch, FadeAnimationEnabled);
76 | Update("IsRoadsOnlyViewOn");
77 | }
78 | }
79 |
80 |
81 | public MapMode CurrentMapMode;
82 | public bool AllowOverstretch { get => SettingsSetters.GetAllowOverstretch(); }
83 | public bool FadeAnimationEnabled { get => SettingsSetters.GetFadeAnimationEnabled(); }
84 | private MapControl _map { get; set; }
85 | public MapControl Map
86 | {
87 | get => _map; set
88 | {
89 | _map = value;
90 | UseGoogleMaps(CurrentMapMode, ShowTraffic, true, AllowOverstretch, FadeAnimationEnabled);
91 | }
92 | }
93 | public ChangeViewUCVM()
94 | {
95 | if (App.Current.RequestedTheme == ApplicationTheme.Light)
96 | CurrentMapMode = MapMode.Standard;
97 | else CurrentMapMode = MapMode.RoadsOnly;
98 | IsDefaultMapViewOn = true;
99 | ShowTraffic = SettingsSetters.GetShowTrafficOnLaunch();
100 | }
101 |
102 | public void UseGoogleMaps(MapMode MapMode, bool showtraffic, bool AllowCaching, bool AllowOverstretch, bool IsFadingEnabled)
103 | {
104 | if (Map == null) return;
105 | GMapsUWP.Map.MapControlHelper.MapMode md = GMapsUWP.Map.MapControlHelper.MapMode.Standard;
106 | switch (MapMode)
107 | {
108 | case MapMode.Standard:
109 | IsHybridMapViewOn = false;
110 | IsRoadsOnlyViewOn = false;
111 | IsSatelliteMapViewOn = false;
112 | md = GMapsUWP.Map.MapControlHelper.MapMode.Standard;
113 | CurrentMapMode = MapMode.Standard;
114 | break;
115 | case MapMode.RoadsOnly:
116 | IsHybridMapViewOn = false;
117 | IsDefaultMapViewOn = false;
118 | IsSatelliteMapViewOn = false;
119 | md = GMapsUWP.Map.MapControlHelper.MapMode.RoadsOnly;
120 | CurrentMapMode = MapMode.RoadsOnly;
121 | break;
122 | case MapMode.Satellite:
123 | IsHybridMapViewOn = false;
124 | IsRoadsOnlyViewOn = false;
125 | IsDefaultMapViewOn = false;
126 | md = GMapsUWP.Map.MapControlHelper.MapMode.Satellite;
127 | CurrentMapMode = MapMode.Satellite;
128 | break;
129 | case MapMode.Hybrid:
130 | IsDefaultMapViewOn = false;
131 | IsRoadsOnlyViewOn = false;
132 | IsSatelliteMapViewOn = false;
133 | md = GMapsUWP.Map.MapControlHelper.MapMode.Hybrid;
134 | CurrentMapMode = MapMode.Hybrid;
135 | break;
136 | default:
137 | break;
138 | }
139 | GMapsUWP.Map.MapControlHelper.UseGoogleMaps(Map, md, ShowTraffic, AllowCaching, AllowOverstretch, IsFadingEnabled);
140 | }
141 | }
142 | }
143 |
144 |
--------------------------------------------------------------------------------
/WinGoMapsX/ViewModel/PlacesControls/SavedPlacesVM.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using Windows.Storage;
8 | using Windows.UI.StartScreen;
9 |
10 | namespace WinGoMapsX.ViewModel.PlacesControls
11 | {
12 | class SavedPlacesVM
13 | {
14 | ///
15 | /// Get saved places in application
16 | ///
17 | /// Saved Places
18 | public static List GetSavedPlaces()
19 | {
20 | try
21 | {
22 | return JsonConvert.DeserializeObject>(ApplicationData.Current.RoamingSettings.Values["SavedPlaces"].ToString());
23 | }
24 | catch
25 | {
26 | return new List();
27 | }
28 | }
29 | public static async void UpdateJumpList()
30 | {
31 | try
32 | {
33 | var listjump = await JumpList.LoadCurrentAsync();
34 | listjump.Items.Clear();
35 | foreach (var Place in GetSavedPlaces())
36 | {
37 | listjump.SystemGroupKind = JumpListSystemGroupKind.None;
38 | listjump.Items.Add(JumpListItem.CreateWithArguments($"{Place.Latitude},{Place.Longitude}", Place.PlaceName));
39 | }
40 | await listjump.SaveAsync();
41 | }
42 | catch { }
43 | }
44 | ///
45 | /// Save a place to saved places
46 | ///
47 | /// Information of the place to save
48 | /// return true for success or false
49 | /// PlaceName is already exists
50 | /// See Exception message for details.
51 | public static bool AddNewPlace(SavedPlaceClass Place)
52 | {
53 | try
54 | {
55 | if (Place.PlaceName == "")
56 | throw new Exception("Please choose a name for this place");
57 | var r = GetSavedPlaces();
58 | if (r.Where(x => x.PlaceName.ToLower() == Place.PlaceName.ToLower()).Any())
59 | throw new ArgumentOutOfRangeException("PlaceName is already exists");
60 | r.Add(Place);
61 | ApplicationData.Current.RoamingSettings.Values["SavedPlaces"] = JsonConvert.SerializeObject(r);
62 | UpdateJumpList();
63 | return true;
64 | }
65 | catch (Exception ex)
66 | {
67 | throw ex;
68 | }
69 | }
70 | ///
71 | /// Delete a saved place
72 | ///
73 | /// name of the saved place
74 | /// return true for success or false
75 | /// PlaceName couldn't be found in saved places
76 | /// See Exception message for details.
77 | public static bool DeletePlace(string PlaceName)
78 | {
79 | try
80 | {
81 | var r = GetSavedPlaces();
82 | var p = r.Where(x => x.PlaceName.ToLower() == PlaceName.ToLower());
83 | if (p.Count() == 0) throw new KeyNotFoundException("PlaceName not found");
84 | r.Remove(p.FirstOrDefault());
85 | ApplicationData.Current.RoamingSettings.Values["SavedPlaces"] = JsonConvert.SerializeObject(r);
86 | UpdateJumpList();
87 | return true;
88 | }
89 | catch (Exception ex)
90 | {
91 | throw ex;
92 | }
93 | }
94 |
95 | public class SavedPlaceClass
96 | {
97 | public double Latitude { get; set; }
98 | public double Longitude { get; set; }
99 | public string PlaceName { get; set; }
100 | }
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/WinGoMapsX/ViewModel/SettingsView/SettingsLanguageVM.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using Windows.Globalization;
6 | using Windows.Storage;
7 | using WinGoMapsX.Helpers;
8 |
9 | namespace WinGoMapsX.ViewModel.SettingsView
10 | {
11 | class SettingsLanguageVM : INotifyPropertyChanged
12 | {
13 | private CountryCodesHelper CCHelper = new CountryCodesHelper();
14 |
15 | private string _onMapLanguage;
16 | private string _apiLanguage;
17 | private int _onmaplangindex;
18 | private int _apilangindex;
19 | private int _applicationlangindex;
20 |
21 | public event PropertyChangedEventHandler PropertyChanged;
22 |
23 | public int APILanguageIndex
24 | {
25 | get => _apilangindex;
26 | set
27 | {
28 | _apilangindex = value;
29 | LanguageSettingsSetters.SetAPILanguage(SupportedLanguages[value].Value);
30 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("APILanguageIndex"));
31 | }
32 | }
33 | public int OnMapLanguageIndex
34 | {
35 | get => _onmaplangindex;
36 | set
37 | {
38 | _onmaplangindex = value;
39 | LanguageSettingsSetters.SetOnMapLanguage(SupportedMapLanguage[value].Value);
40 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("OnMapLanguageIndex"));
41 | }
42 | }
43 | public int ApplicationLanguageIndex
44 | {
45 | get => _applicationlangindex;
46 | set
47 | {
48 | _applicationlangindex = value;
49 | LanguageSettingsSetters.SetApplicationLanguage(ApplicationLanguages[value].Value);
50 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ApplicationLanguageIndex"));
51 | }
52 | }
53 | public string OnMapLanguage
54 | {
55 | get => _onMapLanguage;
56 | set
57 | {
58 | _onMapLanguage = value;
59 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("OnMapLanguage"));
60 | }
61 | }
62 | public string APILanguage { get => _apiLanguage; set { _apiLanguage = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("APILanguage")); } }
63 |
64 | public List> SupportedLanguages
65 | {
66 | get => CCHelper.CountriesAndLanguageCodes.ToList();
67 | }
68 | public List> SupportedMapLanguage
69 | {
70 | get
71 | {
72 | var lst = new List>();
73 | lst.Add(new KeyValuePair("Local Languages", "x-local"));
74 | lst.AddRange(CCHelper.CountriesAndLanguageCodes);
75 | return lst;
76 | }
77 | }
78 | public List> ApplicationLanguages
79 | {
80 | get => new List>()
81 | {
82 | new KeyValuePair("Arabic","Ar"),
83 | new KeyValuePair("Belarusian","Be-By"),
84 | new KeyValuePair("Czech","cs-cz"),
85 | new KeyValuePair("English","En-Us"),
86 | new KeyValuePair("French","Fr-Fr"),
87 | new KeyValuePair("German","DE-DE"),
88 | new KeyValuePair("Italian","it"),
89 | new KeyValuePair("Japanese","ja-JP"),
90 | new KeyValuePair("Persian","Fa-Ir"),
91 | new KeyValuePair("Portuguese (Brazil)","Pt-Br"),
92 | new KeyValuePair("Turkish","tr-tr"),
93 | new KeyValuePair("Spanish","ES")
94 | };
95 | }
96 | public SettingsLanguageVM()
97 | {
98 | OnMapLanguageIndex = SupportedMapLanguage.FindIndex(x => x.Value.ToLower() == LanguageSettingsSetters.GetOnMapLanguage());
99 | APILanguageIndex = SupportedLanguages.FindIndex(x => x.Value.ToLower() == LanguageSettingsSetters.GetAPILanguage());
100 | ApplicationLanguageIndex = ApplicationLanguages.FindIndex(x => x.Value.ToLower() == LanguageSettingsSetters.GetApplicationLanguage());
101 | }
102 |
103 | }
104 |
105 | class LanguageSettingsSetters
106 | {
107 | public static void SetAPILanguage(string LanguageCode)
108 | {
109 | ApplicationData.Current.LocalSettings.Values["APILanguage"] = LanguageCode.ToLower();
110 | AppCore.GoogleMapRequestsLanguage = LanguageCode.ToLower();
111 | }
112 |
113 | public static string GetAPILanguage()
114 | {
115 | try
116 | {
117 | return ApplicationData.Current.LocalSettings.Values["APILanguage"].ToString();
118 | }
119 | catch
120 | {
121 | SetAPILanguage("en-us");
122 | return "en-us";
123 | }
124 | }
125 | public static void SetOnMapLanguage(string LanguageCode) => ApplicationData.Current.LocalSettings.Values["OnMapLanguage"] = LanguageCode.ToLower();
126 |
127 | public static string GetOnMapLanguage()
128 | {
129 | try
130 | {
131 | return ApplicationData.Current.LocalSettings.Values["OnMapLanguage"].ToString();
132 | }
133 | catch
134 | {
135 | SetOnMapLanguage("x-local");
136 | return "x-local";
137 | }
138 | }
139 | public static void SetApplicationLanguage(string LanguageCode)
140 | {
141 | ApplicationData.Current.LocalSettings.Values["ApplicationLanguage"] = LanguageCode.ToLower();
142 | ApplicationLanguages.PrimaryLanguageOverride = LanguageCode;
143 | var English = new System.Globalization.CultureInfo("en-us");
144 | System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator = English.NumberFormat.NumberDecimalSeparator;
145 | System.Globalization.CultureInfo.CurrentCulture.NumberFormat.CurrencyDecimalSeparator = English.NumberFormat.CurrencyDecimalSeparator;
146 | System.Globalization.CultureInfo.CurrentCulture.NumberFormat.PercentDecimalSeparator = English.NumberFormat.PercentDecimalSeparator;
147 | }
148 |
149 | public static string GetApplicationLanguage()
150 | {
151 | try
152 | {
153 | return ApplicationData.Current.LocalSettings.Values["ApplicationLanguage"].ToString();
154 | }
155 | catch
156 | {
157 | SetApplicationLanguage("En-Us");
158 | return "En-Us";
159 | }
160 | }
161 | }
162 | }
163 |
--------------------------------------------------------------------------------
/WinGoMapsX/VoiceCommands.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Bingo
5 | Get me directions to somewhere
6 |
7 |
8 | Directions to somewhere
9 | [get] [me] directions [to] {UserInput}
10 | Here is directions to {UserInput}
11 |
12 |
13 |
14 |
15 | Find somewhere on map
16 | Find {UserInput} [for] [me] [on] [map]
17 | Looking for {UserInput}
18 |
19 |
20 |
21 |
22 | Where Am I
23 | Where [am] [I] [am]
24 | Looking for Your location
25 |
26 |
27 |
28 |
29 |
30 |
31 |
41 |
--------------------------------------------------------------------------------
/WinGoService/Cortana.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Windows.ApplicationModel.AppService;
7 | using Windows.ApplicationModel.Background;
8 | using Windows.ApplicationModel.VoiceCommands;
9 | using Windows.Devices.Geolocation;
10 | using Windows.Storage;
11 | using Windows.Web.Http;
12 |
13 | namespace WinGoService
14 | {
15 | public sealed class Cortana : IBackgroundTask
16 | {
17 | BackgroundTaskDeferral serviceDeferral;
18 | VoiceCommandServiceConnection voiceServiceConnection;
19 | public async void Run(IBackgroundTaskInstance taskInstance)
20 | {
21 | serviceDeferral = taskInstance.GetDeferral();
22 | taskInstance.Canceled += OnTaskCanceled;
23 | var triggerDetails = taskInstance.TriggerDetails as AppServiceTriggerDetails;
24 | // This should match the uap:AppService and VoiceCommandService references from the
25 | // package manifest and VCD files, respectively. Make sure we've been launched by
26 | // a Cortana Voice Command.
27 | if (triggerDetails != null && triggerDetails.Name == "Cortana")
28 | {
29 | try
30 | {
31 | voiceServiceConnection = VoiceCommandServiceConnection.FromAppServiceTriggerDetails(triggerDetails);
32 | voiceServiceConnection.VoiceCommandCompleted += OnVoiceCommandCompleted;
33 | // GetVoiceCommandAsync establishes initial connection to Cortana, and must // be called prior to any
34 | // messages sent to Cortana. Attempting to use // ReportSuccessAsync, ReportProgressAsync, etc
35 | // prior to calling this will produce undefined behavior.
36 | var voiceCommand = await voiceServiceConnection.GetVoiceCommandAsync();
37 | var text = voiceCommand.SpeechRecognitionResult.Text;
38 | var loc = await Geolocator.RequestAccessAsync();
39 | if (loc == GeolocationAccessStatus.Allowed)
40 | {
41 | Geolocator geolocator = new Geolocator();
42 | var myloc = await geolocator.GetGeopositionAsync();
43 | RespondTouser("Here is your location", myloc.Coordinate.Point);
44 | }
45 | else
46 | {
47 | RespondTouser("I can't access to your location! Where are you?");
48 | }
49 | }
50 | catch { }
51 | }
52 | }
53 | private async void RespondTouser(string text, Geopoint point = null)
54 | {
55 | var userMessage = new VoiceCommandUserMessage();
56 | string keepingTripToDestination = text; //How can i Help you?
57 | userMessage.DisplayMessage = userMessage.SpokenMessage = keepingTripToDestination;
58 | var destinationsContentTiles = new List();
59 |
60 | var destinationTile = new VoiceCommandContentTile();
61 | destinationTile.ContentTileType = VoiceCommandContentTileType.TitleWith280x140IconAndText;
62 | if (point != null)
63 | {
64 | destinationTile.Title = await GeocodeHelper.GetAddress(point);
65 | userMessage.SpokenMessage = "Seems you are here, " + destinationTile.Title;
66 | try
67 | {
68 | var http = new HttpClient();
69 | var httpres = await http.GetAsync(new Uri($"https://maps.googleapis.com/maps/api/staticmap?center={point.Position.Latitude},{point.Position.Longitude}&zoom=16&size=560x280&markers=Red|label:G|{point.Position.Latitude},{point.Position.Longitude}", UriKind.RelativeOrAbsolute));
70 | var buf = await httpres.Content.ReadAsBufferAsync();
71 | var f = await ApplicationData.Current.LocalFolder.CreateFileAsync("CortanaResp.png", CreationCollisionOption.OpenIfExists);
72 | var fread = await f.OpenAsync(FileAccessMode.ReadWrite);
73 | await fread.WriteAsync(buf);
74 | fread.Dispose();
75 | destinationTile.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appdata:///local/CortanaResp.png", UriKind.RelativeOrAbsolute));
76 | }
77 | catch
78 | {
79 | destinationTile.Title = text;
80 | destinationTile.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/SplashScreen.scale-200.png", UriKind.RelativeOrAbsolute));
81 | }
82 | }
83 | else
84 | {
85 | destinationTile.Title = text;
86 | destinationTile.Image = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/SplashScreen.scale-200.png", UriKind.RelativeOrAbsolute));
87 | }
88 | destinationsContentTiles.Add(destinationTile);
89 |
90 | VoiceCommandResponse response = VoiceCommandResponse.CreateResponse(userMessage, destinationsContentTiles);
91 | await voiceServiceConnection.ReportSuccessAsync(response);
92 | }
93 | private void OnVoiceCommandCompleted(VoiceCommandServiceConnection sender, VoiceCommandCompletedEventArgs args)
94 | {
95 | if (this.serviceDeferral != null)
96 | {
97 | this.serviceDeferral.Complete();
98 | }
99 | }
100 | private void OnTaskCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
101 | {
102 | if (this.serviceDeferral != null)
103 | {
104 | this.serviceDeferral.Complete();
105 | }
106 | }
107 | }
108 | class GeocodeHelper
109 | {
110 | public static async Task GetAddress(Geopoint cn)
111 | {
112 | try
113 | {
114 | var http = new HttpClient();
115 | var r = await http.GetStringAsync(new Uri($"https://maps.googleapis.com/maps/api/geocode/json?latlng={cn.Position.Latitude},{cn.Position.Longitude}&sensor=false&language=en-us&key=AIzaSyCS5gpejHZIpgK7StAfFCcTqZ8cQsuHVnw", UriKind.RelativeOrAbsolute));
116 | var res = JsonConvert.DeserializeObject(r);
117 | return res.results.FirstOrDefault().formatted_address;
118 | }
119 | catch { return "Earth :D"; }
120 | }
121 | public class Rootobject
122 | {
123 | public Result[] results { get; set; }
124 | public string status { get; set; }
125 | }
126 |
127 | public class Result
128 | {
129 | public Address_Components[] address_components { get; set; }
130 | public string formatted_address { get; set; }
131 | public Geometry geometry { get; set; }
132 | public string place_id { get; set; }
133 | public string[] types { get; set; }
134 | }
135 |
136 | public class Geometry
137 | {
138 | public Location location { get; set; }
139 | public string location_type { get; set; }
140 | public Viewport viewport { get; set; }
141 | public Bounds bounds { get; set; }
142 | }
143 |
144 | public class Location
145 | {
146 | public float lat { get; set; }
147 | public float lng { get; set; }
148 | }
149 |
150 | public class Viewport
151 | {
152 | public Northeast northeast { get; set; }
153 | public Southwest southwest { get; set; }
154 | }
155 |
156 | public class Northeast
157 | {
158 | public float lat { get; set; }
159 | public float lng { get; set; }
160 | }
161 |
162 | public class Southwest
163 | {
164 | public float lat { get; set; }
165 | public float lng { get; set; }
166 | }
167 |
168 | public class Bounds
169 | {
170 | public Northeast1 northeast { get; set; }
171 | public Southwest1 southwest { get; set; }
172 | }
173 |
174 | public class Northeast1
175 | {
176 | public float lat { get; set; }
177 | public float lng { get; set; }
178 | }
179 |
180 | public class Southwest1
181 | {
182 | public float lat { get; set; }
183 | public float lng { get; set; }
184 | }
185 |
186 | public class Address_Components
187 | {
188 | public string long_name { get; set; }
189 | public string short_name { get; set; }
190 | public string[] types { get; set; }
191 | }
192 |
193 | }
194 | }
--------------------------------------------------------------------------------
/WinGoService/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("WinGoService")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("WinGoService")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/WinGoService/WinGoService.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {DF428A8C-75D3-4551-9636-0AE8CB1A0FAD}
8 | winmdobj
9 | Properties
10 | WinGoService
11 | WinGoService
12 | en-US
13 | UAP
14 | 10.0.17134.0
15 | 10.0.14393.0
16 | 14
17 | 512
18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
19 | false
20 |
21 |
22 | AnyCPU
23 | true
24 | full
25 | false
26 | bin\Debug\
27 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
28 | prompt
29 | 4
30 |
31 |
32 | AnyCPU
33 | pdbonly
34 | true
35 | bin\Release\
36 | TRACE;NETFX_CORE;WINDOWS_UWP
37 | prompt
38 | 4
39 |
40 |
41 | x86
42 | true
43 | bin\x86\Debug\
44 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
45 | ;2008
46 | full
47 | x86
48 | false
49 | prompt
50 |
51 |
52 | x86
53 | bin\x86\Release\
54 | TRACE;NETFX_CORE;WINDOWS_UWP
55 | true
56 | ;2008
57 | pdbonly
58 | x86
59 | false
60 | prompt
61 |
62 |
63 | ARM
64 | true
65 | bin\ARM\Debug\
66 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
67 | ;2008
68 | full
69 | ARM
70 | false
71 | prompt
72 |
73 |
74 | ARM
75 | bin\ARM\Release\
76 | TRACE;NETFX_CORE;WINDOWS_UWP
77 | true
78 | ;2008
79 | pdbonly
80 | ARM
81 | false
82 | prompt
83 |
84 |
85 | x64
86 | true
87 | bin\x64\Debug\
88 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
89 | ;2008
90 | full
91 | x64
92 | false
93 | prompt
94 |
95 |
96 | x64
97 | bin\x64\Release\
98 | TRACE;NETFX_CORE;WINDOWS_UWP
99 | true
100 | ;2008
101 | pdbonly
102 | x64
103 | false
104 | prompt
105 |
106 |
107 | PackageReference
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | 6.1.5
116 |
117 |
118 | 11.0.2
119 |
120 |
121 |
122 | 14.0
123 |
124 |
125 |
132 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
Wingo Maps
7 |
8 |
9 | WinGo Maps is an UNOFFICIAL Google Map client for Universal Windows Platform.
10 |
11 | Download
12 | ·
13 | Insiders Group
14 | ·
15 | Gmaps SDK
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | ## Features
24 |
25 | - Show and Download Google Maps Tiles in UWP map control
26 | - Offline map download (+Backup/Restore)
27 | - Switch between online and offline maps dynamically
28 | - Find directions and navigation
29 | - Voice Navigation
30 | - GeoCoding (Converting latitude and longitude to address)
31 | - Reverse GeoCoding (Converting Address to latitude and longitude)
32 | - Search (Nearby / Text / Place Auto Complete)
33 | - Place details, Rate and Reviews, Images and etc.
34 | - Save Favorite places (+Sync between devices)
35 | - Cortana Integration
36 | - Live Tile
37 | - Multilingual support (Arabic, Belarusian, English, German, Itlian, Persian, Portuguese (Brazil) and more)
38 | - Fluent design
39 |
40 | ### Screenshots
41 |
42 | 
43 |
44 | 
45 |
46 | 
47 |
48 | ## Getting started with the source code
49 |
50 | ### Prerequisites
51 |
52 | 1. Windows 10
53 | 2. Visual Studio 2017 (latest build) with universal windows development features installed.
54 | 3. GIT for Windows ([install from here](http://gitforwindows.org/))
55 |
56 | ### Build and running the code
57 |
58 | 1. Clone the repository.
59 | 2. Open the solution in Visual Studio.
60 | 3. Right click on the solution file in Visual Studio solution explorer and add a new Class called `AppCore.cs`
61 | Then write this code in this class based on your *Google API information*:
62 |
63 | ```csharp
64 | using WinGoMapsX.ViewModel.SettingsView;
65 | using Windows.ApplicationModel.Store;
66 | using Windows.UI.Core;
67 | using Windows.Web.Http;
68 |
69 | public class AppCore
70 | {
71 | public static string ArianaAPIKey { get => "ArianaAPIKey"; }
72 | private static CoreDispatcher _dispatch;
73 | public static CoreDispatcher Dispatcher
74 | {
75 | get
76 | {
77 | if (_dispatch != null) return _dispatch;
78 | else
79 | {
80 | _dispatch = CoreWindow.GetForCurrentThread().Dispatcher;
81 | return _dispatch;
82 | }
83 | }
84 | }
85 | private static HttpClient _http;
86 | public static HttpClient HttpClient { get { if (_http != null) return _http; else { _http = new HttpClient(); return _http; } } }
87 | public static string OnMapLanguage { get; set; }
88 | public static string GoogleMapRequestsLanguage { get; set; }
89 | public static string GoogleMapAPIKey { get; private set; }
90 | public static string HttpUserAgent { get; private set; }
91 | static AppCore()
92 | {
93 | HttpUserAgent = "MahStudioWinGoMapsX";
94 | GoogleMapAPIKey = "YouGMapsAPIKey";
95 | GoogleMapRequestsLanguage = LanguageSettingsSetters.GetAPILanguage();
96 | OnMapLanguage = LanguageSettingsSetters.GetOnMapLanguage();
97 | }
98 | }
99 | ```
100 |
101 | 4. Now hit **F5** and run the project :)
102 |
103 | ## Contributing
104 |
105 | We are always welcome to your help. You can join our [Telegram Insiders Group](https://t.me/joinchat/DQwGRhG-DXgBJNDWjGEoZQ) to help us developing and testing this app. Also you can [post issues and feature requests](https://github.com/MahStudio/WinGo-Maps/issues) and help us in development via sending pull requests.
106 |
107 | ### Authors
108 |
109 | This project is designed, developed, maintained and supported by the community software development team [**Mah Studio**](https://github.com/MahStudio/).
110 | See also the list of [contributors](https://github.com/MahStudio/WinGo-Maps/contributors) who participated in this project.
111 |
--------------------------------------------------------------------------------