├── .gitignore
├── LICENSE
├── README.md
├── app
├── .npmignore
├── App_Resources
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── app.gradle
│ │ ├── drawable-hdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-ldpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-mdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-nodpi
│ │ │ └── splash_screen.xml
│ │ ├── drawable-xhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-xxhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── drawable-xxxhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ ├── values-v21
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── nativescript_google_maps_api.xml
│ │ │ └── styles.xml
│ └── iOS
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── icon-29.png
│ │ │ ├── icon-29@2x.png
│ │ │ ├── icon-29@3x.png
│ │ │ ├── icon-40.png
│ │ │ ├── icon-40@2x.png
│ │ │ ├── icon-40@3x.png
│ │ │ ├── icon-50.png
│ │ │ ├── icon-50@2x.png
│ │ │ ├── icon-57.png
│ │ │ ├── icon-57@2x.png
│ │ │ ├── icon-60@2x.png
│ │ │ ├── icon-60@3x.png
│ │ │ ├── icon-72.png
│ │ │ ├── icon-72@2x.png
│ │ │ ├── icon-76.png
│ │ │ ├── icon-76@2x.png
│ │ │ └── icon-83.5@2x.png
│ │ ├── Contents.json
│ │ ├── LaunchImage.launchimage
│ │ │ ├── Contents.json
│ │ │ ├── Default-568h@2x.png
│ │ │ ├── Default-667h@2x.png
│ │ │ ├── Default-736h@3x.png
│ │ │ ├── Default-Landscape.png
│ │ │ ├── Default-Landscape@2x.png
│ │ │ ├── Default-Landscape@3x.png
│ │ │ ├── Default-Portrait.png
│ │ │ ├── Default-Portrait@2x.png
│ │ │ ├── Default.png
│ │ │ └── Default@2x.png
│ │ ├── LaunchScreen.AspectFill.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchScreen-AspectFill.png
│ │ │ └── LaunchScreen-AspectFill@2x.png
│ │ └── LaunchScreen.Center.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchScreen-Center.png
│ │ │ └── LaunchScreen-Center@2x.png
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ ├── build.xcconfig
│ │ └── icon.png
├── LICENSE
├── app.component.ts
├── app.css
├── app.routes.ts
├── main.ts
├── package.json
└── pages
│ └── map
│ ├── map-style.json
│ ├── map.component.ts
│ ├── map.css
│ └── map.html
├── hooks
├── before-livesync
│ └── nativescript-angular-sync.js
├── before-prepare
│ └── nativescript-dev-typescript.js
└── before-watch
│ └── nativescript-dev-typescript.js
├── package.json
├── references.d.ts
├── screenshot1.png
├── screenshot2.png
└── tsconfig.json
/.gitignore:
--------------------------------------------------------------------------------
1 | nativescript-angular*.tgz
2 | bin/dist
3 | node_modules
4 | platforms
5 | tags
6 | src/nativescript-angular/**/*.js
7 | !src/nativescript-angular/postinstall.js
8 | !src/nativescript-angular/hooks/**/*.js
9 | .baseDir.ts
10 | .tscache
11 | .nvm
12 | .vscode
13 | .DS_Store
14 | .idea/
15 | lib/
16 | nativescript-angular*.tgz
17 |
18 | tests/app/**/*.js
19 | tests/test-output.txt
20 | tests/platforms
21 | tests/lib
22 | tests/node_modules
23 |
24 | app/**/*.js
25 | app/**/*.js.map
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Nick Coury
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # nativescript-maps-app
2 | Simple Nativescript + Angular 2 + Typescript App
3 |
4 | This project demonstrates how to use Nativescript with Angular 2 and Typescript, along with the Google Maps API natively.
5 |
6 |
7 |
8 |
9 | ## Quick Start
10 | Pull down the project.
11 |
12 | Register for a Google Maps API key in the [Google Developers Console](https://console.developers.google.com).
13 |
14 | For Android, add the key to `app/App_Resources/Android/values/nativescript_google_maps_api.xml`.
15 | For IOS, add the key to `app/app.component.ts`.
16 |
17 | Run the appropriate command(s) from the terminal in the project folder
18 | ```
19 | tns run ios
20 | ```
21 | ```
22 | tns run android
23 | ```
24 |
25 | ## Features
26 | 1. Google Maps natively integrated.
27 | 2. Geolocation draws your path on the map as you travel.
28 | 3. Draw a route by touching points on the map.
29 | 4. Includes Telerik-UI side drawer.
30 | 5. Nativescript + Angular2 + Typescript
31 | 6. Uses Google Maps styling.
32 |
33 | ## Styling
34 |
35 | Change map style in `app/pages/map/map-style.json`.
36 |
37 | For map styles, see [Google Maps Style Reference](https://developers.google.com/maps/documentation/android-api/style-reference) and the [Styling Wizard](https://mapstyle.withgoogle.com/).
38 |
39 | Special thanks to [dapriett](https://github.com/dapriett) and [Telerik](http://nativescript.org/)
--------------------------------------------------------------------------------
/app/.npmignore:
--------------------------------------------------------------------------------
1 | LICENSE.md
2 | node_modules
3 | built
4 | tags
5 | typings
6 | .baseDir.ts
7 | .tscache
8 |
9 | app/**/*.js
10 | app/**/*.map
11 | platforms
12 | lib
13 |
14 | *.tgz
15 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // compile 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | android {
9 | defaultConfig {
10 | generatedDensities = []
11 | applicationId = "org.nativescript.nativescriptmapsapp"
12 | }
13 | aaptOptions {
14 | additionalParameters "--no-version-vectors"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/Android/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/app/App_Resources/Android/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/values/nativescript_google_maps_api.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | AIzaSyDkrjV75jYzVIS04mc91F_DIDN1VpWtzjA
4 |
--------------------------------------------------------------------------------
/app/App_Resources/Android/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "29x29",
5 | "idiom" : "iphone",
6 | "filename" : "icon-29.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "29x29",
11 | "idiom" : "iphone",
12 | "filename" : "icon-29@2x.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29@3x.png",
19 | "scale" : "3x"
20 | },
21 | {
22 | "size" : "40x40",
23 | "idiom" : "iphone",
24 | "filename" : "icon-40@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "icon-40@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "57x57",
35 | "idiom" : "iphone",
36 | "filename" : "icon-57.png",
37 | "scale" : "1x"
38 | },
39 | {
40 | "size" : "57x57",
41 | "idiom" : "iphone",
42 | "filename" : "icon-57@2x.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "icon-60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "icon-60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "29x29",
59 | "idiom" : "ipad",
60 | "filename" : "icon-29.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "29x29",
65 | "idiom" : "ipad",
66 | "filename" : "icon-29@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "40x40",
71 | "idiom" : "ipad",
72 | "filename" : "icon-40.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "40x40",
77 | "idiom" : "ipad",
78 | "filename" : "icon-40@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "50x50",
83 | "idiom" : "ipad",
84 | "filename" : "icon-50.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "50x50",
89 | "idiom" : "ipad",
90 | "filename" : "icon-50@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "72x72",
95 | "idiom" : "ipad",
96 | "filename" : "icon-72.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "72x72",
101 | "idiom" : "ipad",
102 | "filename" : "icon-72@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "76x76",
107 | "idiom" : "ipad",
108 | "filename" : "icon-76.png",
109 | "scale" : "1x"
110 | },
111 | {
112 | "size" : "76x76",
113 | "idiom" : "ipad",
114 | "filename" : "icon-76@2x.png",
115 | "scale" : "2x"
116 | },
117 | {
118 | "size" : "83.5x83.5",
119 | "idiom" : "ipad",
120 | "filename" : "icon-83.5@2x.png",
121 | "scale" : "2x"
122 | }
123 | ],
124 | "info" : {
125 | "version" : 1,
126 | "author" : "xcode"
127 | }
128 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "extent" : "full-screen",
5 | "idiom" : "iphone",
6 | "subtype" : "736h",
7 | "filename" : "Default-736h@3x.png",
8 | "minimum-system-version" : "8.0",
9 | "orientation" : "portrait",
10 | "scale" : "3x"
11 | },
12 | {
13 | "extent" : "full-screen",
14 | "idiom" : "iphone",
15 | "subtype" : "736h",
16 | "filename" : "Default-Landscape@3x.png",
17 | "minimum-system-version" : "8.0",
18 | "orientation" : "landscape",
19 | "scale" : "3x"
20 | },
21 | {
22 | "extent" : "full-screen",
23 | "idiom" : "iphone",
24 | "subtype" : "667h",
25 | "filename" : "Default-667h@2x.png",
26 | "minimum-system-version" : "8.0",
27 | "orientation" : "portrait",
28 | "scale" : "2x"
29 | },
30 | {
31 | "orientation" : "portrait",
32 | "idiom" : "iphone",
33 | "filename" : "Default@2x.png",
34 | "extent" : "full-screen",
35 | "minimum-system-version" : "7.0",
36 | "scale" : "2x"
37 | },
38 | {
39 | "extent" : "full-screen",
40 | "idiom" : "iphone",
41 | "subtype" : "retina4",
42 | "filename" : "Default-568h@2x.png",
43 | "minimum-system-version" : "7.0",
44 | "orientation" : "portrait",
45 | "scale" : "2x"
46 | },
47 | {
48 | "orientation" : "portrait",
49 | "idiom" : "ipad",
50 | "filename" : "Default-Portrait.png",
51 | "extent" : "full-screen",
52 | "minimum-system-version" : "7.0",
53 | "scale" : "1x"
54 | },
55 | {
56 | "orientation" : "landscape",
57 | "idiom" : "ipad",
58 | "filename" : "Default-Landscape.png",
59 | "extent" : "full-screen",
60 | "minimum-system-version" : "7.0",
61 | "scale" : "1x"
62 | },
63 | {
64 | "orientation" : "portrait",
65 | "idiom" : "ipad",
66 | "filename" : "Default-Portrait@2x.png",
67 | "extent" : "full-screen",
68 | "minimum-system-version" : "7.0",
69 | "scale" : "2x"
70 | },
71 | {
72 | "orientation" : "landscape",
73 | "idiom" : "ipad",
74 | "filename" : "Default-Landscape@2x.png",
75 | "extent" : "full-screen",
76 | "minimum-system-version" : "7.0",
77 | "scale" : "2x"
78 | },
79 | {
80 | "orientation" : "portrait",
81 | "idiom" : "iphone",
82 | "filename" : "Default.png",
83 | "extent" : "full-screen",
84 | "scale" : "1x"
85 | },
86 | {
87 | "orientation" : "portrait",
88 | "idiom" : "iphone",
89 | "filename" : "Default@2x.png",
90 | "extent" : "full-screen",
91 | "scale" : "2x"
92 | },
93 | {
94 | "orientation" : "portrait",
95 | "idiom" : "iphone",
96 | "filename" : "Default-568h@2x.png",
97 | "extent" : "full-screen",
98 | "subtype" : "retina4",
99 | "scale" : "2x"
100 | },
101 | {
102 | "orientation" : "portrait",
103 | "idiom" : "ipad",
104 | "extent" : "to-status-bar",
105 | "scale" : "1x"
106 | },
107 | {
108 | "orientation" : "portrait",
109 | "idiom" : "ipad",
110 | "filename" : "Default-Portrait.png",
111 | "extent" : "full-screen",
112 | "scale" : "1x"
113 | },
114 | {
115 | "orientation" : "landscape",
116 | "idiom" : "ipad",
117 | "extent" : "to-status-bar",
118 | "scale" : "1x"
119 | },
120 | {
121 | "orientation" : "landscape",
122 | "idiom" : "ipad",
123 | "filename" : "Default-Landscape.png",
124 | "extent" : "full-screen",
125 | "scale" : "1x"
126 | },
127 | {
128 | "orientation" : "portrait",
129 | "idiom" : "ipad",
130 | "extent" : "to-status-bar",
131 | "scale" : "2x"
132 | },
133 | {
134 | "orientation" : "portrait",
135 | "idiom" : "ipad",
136 | "filename" : "Default-Portrait@2x.png",
137 | "extent" : "full-screen",
138 | "scale" : "2x"
139 | },
140 | {
141 | "orientation" : "landscape",
142 | "idiom" : "ipad",
143 | "extent" : "to-status-bar",
144 | "scale" : "2x"
145 | },
146 | {
147 | "orientation" : "landscape",
148 | "idiom" : "ipad",
149 | "filename" : "Default-Landscape@2x.png",
150 | "extent" : "full-screen",
151 | "scale" : "2x"
152 | }
153 | ],
154 | "info" : {
155 | "version" : 1,
156 | "author" : "xcode"
157 | }
158 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-AspectFill.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-AspectFill@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-Center.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-Center@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/app/App_Resources/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiresFullScreen
28 |
29 | UIRequiredDeviceCapabilities
30 |
31 | location-services
32 | gps
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 | NSLocationWhenInUseUsageDescription
49 | Uses GPS to display location on a map.
50 |
51 |
52 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
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 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/build.xcconfig:
--------------------------------------------------------------------------------
1 | // You can add custom settings here
2 | // for example you can uncomment the following line to force distribution code signing
3 | // CODE_SIGN_IDENTITY = iPhone Distribution
4 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
5 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
6 |
--------------------------------------------------------------------------------
/app/App_Resources/iOS/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/app/App_Resources/iOS/icon.png
--------------------------------------------------------------------------------
/app/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Nick Coury
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from "@angular/core";
2 | import { Routes } from '@angular/router';
3 |
4 | @Component({
5 | selector: "app",
6 | template: ""
7 | })
8 | export class AppComponent {
9 |
10 | }
--------------------------------------------------------------------------------
/app/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/app.routes.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from "@angular/router";
2 | import { MapComponent } from "./pages/map/map.component";
3 |
4 | export const APP_ROUTES: Routes = [
5 | { path: "", redirectTo: "map", pathMatch: 'full' },
6 | { path: "map", component: MapComponent, pathMatch: 'full' },
7 | ];
8 |
--------------------------------------------------------------------------------
/app/main.ts:
--------------------------------------------------------------------------------
1 | // this import should be first in order to load some required settings (like globals and reflect-metadata)
2 | import { platformNativeScriptDynamic, NativeScriptModule } from "nativescript-angular/platform";
3 | var application = require("application");
4 |
5 | // Angular
6 | import { NgModule } from "@angular/core";
7 | import { NativeScriptRouterModule } from "nativescript-angular/router";
8 | import { APP_ROUTES } from "./app.routes"
9 |
10 | // App Components
11 | import { SIDEDRAWER_DIRECTIVES } from "nativescript-telerik-ui/sidedrawer/angular";
12 | import { AppComponent } from "./app.component";
13 | import { MapComponent } from "./pages/map/map.component";
14 |
15 | // iOS Google Maps API Key Setup
16 | declare var GMSServices: any;
17 | if(application.ios) {
18 | GMSServices.provideAPIKey("AIzaSyCCbRydI84FEFapTzFo5qtGCv5i6NGuQgE");
19 | }
20 |
21 | @NgModule({
22 | bootstrap: [
23 | AppComponent
24 | ],
25 | declarations: [
26 | SIDEDRAWER_DIRECTIVES,
27 | AppComponent,
28 | MapComponent
29 | ],
30 | imports: [
31 | NativeScriptModule,
32 | NativeScriptRouterModule,
33 | NativeScriptRouterModule.forRoot(APP_ROUTES)
34 | ],
35 | })
36 | class AppComponentModule {}
37 |
38 | platformNativeScriptDynamic().bootstrapModule(AppComponentModule);
39 |
--------------------------------------------------------------------------------
/app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": false,
3 | "nativescript": {
4 | "id": "org.nativescript.nativescriptmapsapp"
5 | },
6 | "name": "nativescript-maps-app",
7 | "main": "main.js",
8 | "version": "0.0.5",
9 | "author": "Nick Coury ",
10 | "description": "Nativescript Angular Google Maps App",
11 | "license": "MIT",
12 | "keywords": [
13 | "telerik",
14 | "mobile",
15 | "angular",
16 | "nativescript",
17 | "{N}",
18 | "tns",
19 | "appbuilder",
20 | "template",
21 | "google",
22 | "maps",
23 | "typescript"
24 | ],
25 | "repository": {
26 | "type": "git",
27 | "url": "git://github.com/nickcoury/nativescript-maps-app.git"
28 | },
29 | "homepage": "https://github.com/nickcoury/nativescript-maps-app",
30 | "android": {
31 | "v8Flags": "--expose_gc"
32 | },
33 | "dependencies": {
34 | "nativescript-angular": "1.0.0",
35 | "@angular/core": "2.0.0",
36 | "@angular/common": "2.0.0",
37 | "@angular/compiler": "2.0.0",
38 | "@angular/http": "2.0.0",
39 | "@angular/platform-browser": "2.0.0",
40 | "@angular/platform-browser-dynamic": "2.0.0",
41 | "@angular/platform-server": "2.0.0",
42 | "@angular/forms": "2.0.0",
43 | "@angular/router": "3.0.0",
44 | "reflect-metadata": "^0.1.8"
45 | },
46 | "devDependencies": {
47 | "zone.js": "^0.6.21",
48 | "nativescript-dev-typescript": "^0.3.2"
49 | }
50 | }
--------------------------------------------------------------------------------
/app/pages/map/map-style.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "elementType": "geometry",
4 | "stylers": [
5 | {
6 | "color": "#212121"
7 | }
8 | ]
9 | },
10 | {
11 | "elementType": "labels.icon",
12 | "stylers": [
13 | {
14 | "visibility": "off"
15 | }
16 | ]
17 | },
18 | {
19 | "elementType": "labels.text.fill",
20 | "stylers": [
21 | {
22 | "color": "#757575"
23 | }
24 | ]
25 | },
26 | {
27 | "elementType": "labels.text.stroke",
28 | "stylers": [
29 | {
30 | "color": "#212121"
31 | }
32 | ]
33 | },
34 | {
35 | "featureType": "administrative",
36 | "elementType": "geometry",
37 | "stylers": [
38 | {
39 | "color": "#757575"
40 | }
41 | ]
42 | },
43 | {
44 | "featureType": "administrative.country",
45 | "elementType": "labels.text.fill",
46 | "stylers": [
47 | {
48 | "color": "#9e9e9e"
49 | }
50 | ]
51 | },
52 | {
53 | "featureType": "administrative.land_parcel",
54 | "stylers": [
55 | {
56 | "visibility": "off"
57 | }
58 | ]
59 | },
60 | {
61 | "featureType": "administrative.locality",
62 | "elementType": "labels.text.fill",
63 | "stylers": [
64 | {
65 | "color": "#bdbdbd"
66 | }
67 | ]
68 | },
69 | {
70 | "featureType": "poi",
71 | "elementType": "labels.text.fill",
72 | "stylers": [
73 | {
74 | "color": "#757575"
75 | }
76 | ]
77 | },
78 | {
79 | "featureType": "poi.park",
80 | "elementType": "geometry",
81 | "stylers": [
82 | {
83 | "color": "#181818"
84 | }
85 | ]
86 | },
87 | {
88 | "featureType": "poi.park",
89 | "elementType": "labels.text.fill",
90 | "stylers": [
91 | {
92 | "color": "#616161"
93 | }
94 | ]
95 | },
96 | {
97 | "featureType": "poi.park",
98 | "elementType": "labels.text.stroke",
99 | "stylers": [
100 | {
101 | "color": "#1b1b1b"
102 | }
103 | ]
104 | },
105 | {
106 | "featureType": "road",
107 | "elementType": "geometry.fill",
108 | "stylers": [
109 | {
110 | "color": "#2c2c2c"
111 | }
112 | ]
113 | },
114 | {
115 | "featureType": "road",
116 | "elementType": "labels.text.fill",
117 | "stylers": [
118 | {
119 | "color": "#8a8a8a"
120 | }
121 | ]
122 | },
123 | {
124 | "featureType": "road.arterial",
125 | "elementType": "geometry",
126 | "stylers": [
127 | {
128 | "color": "#373737"
129 | }
130 | ]
131 | },
132 | {
133 | "featureType": "road.highway",
134 | "elementType": "geometry",
135 | "stylers": [
136 | {
137 | "color": "#3c3c3c"
138 | }
139 | ]
140 | },
141 | {
142 | "featureType": "road.highway.controlled_access",
143 | "elementType": "geometry",
144 | "stylers": [
145 | {
146 | "color": "#4e4e4e"
147 | }
148 | ]
149 | },
150 | {
151 | "featureType": "road.local",
152 | "elementType": "labels.text.fill",
153 | "stylers": [
154 | {
155 | "color": "#616161"
156 | }
157 | ]
158 | },
159 | {
160 | "featureType": "transit",
161 | "elementType": "labels.text.fill",
162 | "stylers": [
163 | {
164 | "color": "#757575"
165 | }
166 | ]
167 | },
168 | {
169 | "featureType": "water",
170 | "elementType": "geometry",
171 | "stylers": [
172 | {
173 | "color": "#000000"
174 | }
175 | ]
176 | },
177 | {
178 | "featureType": "water",
179 | "elementType": "labels.text.fill",
180 | "stylers": [
181 | {
182 | "color": "#3d3d3d"
183 | }
184 | ]
185 | }
186 | ]
--------------------------------------------------------------------------------
/app/pages/map/map.component.ts:
--------------------------------------------------------------------------------
1 | import {Component, ViewChild, AfterViewInit} from '@angular/core';
2 | import {registerElement} from 'nativescript-angular/element-registry';
3 | let geolocation = require('nativescript-geolocation');
4 | import {MapView, Marker, Polyline, Position} from 'nativescript-google-maps-sdk';
5 | import sideDrawerModule = require('nativescript-telerik-ui/sidedrawer');
6 | import {RadSideDrawerComponent, SideDrawerType} from 'nativescript-telerik-ui/sidedrawer/angular';
7 | var style = require('./map-style.json');
8 |
9 | import {Color} from 'color';
10 |
11 | console.log('Registering MapView');
12 | registerElement('MapView', () => MapView);
13 |
14 | @Component({
15 | moduleId: module.id,
16 | selector: 'map',
17 | templateUrl: 'map.html',
18 | styleUrls: ['map.css'],
19 | })
20 | export class MapComponent implements AfterViewInit {
21 | mapView:any = null;
22 | watchId:number = null;
23 | gpsLine:Polyline;
24 | tapLine:Polyline;
25 | tapMarker:any;
26 | gpsMarker:any;
27 | centeredOnLocation:boolean = false;
28 |
29 | constructor() {
30 | }
31 |
32 | @ViewChild(RadSideDrawerComponent) public drawerComponent: RadSideDrawerComponent;
33 | private drawer: SideDrawerType;
34 |
35 | ngAfterViewInit() {
36 | this.drawer = this.drawerComponent.sideDrawer;
37 | }
38 |
39 | openDrawer(){
40 | this.drawer.showDrawer();
41 | }
42 |
43 | closeDrawer(){
44 | this.drawer.closeDrawer();
45 | }
46 |
47 | enableLocation() {
48 | if (!geolocation.isEnabled()) {
49 | console.log('Location not enabled, requesting.');
50 | return geolocation.enableLocationRequest();
51 | } else {
52 | return Promise.resolve(true);
53 | }
54 | }
55 |
56 | getLocation() {
57 | if (geolocation.isEnabled()) {
58 | return geolocation.getCurrentLocation({
59 | desiredAccuracy: 10,
60 | updateDistance: 10,
61 | minimumUpdateTime: 1000,
62 | maximumAge: 10000
63 | })
64 | }
65 | return Promise.reject('Geolocation not enabled.');
66 | }
67 |
68 | //Map events
69 | onMapReady(event) {
70 | console.log('Map Ready');
71 | if (this.mapView || !event.object) return;
72 |
73 | this.mapView = event.object;
74 |
75 | this.mapView.setStyle(style);
76 |
77 | this.mapView.markerSelect = this.onMarkerSelect;
78 | this.mapView.cameraChanged = this.onCameraChanged;
79 |
80 | this.enableLocation()
81 | .then(this.getLocation)
82 | .then(() => {
83 | this.watchId = geolocation.watchLocation(this.locationReceived, this.error, {
84 | desiredAccuracy: 10,
85 | updateDistance: 10,
86 | minimumUpdateTime: 10000,
87 | maximumAge: 60000
88 | });
89 | }, this.error);
90 | };
91 |
92 | mapTapped = (event) => {
93 | console.log('Map Tapped');
94 |
95 | this.tapLine = this.addPointToLine({
96 | color: new Color('Red'),
97 | line: this.tapLine,
98 | location: event.position,
99 | geodesic: true,
100 | width: 10
101 | });
102 |
103 | this.removeMarker(this.tapMarker);
104 | this.tapMarker = this.addMarker({
105 | location: event.position,
106 | title: 'Tap Location'
107 | });
108 | };
109 |
110 | locationReceived = (position:Position) => {
111 | console.log('GPS Update Received');
112 |
113 | if (this.mapView && position && !this.centeredOnLocation) {
114 | this.mapView.latitude = position.latitude;
115 | this.mapView.longitude = position.longitude;
116 | this.mapView.zoom = 16;
117 | this.centeredOnLocation = true;
118 | }
119 |
120 | this.gpsLine = this.addPointToLine({
121 | color: new Color('Green'),
122 | line: this.gpsLine,
123 | location: position,
124 | geodesic: true,
125 | width: 10
126 | });
127 |
128 | this.removeMarker(this.gpsMarker);
129 | this.gpsMarker = this.addMarker({
130 | location: position,
131 | title: 'GPS Location'
132 | });
133 | };
134 |
135 | addPointToLine(args:AddLineArgs) {
136 | if (!this.mapView || !args || !args.location) return;
137 |
138 | let line = args.line;
139 |
140 | if (!line) {
141 | line = new Polyline();
142 | line.visible = true;
143 | line.width = args.width || 10;
144 | line.color = args.color || new Color('Red');
145 | line.geodesic = args.geodesic != undefined ? args.geodesic : true;
146 | this.mapView.addPolyline(line);
147 | }
148 | line.addPoint(Position.positionFromLatLng(args.location.latitude, args.location.longitude));
149 |
150 | return line;
151 | }
152 |
153 | addMarker(args:AddMarkerArgs) {
154 | if (!this.mapView || !args || !args.location) return;
155 |
156 | let marker = new Marker();
157 | marker.position = Position.positionFromLatLng(args.location.latitude, args.location.longitude);
158 | marker.title = args.title;
159 | marker.snippet = args.title;
160 | this.mapView.addMarker(marker);
161 |
162 | return marker;
163 | };
164 |
165 | clearGpsLine() {
166 | this.removeLine(this.gpsLine);
167 | this.gpsLine = null;
168 | this.closeDrawer();
169 | };
170 |
171 | clearTapLine() {
172 | this.removeLine(this.tapLine);
173 | this.tapLine = null;
174 | this.removeMarker(this.tapMarker);
175 | this.tapMarker = null;
176 | this.closeDrawer();
177 | }
178 |
179 | removeLine(line:Polyline) {
180 | if (line) {
181 | line.removeAllPoints();
182 | }
183 | }
184 |
185 | removeMarker(marker:Marker) {
186 | if (this.mapView && marker) {
187 | this.mapView.removeMarker(marker);
188 | }
189 | }
190 |
191 | error(err) {
192 | console.log('Error: ' + JSON.stringify(err));
193 | }
194 |
195 | onMarkerSelect(event) {
196 | console.log('Clicked on ' + event.marker.title);
197 | }
198 |
199 | onCameraChanged(event) {
200 | console.log('Camera changed: ' + JSON.stringify(event.camera));
201 | }
202 | }
203 |
204 | export class AddLineArgs {
205 | public color:Color;
206 | public line:Polyline;
207 | public location:Position;
208 | public geodesic:boolean;
209 | public width:number;
210 | }
211 |
212 | export class AddMarkerArgs {
213 | public location:Position;
214 | public title:string;
215 | }
--------------------------------------------------------------------------------
/app/pages/map/map.css:
--------------------------------------------------------------------------------
1 | RadSideDrawer Label {
2 | color: white;
3 | font-size: 16px;
4 | padding: 10px;
5 | text-align: center;
6 | }
7 |
8 | RadSideDrawer Label.divider {
9 | background-color: white;
10 | width: 90%;
11 | height: 1px;
12 | }
13 |
14 | RadSideDrawer Label.button-divider {
15 | background-color: #004488;
16 | width: 75%;
17 | height: 1px;
18 | }
19 |
20 | RadSideDrawer Label.button {
21 | background-color: none;
22 | color: white;
23 | font-size: 24;
24 | text-align: center;
25 | padding: 10px;
26 | }
27 |
28 | RadSideDrawer StackLayout {
29 | background-color: #0088ff;
30 | }
31 |
32 | RadSideDrawer Image.header-image {
33 | height: 120px;
34 | width: auto;
35 | margin: 20px;
36 | }
37 |
38 | AbsoluteLayout Image.menu-button {
39 | width: 48px;
40 | height: 48px;
41 | }
--------------------------------------------------------------------------------
/app/pages/map/map.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/hooks/before-livesync/nativescript-angular-sync.js:
--------------------------------------------------------------------------------
1 | module.exports = require("nativescript-angular/hooks/before-livesync");
2 |
--------------------------------------------------------------------------------
/hooks/before-prepare/nativescript-dev-typescript.js:
--------------------------------------------------------------------------------
1 | module.exports = require("nativescript-dev-typescript/lib/before-prepare.js");
2 |
--------------------------------------------------------------------------------
/hooks/before-watch/nativescript-dev-typescript.js:
--------------------------------------------------------------------------------
1 | module.exports = require("nativescript-dev-typescript/lib/watch.js");
2 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "Nativescript Maps App",
3 | "license": "SEE LICENSE IN app/LICENSE",
4 | "readme": "README.md",
5 | "repository": "nativescript-maps-app",
6 | "nativescript": {
7 | "id": "org.nativescript.nativescriptmapsapp",
8 | "tns-ios": {
9 | "version": "2.4.0"
10 | },
11 | "tns-android": {
12 | "version": "2.4.1"
13 | }
14 | },
15 | "dependencies": {
16 | "@angular/common": "2.0.0",
17 | "@angular/compiler": "2.0.0",
18 | "@angular/core": "2.0.0",
19 | "@angular/forms": "2.0.0",
20 | "@angular/http": "2.0.0",
21 | "@angular/platform-browser": "2.0.0",
22 | "@angular/platform-browser-dynamic": "2.0.0",
23 | "@angular/platform-server": "2.0.0",
24 | "@angular/router": "3.0.0",
25 | "nativescript-angular": "1.0.0",
26 | "nativescript-geolocation": "0.0.13",
27 | "nativescript-google-maps-sdk": "^1.4.1",
28 | "nativescript-telerik-ui": "1.4.1",
29 | "reflect-metadata": "0.1.8",
30 | "rxjs": "^5.0.0-rc.4",
31 | "tns-core-modules": "^2.4.0"
32 | },
33 | "devDependencies": {
34 | "babel-traverse": "6.15.0",
35 | "babel-types": "6.15.0",
36 | "babylon": "6.11.2",
37 | "lazy": "1.0.11",
38 | "nativescript-dev-typescript": "^0.3.2",
39 | "typescript": "^2.0.3",
40 | "zone.js": "^0.6.21"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/references.d.ts:
--------------------------------------------------------------------------------
1 | /// Needed for autocompletion and compilation.
--------------------------------------------------------------------------------
/screenshot1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/screenshot1.png
--------------------------------------------------------------------------------
/screenshot2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nickcoury/nativescript-maps-app/c20144b5913d68c8c1594825f22791d1000fc43d/screenshot2.png
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "target": "es5",
5 | "sourceMap": true,
6 | "experimentalDecorators": true,
7 | "emitDecoratorMetadata": true,
8 | "noEmitHelpers": true,
9 | "noEmitOnError": true
10 | },
11 | "exclude": [
12 | "node_modules",
13 | "platforms"
14 | ]
15 | }
--------------------------------------------------------------------------------