├── .editorconfig ├── .gitignore ├── README.md ├── bin └── local_dev.sh ├── capture.png ├── config.xml ├── ionic-googlemaps-quickdemo.apk ├── ionic.config.json ├── package.json ├── resources ├── README.md ├── android │ ├── icon │ │ ├── drawable-hdpi-icon.png │ │ ├── drawable-ldpi-icon.png │ │ ├── drawable-mdpi-icon.png │ │ ├── drawable-xhdpi-icon.png │ │ ├── drawable-xxhdpi-icon.png │ │ └── drawable-xxxhdpi-icon.png │ └── splash │ │ ├── drawable-land-hdpi-screen.png │ │ ├── drawable-land-ldpi-screen.png │ │ ├── drawable-land-mdpi-screen.png │ │ ├── drawable-land-xhdpi-screen.png │ │ ├── drawable-land-xxhdpi-screen.png │ │ ├── drawable-land-xxxhdpi-screen.png │ │ ├── drawable-port-hdpi-screen.png │ │ ├── drawable-port-ldpi-screen.png │ │ ├── drawable-port-mdpi-screen.png │ │ ├── drawable-port-xhdpi-screen.png │ │ ├── drawable-port-xxhdpi-screen.png │ │ └── drawable-port-xxxhdpi-screen.png ├── icon.png ├── ios │ ├── icon │ │ ├── icon-1024.png │ │ ├── icon-40.png │ │ ├── icon-40@2x.png │ │ ├── icon-40@3x.png │ │ ├── icon-50.png │ │ ├── icon-50@2x.png │ │ ├── icon-60.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 │ │ ├── icon-small.png │ │ ├── icon-small@2x.png │ │ ├── icon-small@3x.png │ │ ├── icon.png │ │ └── icon@2x.png │ └── splash │ │ ├── Default-568h@2x~iphone.png │ │ ├── Default-667h.png │ │ ├── Default-736h.png │ │ ├── Default-Landscape-736h.png │ │ ├── Default-Landscape@2x~ipad.png │ │ ├── Default-Landscape@~ipadpro.png │ │ ├── Default-Landscape~ipad.png │ │ ├── Default-Portrait@2x~ipad.png │ │ ├── Default-Portrait@~ipadpro.png │ │ ├── Default-Portrait~ipad.png │ │ ├── Default@2x~iphone.png │ │ ├── Default@2x~universal~anyany.png │ │ └── Default~iphone.png └── splash.png ├── src ├── app │ ├── app.component.ts │ ├── app.html │ ├── app.module.ts │ ├── app.scss │ └── main.ts ├── assets │ ├── icon │ │ └── favicon.ico │ ├── imgs │ │ ├── Number-1-icon.png │ │ ├── blue-marker.png │ │ ├── hearst_castle.jpg │ │ ├── logo.png │ │ ├── newark_nj_1922.jpg │ │ └── newark_nj_1922_2.jpg │ ├── kmloverlay │ │ └── polygon.kml │ └── markercluster │ │ ├── large.png │ │ ├── marker.png │ │ └── small.png ├── index.html ├── manifest.json ├── pages │ ├── base-array-class │ │ ├── base-array-class.html │ │ ├── base-array-class.module.ts │ │ ├── base-array-class.scss │ │ └── base-array-class.ts │ ├── circle │ │ ├── circle.html │ │ ├── circle.module.ts │ │ ├── circle.scss │ │ └── circle.ts │ ├── geocoding │ │ ├── geocoding.html │ │ ├── geocoding.module.ts │ │ ├── geocoding.scss │ │ └── geocoding.ts │ ├── ground-overlay │ │ ├── ground-overlay.html │ │ ├── ground-overlay.module.ts │ │ ├── ground-overlay.scss │ │ └── ground-overlay.ts │ ├── home │ │ ├── home.html │ │ ├── home.scss │ │ └── home.ts │ ├── html-info-window │ │ ├── html-info-window.html │ │ ├── html-info-window.module.ts │ │ ├── html-info-window.scss │ │ └── html-info-window.ts │ ├── kml-overlay │ │ ├── kml-overlay.html │ │ ├── kml-overlay.module.ts │ │ ├── kml-overlay.scss │ │ └── kml-overlay.ts │ ├── marker-cluster │ │ ├── marker-cluster.html │ │ ├── marker-cluster.module.ts │ │ ├── marker-cluster.scss │ │ └── marker-cluster.ts │ ├── marker │ │ ├── marker.html │ │ ├── marker.module.ts │ │ ├── marker.scss │ │ └── marker.ts │ ├── polygon │ │ ├── polygon.html │ │ ├── polygon.module.ts │ │ ├── polygon.scss │ │ └── polygon.ts │ ├── polyline │ │ ├── polyline.html │ │ ├── polyline.module.ts │ │ ├── polyline.scss │ │ └── polyline.ts │ ├── street-view │ │ ├── street-view.html │ │ ├── street-view.module.ts │ │ ├── street-view.scss │ │ └── street-view.ts │ └── tile-overlay │ │ ├── tile-overlay.html │ │ ├── tile-overlay.module.ts │ │ ├── tile-overlay.scss │ │ └── tile-overlay.ts ├── service-worker.js └── theme │ └── variables.scss ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 2 9 | 10 | # We recommend you to keep these unchanged 11 | end_of_line = lf 12 | charset = utf-8 13 | trim_trailing_whitespace = true 14 | insert_final_newline = true 15 | 16 | [*.md] 17 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Specifies intentionally untracked files to ignore when using Git 2 | # http://git-scm.com/docs/gitignore 3 | 4 | *~ 5 | *.sw[mnpcod] 6 | *.log 7 | *.tmp 8 | *.tmp.* 9 | log.txt 10 | *.sublime-project 11 | *.sublime-workspace 12 | .vscode/ 13 | npm-debug.log* 14 | 15 | .idea/ 16 | .sourcemaps/ 17 | .sass-cache/ 18 | .tmp/ 19 | .versions/ 20 | coverage/ 21 | dist/ 22 | node_modules/ 23 | tmp/ 24 | temp/ 25 | hooks/ 26 | platforms/ 27 | plugins/ 28 | plugins/android.json 29 | plugins/ios.json 30 | www/ 31 | $RECYCLE.BIN/ 32 | 33 | .DS_Store 34 | Thumbs.db 35 | UserInterfaceState.xcuserstate 36 | package-lock.json 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GoogleMaps quick demo 2 | 3 | This is a demo app of [@ionic-native/google-maps](https://www.npmjs.com/package/@ionic-native/google-maps) plugin and [Cordova GoogleMaps](https://github.com/mapsplugin/cordova-plugin-googlemaps) plugin. 4 | 5 | 6 | 7 | ## Demo apk (Android) 8 | [ionic-googlemaps-quickdemo.apk](./ionic-googlemaps-quickdemo.apk) 9 | 10 | ## Replace with your api key 11 | 12 | You need to replace `(REPLACE WITH YOUR APK KEY)` in [config.xml](https://github.com/mapsplugin/ionic-googlemaps-quickdemo/blob/master/config.xml#L83-L84) file with your Google Maps API keys. 13 | -------------------------------------------------------------------------------- /bin/local_dev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | GMAPS_DIR_PATH=$1 4 | if [ -z "${GMAPS_DIR_PATH}" ]; then 5 | echo "Usage:" 6 | echo " $> npm run link (path_to_@ionic-native/google-maps directory)" 7 | exit 0 8 | fi 9 | 10 | CHECK=`ls -l ${GMAPS_DIR_PATH}/package.json 2>&1` 11 | 12 | if [[ $CHECK = *"No such file or directory"* ]]; then 13 | (>&2 echo "There is no package.json at ${GMAPS_DIR_PATH}") 14 | else 15 | rm -rf node_modules/\@ionic-native/core 16 | rm -rf node_modules/\@ionic-native/google-maps 17 | 18 | # cp -R ${GMAPS_DIR_PATH}/dist/\@ionic-native/core node_modules/\@ionic-native/ 19 | npm link ${GMAPS_DIR_PATH}/dist/\@ionic-native/core 20 | npm link ${GMAPS_DIR_PATH}/dist/\@ionic-native/google-maps 21 | fi 22 | -------------------------------------------------------------------------------- /capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/capture.png -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | GoogleMaps quick demo 4 | A demo app of @ionic-native/google-maps plugin. 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 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /ionic-googlemaps-quickdemo.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/ionic-googlemaps-quickdemo.apk -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic-native-google-maps", 3 | "integrations": { 4 | "cordova": {} 5 | }, 6 | "type": "ionic-angular" 7 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GoogleMaps-quick-demo", 3 | "version": "0.0.1", 4 | "author": "Masashi Katsumata", 5 | "homepage": "https://github.com/mapsplugin", 6 | "private": true, 7 | "scripts": { 8 | "clean": "ionic-app-scripts clean", 9 | "build": "ionic-app-scripts build", 10 | "lint": "ionic-app-scripts lint", 11 | "ionic:build": "ionic-app-scripts build", 12 | "ionic:serve": "ionic-app-scripts serve", 13 | "link": "bash bin/local_dev.sh" 14 | }, 15 | "dependencies": { 16 | "@angular/common": "4.4.4", 17 | "@angular/compiler": "4.4.4", 18 | "@angular/compiler-cli": "4.4.4", 19 | "@angular/core": "4.4.4", 20 | "@angular/forms": "4.4.4", 21 | "@angular/http": "4.4.4", 22 | "@angular/platform-browser": "4.4.4", 23 | "@angular/platform-browser-dynamic": "4.4.4", 24 | "@ionic-native/core": "4.14.0", 25 | "@ionic-native/google-maps": "4.14.0", 26 | "@ionic-native/splash-screen": "4.14.0", 27 | "@ionic-native/status-bar": "4.14.0", 28 | "@ionic/storage": "2.0.1", 29 | "cordova-android": "7.0.0", 30 | "cordova-browser": "5.0.4", 31 | "cordova-plugin-device": "^1.1.4", 32 | "cordova-plugin-googlemaps": "^2.6.2", 33 | "cordova-plugin-ionic-webview": "^4.1.3", 34 | "cordova-plugin-splashscreen": "^4.1.0", 35 | "cordova-plugin-whitelist": "^1.3.3", 36 | "ionic-angular": "3.8.0", 37 | "ionic-plugin-keyboard": "^2.2.1", 38 | "ionicons": "3.0.0", 39 | "lodash": "^4.17.10", 40 | "minimist": "^1.2.0", 41 | "rxjs": "5.4.3", 42 | "sw-toolbox": "3.6.0", 43 | "xml2js": "^0.4.19", 44 | "zone.js": "0.8.18" 45 | }, 46 | "devDependencies": { 47 | "@ionic/app-scripts": "3.0.1", 48 | "typescript": "2.3.4" 49 | }, 50 | "description": "A demo app of @ionic-native/google-maps plugin.", 51 | "cordova": { 52 | "plugins": { 53 | "ionic-plugin-keyboard": {}, 54 | "cordova-plugin-whitelist": {}, 55 | "cordova-plugin-device": {}, 56 | "cordova-plugin-splashscreen": {}, 57 | "cordova-plugin-ionic-webview": {}, 58 | "cordova-plugin-googlemaps": { 59 | "PLAY_SERVICES_VERSION": "15.0.1", 60 | "ANDROID_SUPPORT_V4_VERSION": "27.+", 61 | "LOCATION_WHEN_IN_USE_DESCRIPTION": "This app wants to get your location while this app runs only.", 62 | "LOCATION_ALWAYS_USAGE_DESCRIPTION": "This app wants to get your location always, even this app runs in background." 63 | } 64 | }, 65 | "platforms": [ 66 | "android", 67 | "ios", 68 | "browser" 69 | ] 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /resources/README.md: -------------------------------------------------------------------------------- 1 | These are Cordova resources. You can replace icon.png and splash.png and run 2 | `ionic cordova resources` to generate custom icons and splash screens for your 3 | app. See `ionic cordova resources --help` for details. 4 | 5 | Cordova reference documentation: 6 | 7 | - Icons: https://cordova.apache.org/docs/en/latest/config_ref/images.html 8 | - Splash Screens: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/ 9 | -------------------------------------------------------------------------------- /resources/android/icon/drawable-hdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/icon/drawable-hdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-ldpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/icon/drawable-ldpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-mdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/icon/drawable-mdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/icon/drawable-xhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/icon/drawable-xxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/icon/drawable-xxxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-land-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-land-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-land-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-land-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-land-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-land-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-port-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-port-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-port-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-port-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-port-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/android/splash/drawable-port-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-1024.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-40.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-40@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-40@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-50.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-50@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-60.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-60@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-60@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-72.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-72@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-76.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-76@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-83.5@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-small.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-small@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon-small@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/icon/icon@2x.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-568h@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default-568h@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-667h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default-667h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default-Landscape-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default-Landscape@~ipadpro.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default-Portrait@~ipadpro.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~universal~anyany.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default@2x~universal~anyany.png -------------------------------------------------------------------------------- /resources/ios/splash/Default~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/ios/splash/Default~iphone.png -------------------------------------------------------------------------------- /resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/resources/splash.png -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewChild } from '@angular/core'; 2 | import { Nav, Platform } from 'ionic-angular'; 3 | import { StatusBar } from '@ionic-native/status-bar'; 4 | import { SplashScreen } from '@ionic-native/splash-screen'; 5 | 6 | import { HomePage } from '../pages/home/home'; 7 | import { PolylinePage } from '../pages/polyline/polyline'; 8 | import { PolygonPage } from '../pages/polygon/polygon'; 9 | import { BaseArrayClassPage } from '../pages/base-array-class/base-array-class'; 10 | import { HtmlInfoWindowPage } from '../pages/html-info-window/html-info-window'; 11 | import { MarkerClusterPage } from '../pages/marker-cluster/marker-cluster'; 12 | import { GeocodingPage } from '../pages/geocoding/geocoding'; 13 | import { MarkerPage } from '../pages/marker/marker'; 14 | import { CirclePage } from '../pages/circle/circle'; 15 | import { GroundOverlayPage } from '../pages/ground-overlay/ground-overlay'; 16 | import { TileOverlayPage } from '../pages/tile-overlay/tile-overlay'; 17 | import { KmlOverlayPage } from '../pages/kml-overlay/kml-overlay'; 18 | import { StreetViewPage } from '../pages/street-view/street-view'; 19 | 20 | @Component({ 21 | templateUrl: 'app.html' 22 | }) 23 | export class MyApp { 24 | @ViewChild(Nav) nav: Nav; 25 | 26 | rootPage: any; 27 | 28 | pages: Array<{title: string, component: any}>; 29 | 30 | constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) { 31 | this.initializeApp(); 32 | 33 | // used for an example of ngFor and navigation 34 | this.pages = [ 35 | { title: 'Home', component: HomePage }, 36 | { title: 'Marker', component: MarkerPage }, 37 | { title: 'MarkerCluster', component: MarkerClusterPage }, 38 | { title: 'HtmlInfoWindow', component: HtmlInfoWindowPage }, 39 | { title: 'Circle', component: CirclePage }, 40 | { title: 'Polyline', component: PolylinePage }, 41 | { title: 'Polygon', component: PolygonPage }, 42 | { title: 'GroundOverlay', component: GroundOverlayPage }, 43 | { title: 'TileOverlay', component: TileOverlayPage }, 44 | { title: 'KmlOverlay', component: KmlOverlayPage }, 45 | { title: 'Geocoding', component: GeocodingPage }, 46 | { title: 'BaseArrayClass', component: BaseArrayClassPage }, 47 | { title: 'StreetView', component: StreetViewPage } 48 | 49 | ]; 50 | 51 | } 52 | 53 | initializeApp() { 54 | this.platform.ready().then(() => { 55 | this.rootPage = HomePage; 56 | 57 | // Okay, so the platform is ready and our plugins are available. 58 | // Here you can do any higher level native things you might need. 59 | this.statusBar.styleDefault(); 60 | this.splashScreen.hide(); 61 | }); 62 | } 63 | 64 | openPage(page) { 65 | // Reset the content nav to have just this page 66 | // we wouldn't want the back button to show in this scenario 67 | this.nav.setRoot(page.component); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/app/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Menu 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { ErrorHandler, NgModule } from '@angular/core'; 3 | import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; 4 | import { FormsModule } from '@angular/forms'; 5 | 6 | 7 | import { MyApp } from './app.component'; 8 | import { HomePage } from '../pages/home/home'; 9 | import { BaseArrayClassPage } from '../pages/base-array-class/base-array-class'; 10 | import { PolygonPage } from '../pages/polygon/polygon'; 11 | import { HtmlInfoWindowPage } from '../pages/html-info-window/html-info-window'; 12 | import { MarkerClusterPage } from '../pages/marker-cluster/marker-cluster'; 13 | import { GeocodingPage } from '../pages/geocoding/geocoding'; 14 | import { PolylinePage } from '../pages/polyline/polyline'; 15 | import { MarkerPage } from '../pages/marker/marker'; 16 | import { CirclePage } from '../pages/circle/circle'; 17 | import { GroundOverlayPage } from '../pages/ground-overlay/ground-overlay'; 18 | import { TileOverlayPage } from '../pages/tile-overlay/tile-overlay'; 19 | import { KmlOverlayPage } from '../pages/kml-overlay/kml-overlay'; 20 | import { StreetViewPage } from '../pages/street-view/street-view'; 21 | 22 | import { StatusBar } from '@ionic-native/status-bar'; 23 | import { SplashScreen } from '@ionic-native/splash-screen'; 24 | import { GoogleMaps } from "@ionic-native/google-maps"; 25 | 26 | @NgModule({ 27 | declarations: [ 28 | MyApp, 29 | HomePage, 30 | BaseArrayClassPage, 31 | PolygonPage, 32 | HtmlInfoWindowPage, 33 | MarkerClusterPage, 34 | GeocodingPage, 35 | PolylinePage, 36 | MarkerPage, 37 | CirclePage, 38 | GroundOverlayPage, 39 | TileOverlayPage, 40 | KmlOverlayPage, 41 | StreetViewPage 42 | ], 43 | imports: [ 44 | BrowserModule, 45 | FormsModule, 46 | IonicModule.forRoot(MyApp), 47 | ], 48 | bootstrap: [IonicApp], 49 | entryComponents: [ 50 | MyApp, 51 | HomePage, 52 | BaseArrayClassPage, 53 | PolygonPage, 54 | HtmlInfoWindowPage, 55 | MarkerClusterPage, 56 | GeocodingPage, 57 | PolylinePage, 58 | MarkerPage, 59 | CirclePage, 60 | GroundOverlayPage, 61 | TileOverlayPage, 62 | KmlOverlayPage, 63 | StreetViewPage 64 | ], 65 | providers: [ 66 | StatusBar, 67 | SplashScreen, 68 | GoogleMaps, 69 | {provide: ErrorHandler, useClass: IonicErrorHandler} 70 | ] 71 | }) 72 | export class AppModule {} 73 | -------------------------------------------------------------------------------- /src/app/app.scss: -------------------------------------------------------------------------------- 1 | // http://ionicframework.com/docs/theming/ 2 | 3 | 4 | // App Global Sass 5 | // -------------------------------------------------- 6 | // Put style rules here that you want to apply globally. These 7 | // styles are for the entire app and not just one component. 8 | // Additionally, this file can be also used as an entry point 9 | // to import other Sass files to be included in the output CSS. 10 | // 11 | // Shared Sass variables, which can be used to adjust Ionic's 12 | // default Sass variables, belong in "theme/variables.scss". 13 | // 14 | // To declare rules for a specific mode, create a child rule 15 | // for the .md, .ios, or .wp mode classes. The mode class is 16 | // automatically applied to the element in the app. 17 | 18 | #map_canvas, #pano_canvas { 19 | height: 100%; 20 | } 21 | 22 | .smallPanel { 23 | margin: 10px; 24 | padding: 10px; 25 | background-color:rgba(255,255,255,0.5); 26 | z-index: 2 !important; 27 | font-size: 25px; 28 | } 29 | -------------------------------------------------------------------------------- /src/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /src/assets/imgs/Number-1-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/src/assets/imgs/Number-1-icon.png -------------------------------------------------------------------------------- /src/assets/imgs/blue-marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/src/assets/imgs/blue-marker.png -------------------------------------------------------------------------------- /src/assets/imgs/hearst_castle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/src/assets/imgs/hearst_castle.jpg -------------------------------------------------------------------------------- /src/assets/imgs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/src/assets/imgs/logo.png -------------------------------------------------------------------------------- /src/assets/imgs/newark_nj_1922.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/src/assets/imgs/newark_nj_1922.jpg -------------------------------------------------------------------------------- /src/assets/imgs/newark_nj_1922_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/src/assets/imgs/newark_nj_1922_2.jpg -------------------------------------------------------------------------------- /src/assets/markercluster/large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/src/assets/markercluster/large.png -------------------------------------------------------------------------------- /src/assets/markercluster/marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/src/assets/markercluster/marker.png -------------------------------------------------------------------------------- /src/assets/markercluster/small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapsplugin/ionic-googlemaps-quickdemo/c5dc372670baecaf875a3001a06a487a94cc8e98/src/assets/markercluster/small.png -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ionic App 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Ionic", 3 | "short_name": "Ionic", 4 | "start_url": "index.html", 5 | "display": "standalone", 6 | "icons": [{ 7 | "src": "assets/imgs/logo.png", 8 | "sizes": "512x512", 9 | "type": "image/png" 10 | }], 11 | "background_color": "#4e8ef7", 12 | "theme_color": "#4e8ef7" 13 | } -------------------------------------------------------------------------------- /src/pages/base-array-class/base-array-class.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | BaseArrayClassPage 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | {{distance}} 23 |
24 |
25 | -------------------------------------------------------------------------------- /src/pages/base-array-class/base-array-class.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { BaseArrayClassPage } from './base-array-class'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | BaseArrayClassPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(BaseArrayClassPage), 11 | ], 12 | }) 13 | export class BaseArrayClassPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/base-array-class/base-array-class.scss: -------------------------------------------------------------------------------- 1 | page-base-array-class { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/base-array-class/base-array-class.ts: -------------------------------------------------------------------------------- 1 | import { Component, NgZone } from '@angular/core'; 2 | import { IonicPage } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | Marker, 7 | ILatLng, 8 | Polyline, 9 | Spherical, 10 | BaseArrayClass 11 | } from '@ionic-native/google-maps'; 12 | 13 | /** 14 | * Generated class for the BaseArrayClassPage page. 15 | * 16 | * See https://ionicframework.com/docs/components/#navigation for more info on 17 | * Ionic pages and navigation. 18 | */ 19 | 20 | @IonicPage() 21 | @Component({ 22 | selector: 'page-base-array-class', 23 | templateUrl: 'base-array-class.html' 24 | }) 25 | export class BaseArrayClassPage { 26 | 27 | map: GoogleMap; 28 | distance: string; 29 | 30 | constructor(private _ngZone: NgZone) { 31 | } 32 | 33 | ionViewDidLoad() { 34 | console.log('ionViewDidLoad PolygonPage'); 35 | this.loadMap(); 36 | } 37 | loadMap() { 38 | let points: Array = [ 39 | {lat: 33.91636924837674, lng: -118.39605331420898}, 40 | {lat: 33.90205144970967, lng: -118.39639663696288}, 41 | {lat: 33.90190897196702, lng: -118.37905883789062}, 42 | {lat: 33.89471353635718, lng: -118.3787155151367} 43 | ]; 44 | this.map = GoogleMaps.create('map_canvas', { 45 | camera: { 46 | target: points 47 | } 48 | }); 49 | let polyline: Polyline = this.map.addPolylineSync({ 50 | points: points 51 | }); 52 | let baseArray: BaseArrayClass = polyline.getPoints(); 53 | 54 | baseArray.mapAsync((point: ILatLng, next: (newElement: any) => void) => { 55 | this.map.addMarker({ 56 | position: point, 57 | draggable: true 58 | }).then(next); 59 | }).then((markers: Marker[]) => { 60 | 61 | let baseArray2: BaseArrayClass = new BaseArrayClass(markers); 62 | baseArray2.forEach((marker: Marker, idx: number) => { 63 | marker.on('position_changed').subscribe((params) => { 64 | baseArray.setAt(idx, params[1]); 65 | }); 66 | }); 67 | 68 | // trigger the position_changed event for the first calculation. 69 | markers[0].trigger('position_changed', null, markers[0].getPosition()); 70 | }); 71 | 72 | baseArray.on('set_at').subscribe(() => { 73 | this._ngZone.run(() => { 74 | let distanceMeter: number = Spherical.computeLength(baseArray); 75 | this.distance = (distanceMeter * 0.000621371192).toFixed(2) + " miles"; 76 | }); 77 | }); 78 | 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/pages/circle/circle.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | CirclePage 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |
23 | -------------------------------------------------------------------------------- /src/pages/circle/circle.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { CirclePage } from './circle'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | CirclePage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(CirclePage), 11 | ], 12 | }) 13 | export class CirclePageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/circle/circle.scss: -------------------------------------------------------------------------------- 1 | page-circle { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/circle/circle.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | ILatLng, 7 | Circle, 8 | Marker, 9 | Spherical 10 | } from '@ionic-native/google-maps'; 11 | 12 | /** 13 | * Generated class for the CirclePage page. 14 | * 15 | * See https://ionicframework.com/docs/components/#navigation for more info on 16 | * Ionic pages and navigation. 17 | */ 18 | 19 | @IonicPage() 20 | @Component({ 21 | selector: 'page-circle', 22 | templateUrl: 'circle.html' 23 | }) 24 | export class CirclePage { 25 | 26 | map: GoogleMap; 27 | 28 | constructor() { 29 | } 30 | ionViewDidLoad() { 31 | console.log('ionViewDidLoad CirclePage'); 32 | this.loadMap(); 33 | } 34 | 35 | loadMap() { 36 | let center: ILatLng = {"lat": 32, "lng": -97}; 37 | 38 | let radius = 300; // radius (meter) 39 | 40 | // Calculate the positions 41 | let positions: ILatLng[] = [0, 90, 180, 270].map((degree: number) => { 42 | return Spherical.computeOffset(center, radius, degree); 43 | }); 44 | 45 | this.map = GoogleMaps.create('map_canvas', { 46 | camera: { 47 | target: positions, 48 | padding: 100 49 | } 50 | }); 51 | 52 | let marker: Marker = this.map.addMarkerSync({ 53 | position: positions[0], 54 | draggable: true, 55 | title: 'Drag me!' 56 | }); 57 | let circle: Circle = this.map.addCircleSync({ 58 | 'center': center, 59 | 'radius': radius, 60 | 'strokeColor' : '#AA00FF', 61 | 'strokeWidth': 5, 62 | 'fillColor' : '#00880055' 63 | }); 64 | 65 | marker.on('position_changed').subscribe((params: any) => { 66 | let newValue: ILatLng = params[1]; 67 | let newRadius: number = Spherical.computeDistanceBetween(center, newValue); 68 | circle.setRadius(newRadius); 69 | }); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/pages/geocoding/geocoding.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | GeocodingPage 14 | 15 | 16 | 17 | 18 | 19 | 20 |

Single geocoding

21 |
22 | 23 | 24 | 25 | 26 |
27 |
28 | 29 |
30 | 31 |

Batch geocoding

32 |
33 | 34 |
35 |
36 | -------------------------------------------------------------------------------- /src/pages/geocoding/geocoding.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { GeocodingPage } from './geocoding'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | GeocodingPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(GeocodingPage), 11 | ], 12 | }) 13 | export class GeocodingPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/geocoding/geocoding.scss: -------------------------------------------------------------------------------- 1 | page-geocoding { 2 | #map_canvas1, #map_canvas2 { 3 | height: 90%; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/geocoding/geocoding.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewChild, ElementRef } from '@angular/core'; 2 | import { IonicPage, LoadingController } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | Geocoder, 7 | BaseArrayClass, 8 | GeocoderResult, 9 | Marker 10 | } from '@ionic-native/google-maps'; 11 | 12 | /** 13 | * Generated class for the GeocodingPage page. 14 | * 15 | * See https://ionicframework.com/docs/components/#navigation for more info on 16 | * Ionic pages and navigation. 17 | */ 18 | 19 | @IonicPage() 20 | @Component({ 21 | selector: 'page-geocoding', 22 | templateUrl: 'geocoding.html' 23 | }) 24 | export class GeocodingPage { 25 | map1: GoogleMap; 26 | map2: GoogleMap; 27 | loading: any; 28 | @ViewChild('search_address') search_address:ElementRef; 29 | 30 | constructor(public loadingCtrl: LoadingController) { 31 | } 32 | 33 | ionViewDidEnter() { 34 | console.log('ionViewDidLoad GeocodingPage'); 35 | 36 | this.loading = this.loadingCtrl.create({ 37 | content: 'Please wait...' 38 | }); 39 | this.loadMap1(); 40 | this.loadMap2(); 41 | } 42 | 43 | loadMap1() { 44 | this.search_address.nativeElement.value = '1600 Amphitheatre Parkway, Mountain View, CA 94043, United States'; 45 | this.map1 = GoogleMaps.create(document.getElementById('map_canvas1')); 46 | } 47 | 48 | onButton1_click(event) { 49 | this.loading.present(); 50 | this.map1.clear(); 51 | 52 | // Address -> latitude,longitude 53 | Geocoder.geocode({ 54 | "address": this.search_address.nativeElement.value 55 | }) 56 | .then((results: GeocoderResult[]) => { 57 | console.log(results); 58 | this.loading.dismiss(); 59 | 60 | let marker: Marker = this.map1.addMarkerSync({ 61 | 'position': results[0].position, 62 | 'title': JSON.stringify(results[0].position) 63 | }); 64 | this.map1.animateCamera({ 65 | 'target': marker.getPosition(), 66 | 'zoom': 17 67 | }).then(() => { 68 | marker.showInfoWindow(); 69 | }) 70 | }); 71 | } 72 | 73 | 74 | loadMap2() { 75 | this.map2 = GoogleMaps.create('map_canvas2', { 76 | camera: { 77 | target: [ 78 | {"lat": 21.306944, "lng": -157.858333}, 79 | {"lat": 47.037874, "lng": -69.779490} 80 | ] 81 | } 82 | }); 83 | } 84 | onButton2_click(event) { 85 | this.map2.clear(); 86 | 87 | this.loading.present(); 88 | let start = Date.now(); 89 | 90 | // Geocode multiple location 91 | Geocoder.geocode({ 92 | 93 | // US Capital cities 94 | "address": [ 95 | "Montgomery, AL, USA", "Juneau, AK, USA", "Phoenix, AZ, USA", 96 | "Little Rock, AR, USA", "Sacramento, CA, USA", "Denver, CO, USA", 97 | "Hartford, CT, USA", "Dover, DE, USA", "Washington, DC, USA", 98 | "Tallahassee, FL, USA", "Atlanta, GA, USA", "Honolulu, HI, USA", 99 | "Boise, ID, USA", "Springfield, IL, USA", "Indianapolis, IN, USA", 100 | "Des Moines, IA, USA", "Topeka, KS, USA", "Frankfort, KY, USA", 101 | "Baton Rouge, LA, USA", "Augusta, ME, USA", "Annapolis, MD, USA", 102 | "Boston, MA, USA", "Lansing, MI, USA", "Saint Paul, MN, USA", 103 | "Jackson, MS, USA", "Jefferson City, MO, USA", "Helena, MT, USA", 104 | "Lincoln, NE, USA", "Carson City, NV, USA", "Concord, NH, USA", 105 | "Trenton, NJ, USA", "Santa Fe, NM, USA", "Albany, NY, USA", 106 | "Raleigh, NC, USA", "Bismarck, ND, USA", "Columbus, OH, USA", 107 | "Oklahoma City, OK, USA", "Salem, OR, USA", "Harrisburg, PA, USA", 108 | "Providence, RI, USA", "Columbia, SC, USA", "Pierre, SD, USA", 109 | "Nashville, TN, USA", "Austin, TX, USA", "Salt Lake City, UT, USA", 110 | "Montpelier, VT, USA", "Richmond, VA, USA", "Olympia, WA, USA", 111 | "Charleston, WV, USA", "Madison, WI, USA", "Cheyenne, Wyoming, USA" 112 | ] 113 | }) 114 | .then((mvcArray: BaseArrayClass) => { 115 | 116 | mvcArray.one('finish').then(() => { 117 | let results: any[] = mvcArray.getArray(); 118 | results.forEach((result: GeocoderResult[]) => { 119 | if (result.length === 0) { 120 | // Geocoder can not get the result 121 | return; 122 | } 123 | this.map2.addMarkerSync({ 124 | 'position': result[0].position, 125 | 'title': JSON.stringify(result) 126 | }); 127 | }); 128 | this.loading.dismiss(); 129 | let end = Date.now(); 130 | alert("duration: " + ((end - start) / 1000).toFixed(1) + " seconds"); 131 | }); 132 | 133 | }); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /src/pages/ground-overlay/ground-overlay.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | GroundOverlayPage 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 | -------------------------------------------------------------------------------- /src/pages/ground-overlay/ground-overlay.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { GroundOverlayPage } from './ground-overlay'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | GroundOverlayPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(GroundOverlayPage), 11 | ], 12 | }) 13 | export class GroundOverlayPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/ground-overlay/ground-overlay.scss: -------------------------------------------------------------------------------- 1 | page-ground-overlay { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/ground-overlay/ground-overlay.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | GoogleMapsEvent, 7 | ILatLng, 8 | GroundOverlay 9 | } from '@ionic-native/google-maps'; 10 | 11 | /** 12 | * Generated class for the GroundOverlayPage page. 13 | * 14 | * See https://ionicframework.com/docs/components/#navigation for more info on 15 | * Ionic pages and navigation. 16 | */ 17 | 18 | @IonicPage() 19 | @Component({ 20 | selector: 'page-ground-overlay', 21 | templateUrl: 'ground-overlay.html', 22 | }) 23 | export class GroundOverlayPage { 24 | 25 | map: GoogleMap; 26 | 27 | constructor() { 28 | } 29 | ionViewDidLoad() { 30 | console.log('ionViewDidLoad CirclePage'); 31 | this.loadMap(); 32 | } 33 | 34 | loadMap() { 35 | let bounds: ILatLng[] = [ 36 | {"lat": 40.712216, "lng": -74.22655}, 37 | {"lat": 40.773941, "lng": -74.12544} 38 | ]; 39 | 40 | this.map = GoogleMaps.create('map_canvas', { 41 | camera: { 42 | target: bounds 43 | } 44 | }); 45 | 46 | let groundOverlay: GroundOverlay = this.map.addGroundOverlaySync({ 47 | 'url': 'assets/imgs/newark_nj_1922.jpg', 48 | 'bounds': bounds, 49 | 'opacity': 0.5, 50 | 'clickable': true // default = false 51 | }); 52 | 53 | // Catch the GROUND_OVERLAY_CLICK event 54 | groundOverlay.on(GoogleMapsEvent.GROUND_OVERLAY_CLICK).subscribe(() => { 55 | groundOverlay.setImage('assets/imgs/newark_nj_1922_2.jpg'); 56 | }); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/pages/home/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | Home 7 | 8 | 9 | 10 | 11 |

Ionic GoogleMaps Demo

12 |

13 | This is a demo application of @ionic-native/google-maps plugin. 14 |

15 |
16 | 17 |
18 |
19 | -------------------------------------------------------------------------------- /src/pages/home/home.scss: -------------------------------------------------------------------------------- 1 | page-home { 2 | #map_canvas { 3 | height: 90%; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/home/home.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { ToastController } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | GoogleMapsEvent, 7 | Marker, 8 | GoogleMapsAnimation, 9 | MyLocation 10 | } from '@ionic-native/google-maps'; 11 | 12 | @Component({ 13 | selector: 'page-home', 14 | templateUrl: 'home.html' 15 | }) 16 | export class HomePage { 17 | 18 | map: GoogleMap; 19 | 20 | constructor(public toastCtrl: ToastController) { 21 | } 22 | 23 | ionViewDidLoad() { 24 | this.loadMap(); 25 | } 26 | 27 | loadMap() { 28 | // Create a map after the view is loaded. 29 | // (platform is already ready in app.component.ts) 30 | this.map = GoogleMaps.create('map_canvas', { 31 | camera: { 32 | target: { 33 | lat: 43.0741704, 34 | lng: -89.3809802 35 | }, 36 | zoom: 18, 37 | tilt: 30 38 | } 39 | }); 40 | 41 | } 42 | 43 | onButtonClick() { 44 | this.map.clear(); 45 | 46 | // Get the location of you 47 | this.map.getMyLocation() 48 | .then((location: MyLocation) => { 49 | console.log(JSON.stringify(location, null ,2)); 50 | 51 | // Move the map camera to the location with animation 52 | this.map.animateCamera({ 53 | target: location.latLng, 54 | zoom: 17, 55 | tilt: 30 56 | }) 57 | .then(() => { 58 | // add a marker 59 | let marker: Marker = this.map.addMarkerSync({ 60 | title: '@ionic-native/google-maps plugin!', 61 | snippet: 'This plugin is awesome!', 62 | position: location.latLng, 63 | animation: GoogleMapsAnimation.BOUNCE 64 | }); 65 | 66 | // show the infoWindow 67 | marker.showInfoWindow(); 68 | 69 | // If clicked it, display the alert 70 | marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => { 71 | this.showToast('clicked!'); 72 | }); 73 | }); 74 | }); 75 | } 76 | 77 | showToast(message: string) { 78 | let toast = this.toastCtrl.create({ 79 | message: message, 80 | duration: 2000, 81 | position: 'middle' 82 | }); 83 | 84 | toast.present(toast); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/pages/html-info-window/html-info-window.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | HtmlInfoWindowPage 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 | -------------------------------------------------------------------------------- /src/pages/html-info-window/html-info-window.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { HtmlInfoWindowPage } from './html-info-window'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | HtmlInfoWindowPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(HtmlInfoWindowPage), 11 | ], 12 | }) 13 | export class HtmlInfoWindowPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/html-info-window/html-info-window.scss: -------------------------------------------------------------------------------- 1 | page-html-info-window { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/html-info-window/html-info-window.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | GoogleMapsEvent, 7 | Marker, 8 | HtmlInfoWindow 9 | } from '@ionic-native/google-maps'; 10 | 11 | /** 12 | * Generated class for the HtmlInfoWindowPage page. 13 | * 14 | * See https://ionicframework.com/docs/components/#navigation for more info on 15 | * Ionic pages and navigation. 16 | */ 17 | 18 | @IonicPage() 19 | @Component({ 20 | selector: 'page-html-info-window', 21 | templateUrl: 'html-info-window.html', 22 | }) 23 | export class HtmlInfoWindowPage { 24 | 25 | map: GoogleMap; 26 | 27 | constructor() { 28 | } 29 | 30 | ionViewDidLoad() { 31 | console.log('ionViewDidLoad HtmlInfoWindowPage'); 32 | this.loadMap(); 33 | } 34 | 35 | loadMap() { 36 | this.map = GoogleMaps.create('map_canvas', { 37 | camera: { 38 | target: {lat: 35.685208, lng: -121.168225}, 39 | zoom: 5 40 | } 41 | }); 42 | 43 | let htmlInfoWindow = new HtmlInfoWindow(); 44 | 45 | let frame: HTMLElement = document.createElement('div'); 46 | frame.innerHTML = [ 47 | '

Hearst Castle

', 48 | '' 49 | ].join(""); 50 | frame.getElementsByTagName("img")[0].addEventListener("click", () => { 51 | htmlInfoWindow.setBackgroundColor('red'); 52 | }); 53 | htmlInfoWindow.setContent(frame, { 54 | width: "280px", 55 | height: "330px" 56 | }); 57 | 58 | let marker: Marker = this.map.addMarkerSync({ 59 | position: {lat: 35.685208, lng: -121.168225}, 60 | draggable: true, 61 | disableAutoPan: true 62 | }); 63 | 64 | marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => { 65 | htmlInfoWindow.open(marker); 66 | }); 67 | 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/pages/kml-overlay/kml-overlay.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | KmlOverlay 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 | -------------------------------------------------------------------------------- /src/pages/kml-overlay/kml-overlay.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { KmlOverlayPage } from './kml-overlay'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | KmlOverlayPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(KmlOverlayPage), 11 | ], 12 | }) 13 | export class KmlOverlayPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/kml-overlay/kml-overlay.scss: -------------------------------------------------------------------------------- 1 | page-kml-overlay { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/kml-overlay/kml-overlay.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, LoadingController } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | GoogleMapsEvent, 7 | KmlOverlay, 8 | Polygon, 9 | ILatLng 10 | } from '@ionic-native/google-maps'; 11 | 12 | /** 13 | * Generated class for the KmlOverlayPage page. 14 | * 15 | * See https://ionicframework.com/docs/components/#navigation for more info on 16 | * Ionic pages and navigation. 17 | */ 18 | 19 | @IonicPage() 20 | @Component({ 21 | selector: 'page-kml-overlay', 22 | templateUrl: 'kml-overlay.html', 23 | }) 24 | export class KmlOverlayPage { 25 | 26 | map: GoogleMap; 27 | loading: any; 28 | 29 | constructor(public loadingCtrl: LoadingController) { 30 | } 31 | 32 | ionViewDidLoad() { 33 | console.log('ionViewDidLoad KmlOverlayPage'); 34 | this.loadMap(); 35 | } 36 | 37 | loadMap() { 38 | 39 | 40 | this.loading = this.loadingCtrl.create({ 41 | content: 'Please wait...' 42 | }); 43 | this.loading.present(); 44 | 45 | this.map = GoogleMaps.create('map_canvas'); 46 | this.map.addKmlOverlay({ 47 | url: "assets/kmloverlay/polygon.kml" 48 | }).then((kmlOverlay: KmlOverlay) => { 49 | this.loading.dismiss(); 50 | 51 | console.log(kmlOverlay); 52 | 53 | this.map.moveCamera(kmlOverlay.getDefaultViewport()); 54 | 55 | // You can get additional information 56 | kmlOverlay.on(GoogleMapsEvent.KML_CLICK).subscribe((params: any) => { 57 | let overlay: Polygon = params[0]; // depends on overlay 58 | let latLng: ILatLng = params[1]; 59 | console.log(overlay, latLng); 60 | }); 61 | 62 | }); 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/pages/marker-cluster/marker-cluster.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | MarkerClusterPage 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 | -------------------------------------------------------------------------------- /src/pages/marker-cluster/marker-cluster.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { MarkerClusterPage } from './marker-cluster'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | MarkerClusterPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(MarkerClusterPage), 11 | ], 12 | }) 13 | export class MarkerClusterPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/marker-cluster/marker-cluster.scss: -------------------------------------------------------------------------------- 1 | page-marker-cluster { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/marker-cluster/marker-cluster.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | GoogleMapsEvent, 7 | MarkerCluster, 8 | Marker 9 | } from "@ionic-native/google-maps"; 10 | 11 | /** 12 | * Generated class for the MarkerClusterPage page. 13 | * 14 | * See https://ionicframework.com/docs/components/#navigation for more info on 15 | * Ionic pages and navigation. 16 | */ 17 | 18 | @IonicPage() 19 | @Component({ 20 | selector: 'page-marker-cluster', 21 | templateUrl: 'marker-cluster.html', 22 | }) 23 | export class MarkerClusterPage { 24 | 25 | map: GoogleMap; 26 | 27 | constructor() { 28 | } 29 | 30 | ionViewDidLoad() { 31 | console.log('ionViewDidLoad MarkerClusterPage'); 32 | this.loadMap(); 33 | } 34 | 35 | loadMap() { 36 | 37 | this.map = GoogleMaps.create('map_canvas', { 38 | 'camera': { 39 | 'target': { 40 | "lat": 21.382314, 41 | "lng": -157.933097 42 | }, 43 | 'zoom': 10 44 | } 45 | }); 46 | 47 | this.addCluster(this.dummyData()); 48 | } 49 | 50 | addCluster(data) { 51 | let markerCluster: MarkerCluster = this.map.addMarkerClusterSync({ 52 | markers: data, 53 | icons: [ 54 | { 55 | min: 3, 56 | max: 9, 57 | url: "./assets/markercluster/small.png", 58 | label: { 59 | color: "white" 60 | } 61 | }, 62 | { 63 | min: 10, 64 | url: "./assets/markercluster/large.png", 65 | label: { 66 | color: "white" 67 | } 68 | } 69 | ] 70 | }); 71 | 72 | markerCluster.on(GoogleMapsEvent.MARKER_CLICK).subscribe((params) => { 73 | let marker: Marker = params[1]; 74 | marker.setTitle(marker.get("name")); 75 | marker.setSnippet(marker.get("address")); 76 | marker.showInfoWindow(); 77 | }); 78 | 79 | } 80 | 81 | dummyData() { 82 | return [ 83 | { 84 | "position": { 85 | "lat": 21.382314, 86 | "lng": -157.933097 87 | }, 88 | "name": "Starbucks - HI - Aiea 03641", 89 | "address": "Aiea Shopping Center_99-115\nAiea Heights Drive #125_Aiea, Hawaii 96701", 90 | "icon": "assets/markercluster/marker.png" 91 | }, 92 | { 93 | "position": { 94 | "lat": 21.3871, 95 | "lng": -157.9482 96 | }, 97 | "name": "Starbucks - HI - Aiea 03642", 98 | "address": "Pearlridge Center_98-125\nKaonohi Street_Aiea, Hawaii 96701", 99 | "icon": "assets/markercluster/marker.png" 100 | }, 101 | { 102 | "position": { 103 | "lat": 21.363402, 104 | "lng": -157.928275 105 | }, 106 | "name": "Starbucks - HI - Aiea 03643", 107 | "address": "Stadium Marketplace_4561\nSalt Lake Boulevard_Aiea, Hawaii 96818", 108 | "icon": "assets/markercluster/marker.png" 109 | }, 110 | { 111 | "position": { 112 | "lat": 21.3884, 113 | "lng": -157.9431 114 | }, 115 | "name": "Starbucks - HI - Aiea 03644", 116 | "address": "Pearlridge Mall_98-1005\nMoanalua Road_Aiea, Hawaii 96701", 117 | "icon": "assets/markercluster/marker.png" 118 | }, 119 | { 120 | "position": { 121 | "lat": 21.6507, 122 | "lng": -158.0652 123 | }, 124 | "name": "Starbucks - HI - Haleiwa 03645", 125 | "address": "Pupukea_59-720 Kamehameha Highway\nHaleiwa, Hawaii 96712", 126 | "icon": "assets/markercluster/marker.png" 127 | }, 128 | { 129 | "position": { 130 | "lat": 19.699335, 131 | "lng": -155.06566 132 | }, 133 | "name": "Starbucks - HI - Hilo 03646", 134 | "address": "Border Waiakea Center_315-325\nMakaala Street_Hilo, Hawaii 96720", 135 | "icon": "assets/markercluster/marker.png" 136 | }, 137 | { 138 | "position": { 139 | "lat": 19.698399, 140 | "lng": -155.064864 141 | }, 142 | "name": "Starbucks - HI - Hilo 03647", 143 | "address": "Prince Kuhio Plaza_111\nEast Puainako Street_Hilo, Hawaii 96720", 144 | "icon": "assets/markercluster/marker.png" 145 | }, 146 | { 147 | "position": { 148 | "lat": 19.722763, 149 | "lng": -155.085598 150 | }, 151 | "name": "Starbucks - HI - Hilo [D] 03648", 152 | "address": "Hilo_438 Kilauea Ave_Hilo, Hawaii 96720", 153 | "icon": "assets/markercluster/marker.png" 154 | }, 155 | { 156 | "position": { 157 | "lat": 21.338183, 158 | "lng": -157.917579 159 | }, 160 | "name": "Starbucks - HI - Honolulu 03649", 161 | "address": "Airport Trade Center_550\nPaiea Street_Honolulu, Hawaii 96819", 162 | "icon": "assets/markercluster/marker.png" 163 | }, 164 | { 165 | "position": { 166 | "lat": 21.3074, 167 | "lng": -157.865199 168 | }, 169 | "name": "Starbucks - HI - Honolulu 03650", 170 | "address": "Aloha Tower_1 Aloha Tower Drive\nHonolulu, Hawaii 96813", 171 | "icon": "assets/markercluster/marker.png" 172 | }, 173 | { 174 | "position": { 175 | "lat": 21.30846253, 176 | "lng": -157.8614898 177 | }, 178 | "name": "Starbucks - HI - Honolulu 03651", 179 | "address": "Bishop_1000 Bishop Street #104\nHonolulu, Hawaii 96813", 180 | "icon": "assets/markercluster/marker.png" 181 | }, 182 | { 183 | "position": { 184 | "lat": 21.311363, 185 | "lng": -157.863751 186 | }, 187 | "name": "Starbucks - HI - Honolulu 03652", 188 | "address": "Central Pacific Bank_220 South King Street\nHonolulu, Hawaii 96813", 189 | "icon": "assets/markercluster/marker.png" 190 | }, 191 | { 192 | "position": { 193 | "lat": 21.28507546, 194 | "lng": -157.838214 195 | }, 196 | "name": "Starbucks - HI - Honolulu 03653", 197 | "address": "Discovery Bay_1778 Ala Moana Boulevard\nHonolulu, Hawaii 96815", 198 | "icon": "assets/markercluster/marker.png" 199 | }, 200 | { 201 | "position": { 202 | "lat": 21.342733, 203 | "lng": -158.027408 204 | }, 205 | "name": "Starbucks - HI - Honolulu 03654", 206 | "address": "Ewa Beach_91-1401 Fort Weaver Road\nHonolulu, Hawaii 96706", 207 | "icon": "assets/markercluster/marker.png" 208 | }, 209 | { 210 | "position": { 211 | "lat": 21.28005068, 212 | "lng": -157.8285093 213 | }, 214 | "name": "Starbucks - HI - Honolulu 03655", 215 | "address": "Duty Free Shopper_330 Royal Hawaiian Avenue\nHonolulu, Hawaii 96815", 216 | "icon": "assets/markercluster/marker.png" 217 | }, 218 | { 219 | "position": { 220 | "lat": 21.3115, 221 | "lng": -157.8649 222 | }, 223 | "name": "Starbucks - HI - Honolulu 03656", 224 | "address": "Financial Plaza_130 Merchant Street #111\nHonolulu, Hawaii 96813", 225 | "icon": "assets/markercluster/marker.png" 226 | }, 227 | { 228 | "position": { 229 | "lat": 21.282048, 230 | "lng": -157.713041 231 | }, 232 | "name": "Starbucks - HI - Honolulu 03657", 233 | "address": "Hawaii Kai Town Center_6700\nKalanianaole Highway_Honolulu, Hawaii 96825", 234 | "icon": "assets/markercluster/marker.png" 235 | }, 236 | { 237 | "position": { 238 | "lat": 21.291345, 239 | "lng": -157.848791 240 | }, 241 | "name": "Starbucks - HI - Honolulu 03658", 242 | "address": "Hokua_1288 Ala Moana Blvd\nHonolulu, Hawaii 96814", 243 | "icon": "assets/markercluster/marker.png" 244 | }, 245 | { 246 | "position": { 247 | "lat": 21.335164, 248 | "lng": -157.868742 249 | }, 250 | "name": "Starbucks - HI - Honolulu 03659", 251 | "address": "Kamehameha Shopping Center_1620 North School Street\nHonolulu, Hawaii 96817", 252 | "icon": "assets/markercluster/marker.png" 253 | }, 254 | { 255 | "position": { 256 | "lat": 21.27852422, 257 | "lng": -157.7875773 258 | }, 259 | "name": "Starbucks - HI - Honolulu 03660", 260 | "address": "Kahala Mall_4211 Waialae Avenue\nHonolulu, Hawaii 96816", 261 | "icon": "assets/markercluster/marker.png" 262 | }, 263 | { 264 | "position": { 265 | "lat": 21.294372, 266 | "lng": -157.841963 267 | }, 268 | "name": "Starbucks - HI - Honolulu 03661", 269 | "address": "Keeaumoku_678 Keeamoku Street #106\nHonolulu, Hawaii 96814", 270 | "icon": "assets/markercluster/marker.png" 271 | }, 272 | { 273 | "position": { 274 | "lat": 21.2819, 275 | "lng": -157.8163 276 | }, 277 | "name": "Starbucks - HI - Honolulu 03662", 278 | "address": "Kapahulu Avenue_625 Kapahulu Avenue\nHonolulu, Hawaii 96815", 279 | "icon": "assets/markercluster/marker.png" 280 | }, 281 | { 282 | "position": { 283 | "lat": 21.27608195, 284 | "lng": -157.7049835 285 | }, 286 | "name": "Starbucks - HI - Honolulu 03663", 287 | "address": "Koko Marina_7192 Kalanianaole Highway\nHonolulu, Hawaii 96825", 288 | "icon": "assets/markercluster/marker.png" 289 | }, 290 | { 291 | "position": { 292 | "lat": 21.3129, 293 | "lng": -157.8129 294 | }, 295 | "name": "Starbucks - HI - Honolulu 03664", 296 | "address": "Manoa Valley_2902 East Manoa Road\nHonolulu, Hawaii 96822", 297 | "icon": "assets/markercluster/marker.png" 298 | }, 299 | { 300 | "position": { 301 | "lat": 21.293082, 302 | "lng": -157.847092 303 | }, 304 | "name": "Starbucks - HI - Honolulu 03665", 305 | "address": "Macys Ala Moana_1450 Ala Moan Boulevard\nHonolulu, Hawaii 96814", 306 | "icon": "assets/markercluster/marker.png" 307 | }, 308 | { 309 | "position": { 310 | "lat": 21.341957, 311 | "lng": -157.929089 312 | }, 313 | "name": "Starbucks - HI - Honolulu 03666", 314 | "address": "Moanalua Shopping Center_930 Valkenburgh Street\nHonolulu, Hawaii 96818", 315 | "icon": "assets/markercluster/marker.png" 316 | }, 317 | { 318 | "position": { 319 | "lat": 21.279503, 320 | "lng": -157.833101 321 | }, 322 | "name": "Starbucks - HI - Honolulu 03667", 323 | "address": "Outrigger Reef_2169 Kalia Road #102\nHonolulu, Hawaii 96815", 324 | "icon": "assets/markercluster/marker.png" 325 | }, 326 | { 327 | "position": { 328 | "lat": 21.282251, 329 | "lng": -157.828172 330 | }, 331 | "name": "Starbucks - HI - Honolulu 03668", 332 | "address": "Ohana Waikiki West_2330 Kuhio Avenue\nHonolulu, Hawaii 96815", 333 | "icon": "assets/markercluster/marker.png" 334 | }, 335 | { 336 | "position": { 337 | "lat": 21.323602, 338 | "lng": -157.890904 339 | }, 340 | "name": "Starbucks - HI - Honolulu 03669", 341 | "address": "Sand Island_120 Sand Island Access Road #4\nHonolulu, Hawaii 96819", 342 | "icon": "assets/markercluster/marker.png" 343 | }, 344 | { 345 | "position": { 346 | "lat": 21.270016, 347 | "lng": -157.82381 348 | }, 349 | "name": "Starbucks - HI - Honolulu 03670", 350 | "address": "Park Shore Hotel_2856 Kalakaua Avenue\nHonolulu, Hawaii 96815", 351 | "icon": "assets/markercluster/marker.png" 352 | }, 353 | { 354 | "position": { 355 | "lat": 21.289497, 356 | "lng": -157.842832 357 | }, 358 | "name": "Starbucks - HI - Honolulu 03671", 359 | "address": "Sears Ala Moana Center_1450 Ala Moana Blvd.\nHonolulu, Hawaii 96814", 360 | "icon": "assets/markercluster/marker.png" 361 | }, 362 | { 363 | "position": { 364 | "lat": 21.28201, 365 | "lng": -157.831087 366 | }, 367 | "name": "Starbucks - HI - Honolulu 03672", 368 | "address": "Waikiki Shopping Plaza_2270 Kalakaua Avenue #1800\nHonolulu, Hawaii 96815", 369 | "icon": "assets/markercluster/marker.png" 370 | }, 371 | { 372 | "position": { 373 | "lat": 21.2833, 374 | "lng": -157.8298 375 | }, 376 | "name": "Starbucks - HI - Honolulu 03673", 377 | "address": "Waikiki Trade Center_2255 Kuhio Avenue S-1\nHonolulu, Hawaii 96815", 378 | "icon": "assets/markercluster/marker.png" 379 | }, 380 | { 381 | "position": { 382 | "lat": 21.297, 383 | "lng": -157.8555 384 | }, 385 | "name": "Starbucks - HI - Honolulu 03674", 386 | "address": "Ward Entertainment Center_310 Kamakee Street #6\nHonolulu, Hawaii 96814", 387 | "icon": "assets/markercluster/marker.png" 388 | }, 389 | { 390 | "position": { 391 | "lat": 21.406095, 392 | "lng": -157.800761 393 | }, 394 | "name": "Starbucks - HI - Honolulu 03675", 395 | "address": "Windward City Shopping Center_45-480 Kaneohe Bay Drive\nHonolulu, Hawaii 96744", 396 | "icon": "assets/markercluster/marker.png" 397 | }, 398 | { 399 | "position": { 400 | "lat": 21.2829, 401 | "lng": -157.8318 402 | }, 403 | "name": "Starbucks - HI - Honolulu 03676", 404 | "address": "Waikiki Walk_2222 Kalakaua Avenue\nHonolulu, Hawaii 96815", 405 | "icon": "assets/markercluster/marker.png" 406 | }, 407 | { 408 | "position": { 409 | "lat": 21.293045, 410 | "lng": -157.852223 411 | }, 412 | "name": "Starbucks - HI - Honolulu 03677", 413 | "address": "Ward Gateway_1142 Auahi Street\nHonolulu, Hawaii 96814", 414 | "icon": "assets/markercluster/marker.png" 415 | }, 416 | { 417 | "position": { 418 | "lat": 21.3067, 419 | "lng": -157.858444 420 | }, 421 | "name": "Starbucks - HI - Honolulu [A] 03678", 422 | "address": "HNL Honolulu Airport_300 Rogers Blvd\nHonolulu, Hawaii 96820", 423 | "icon": "assets/markercluster/marker.png" 424 | }, 425 | { 426 | "position": { 427 | "lat": 20.891963, 428 | "lng": -156.477614 429 | }, 430 | "name": "Starbucks - HI - Kahului 03679", 431 | "address": "Queen Kaahumanu Center_275 West Kaahuman Avenue #1200 F5\nKahului, Hawaii 96732", 432 | "icon": "assets/markercluster/marker.png" 433 | }, 434 | { 435 | "position": { 436 | "lat": 20.8843, 437 | "lng": -156.4583 438 | }, 439 | "name": "Starbucks - HI - Kahului 03680", 440 | "address": "Maui Marketplace_270 Dairy Road\nKahului, Hawaii 96732", 441 | "icon": "assets/markercluster/marker.png" 442 | }, 443 | { 444 | "position": { 445 | "lat": 21.39356972, 446 | "lng": -157.7403334 447 | }, 448 | "name": "Starbucks - HI - Kailua 03681", 449 | "address": "Kailua Village_539 Kailua Road\nKailua, Hawaii 96734", 450 | "icon": "assets/markercluster/marker.png" 451 | }, 452 | { 453 | "position": { 454 | "lat": 19.6512, 455 | "lng": -155.9944 456 | }, 457 | "name": "Starbucks - HI - Kailua-Kona 03682", 458 | "address": "Kona Coast Shopping Center_74-5588 Palani Road\nKailua-Kona, Hawaii 96740", 459 | "icon": "assets/markercluster/marker.png" 460 | }, 461 | { 462 | "position": { 463 | "lat": 19.8434, 464 | "lng": -155.7652 465 | }, 466 | "name": "Starbucks - HI - Kamuela 03683", 467 | "address": "Parker Ranch Center_67-1185 Mamalahoa Highway D108\nKamuela, Hawaii 96743", 468 | "icon": "assets/markercluster/marker.png" 469 | }, 470 | { 471 | "position": { 472 | "lat": 21.34306, 473 | "lng": -158.078906 474 | }, 475 | "name": "Starbucks - HI - Kapolei 03684", 476 | "address": "Halekuai Center_563 Farrington Highway #101\nKapolei, Hawaii 96707", 477 | "icon": "assets/markercluster/marker.png" 478 | }, 479 | { 480 | "position": { 481 | "lat": 21.336, 482 | "lng": -158.0802 483 | }, 484 | "name": "Starbucks - HI - Kapolei [D] 03685", 485 | "address": "Kapolei Parkway_338 Kamokila Boulevard #108\nKapolei, Hawaii 96797", 486 | "icon": "assets/markercluster/marker.png" 487 | }, 488 | { 489 | "position": { 490 | "lat": 20.740343, 491 | "lng": -156.456218 492 | }, 493 | "name": "Starbucks - HI - Kihei 03686", 494 | "address": "Kukui Mall_1819 South Kihei Road\nKihei, Hawaii 96738", 495 | "icon": "assets/markercluster/marker.png" 496 | }, 497 | { 498 | "position": { 499 | "lat": 20.7575, 500 | "lng": -156.4559 501 | }, 502 | "name": "Starbucks - HI - Kihei 03687", 503 | "address": "Piilani Village Shopping Center_247 Piikea Avenue #106\nKihei, Hawaii 96753", 504 | "icon": "assets/markercluster/marker.png" 505 | }, 506 | { 507 | "position": { 508 | "lat": 19.9338, 509 | "lng": -155.8422 510 | }, 511 | "name": "Starbucks - HI - Kohala Coast 03688", 512 | "address": "Mauna Lani_68-1330 Mauna Lani Drive H-101b\nKohala Coast, Hawaii 96743", 513 | "icon": "assets/markercluster/marker.png" 514 | }, 515 | { 516 | "position": { 517 | "lat": 20.886244, 518 | "lng": -156.684697 519 | }, 520 | "name": "Starbucks - HI - Lahaina 03689", 521 | "address": "Lahaina Cannery Mall_1221 Honoapiilani Highway\nLahaina, Hawaii 96761", 522 | "icon": "assets/markercluster/marker.png" 523 | }, 524 | { 525 | "position": { 526 | "lat": 20.8804, 527 | "lng": -156.6816 528 | }, 529 | "name": "Starbucks - HI - Lahaina 03690", 530 | "address": "Lahaina_845 Wainee Street\nLahaina, Hawaii 96761", 531 | "icon": "assets/markercluster/marker.png" 532 | }, 533 | { 534 | "position": { 535 | "lat": 21.970661, 536 | "lng": -159.396274 537 | }, 538 | "name": "Starbucks - HI - Lihue 03691", 539 | "address": "Kukui Grove_3-2600 Kaumualii Highway #A8\nLihue, Hawaii 96766", 540 | "icon": "assets/markercluster/marker.png" 541 | }, 542 | { 543 | "position": { 544 | "lat": 20.8818, 545 | "lng": -156.4633 546 | }, 547 | "name": "Starbucks - HI - Maui [A] 03692", 548 | "address": "OGG Kahului Main Concourse_New Terminal Bldg @ Bldg 340\nMaui, Hawaii 96732", 549 | "icon": "assets/markercluster/marker.png" 550 | }, 551 | { 552 | "position": { 553 | "lat": 21.4585, 554 | "lng": -158.0178 555 | }, 556 | "name": "Starbucks - HI - Mililani 03693", 557 | "address": "Mililani Shopping Center_95-221 Kipapa Drive\nMililani, Hawaii 96789", 558 | "icon": "assets/markercluster/marker.png" 559 | }, 560 | { 561 | "position": { 562 | "lat": 21.474341, 563 | "lng": -158.001864 564 | }, 565 | "name": "Starbucks - HI - Mililani 03694", 566 | "address": "Mililani Town Center_95-1249 Meheula Parkway\nMililani, Hawaii 96789", 567 | "icon": "assets/markercluster/marker.png" 568 | }, 569 | { 570 | "position": { 571 | "lat": 20.838965, 572 | "lng": -156.34192 573 | }, 574 | "name": "Starbucks - HI - Pukalani 03695", 575 | "address": "Pukalani Foodland_55 Pukalani Street\nPukalani, Hawaii 96768", 576 | "icon": "assets/markercluster/marker.png" 577 | }, 578 | { 579 | "position": { 580 | "lat": 21.378675, 581 | "lng": -157.728499 582 | }, 583 | "name": "Starbucks - HI - Waipahu 03696", 584 | "address": "Enchanted Lakes_1020 Keolu Drive\nWaipahu, Hawaii 96734", 585 | "icon": "assets/markercluster/marker.png" 586 | }, 587 | { 588 | "position": { 589 | "lat": 21.39662113, 590 | "lng": -158.0317397 591 | }, 592 | "name": "Starbucks - HI - Waipahu 03697", 593 | "address": "Kunia Shopping Center_94-673 Kupuohi Street\nWaipahu, Hawaii 96797", 594 | "icon": "assets/markercluster/marker.png" 595 | }, 596 | { 597 | "position": { 598 | "lat": 21.403688, 599 | "lng": -158.006128 600 | }, 601 | "name": "Starbucks - HI - Waipahu 03698", 602 | "address": "Waikele_94-799 Lumiaina Street\nWaipahu, Hawaii 96797", 603 | "icon": "assets/markercluster/marker.png" 604 | } 605 | ]; 606 | } 607 | } 608 | -------------------------------------------------------------------------------- /src/pages/marker/marker.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | MarkerPage 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 | -------------------------------------------------------------------------------- /src/pages/marker/marker.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { MarkerPage } from './marker'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | MarkerPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(MarkerPage), 11 | ], 12 | }) 13 | export class MarkerPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/marker/marker.scss: -------------------------------------------------------------------------------- 1 | page-marker { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/marker/marker.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | GoogleMapsEvent, 7 | ILatLng, 8 | Marker, 9 | BaseArrayClass 10 | } from '@ionic-native/google-maps'; 11 | 12 | /** 13 | * Generated class for the MarkerPage page. 14 | * 15 | * See https://ionicframework.com/docs/components/#navigation for more info on 16 | * Ionic pages and navigation. 17 | */ 18 | 19 | @IonicPage() 20 | @Component({ 21 | selector: 'page-marker', 22 | templateUrl: 'marker.html', 23 | }) 24 | export class MarkerPage { 25 | 26 | map: GoogleMap; 27 | 28 | constructor() { 29 | } 30 | ionViewDidLoad() { 31 | console.log('ionViewDidLoad MarkerPage'); 32 | this.loadMap(); 33 | } 34 | 35 | loadMap() { 36 | let POINTS: BaseArrayClass = new BaseArrayClass([ 37 | { 38 | position: {lat:41.79883, lng:140.75675}, 39 | iconData: "./assets/imgs/Number-1-icon.png" 40 | }, 41 | { 42 | position: {lat:41.799240000000005, lng:140.75875000000002}, 43 | iconData: "http://icons.iconarchive.com/icons/iconarchive/red-orb-alphabet/24/Number-2-icon.png" 44 | }, 45 | { 46 | position: {lat:41.797650000000004, lng:140.75905}, 47 | iconData: { 48 | url: "http://icons.iconarchive.com/icons/iconarchive/red-orb-alphabet/48/Number-3-icon.png", 49 | size: { 50 | width: 24, 51 | height: 24 52 | } 53 | } 54 | }, 55 | { 56 | position: {lat:41.79637, lng:140.76018000000002}, 57 | title: "4", 58 | iconData: "blue" 59 | }, 60 | { 61 | position: {lat:41.79567, lng:140.75845}, 62 | title: "5", 63 | iconData: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAACVUlEQVRIS8WWjVXCMBRGwwTqBMIEuAG4ARuIE6gTKBOgEyAT4AbABjKBMIE/C+h3m6S2pWlJ8BzfOTkpad6770teEzom3bZy/VbrpYTopDjJZ6w2c77X6p9j46SCUXvuYDxHq04BZ2rPHXa3y/DRqlPAmdqZW+hrkMZEq44F52q3oGTdrjEpqmPBudoxKVBVKqsU1THgPbW+klNUt4GHCn6idqEGuMveerUeXFGtNTCvah9qaz+n2gMmKMGBnLrfjPFcMirZ7231XUF19RUJkIhPZqXnT8AM9Osy62v0VPihUqIfjWwx1RkJvbxIpjArhabfbEJ6zQYwysiiT3CW8kJ6Q4BgqMALEnqVNAqQZGSkM/R7nMOBLhZ/B/ZQeg9V/1EsrpLy5dIqP8aAXV6WlQIlZrWq/wzeBK0DM3Y0vA0aAh8FPwTaBC7B2W8+qUOMT4l9dYUUrJK2k4tCOHl7O7zK+Xx69nbWU/iebgKz1+9E+OYPToR1fqOe+SquujeBWdzlYGBPohhjW9b2lGbRa72bwLdyml5d2auvaPyeTOzIw4MxzCkal8h8no3cqT3WJd0ExuFmOjXmlhRIXbnfKZQ7hfJ4HDTM8wVIMi6xJ01y3mV8E5glGlDRGIEKS75DrAtFn/0DA3x/b0ddZbPgGt23JnBW0agpKPzUGCvhoT4iv1HG9Zodtc6HGBTYnoXAXc3UR5SbBwK1d8y+8RUAzxNwU2orOwQeyolF/lLT7mUqQ8BqCj4Bt+j1lR0Cs3Sopt8GFLYNF/2JU7K2k6stePL7fwP/AER2xy+mY1/QAAAAAElFTkSuQmCC" 64 | }/*, 65 | { 66 | title: "6", 67 | position: {lat:41.794470000000004, lng:140.75714000000002}, 68 | iconData: window.location.href.replace(/\/([^\/]+)$/, "") + "/../images/number-6-icon.png" 69 | }, 70 | { 71 | position: {lat:41.795010000000005, lng:140.75611}, 72 | iconData: "cdvfile://" // The cdvfile:// protocol is acceptable. 73 | }, 74 | { 75 | position: {lat:41.79477000000001, lng:140.75484}, 76 | iconData: "file://" // The file:// protocol is also acceptable. 77 | }, 78 | { 79 | position: {lat:41.79576, lng:140.75475}, 80 | iconData: "/path/to/image/file" // Absolute path is also acceptable. 81 | } 82 | */ 83 | ]); 84 | 85 | let bounds: ILatLng[] = POINTS.map((data: any, idx: number) => { 86 | console.log(data); 87 | return data.position; 88 | }); 89 | 90 | this.map = GoogleMaps.create('map_canvas', { 91 | camera: { 92 | target: bounds 93 | } 94 | }); 95 | POINTS.forEach((data: any) => { 96 | data.disableAutoPan = true; 97 | let marker: Marker = this.map.addMarkerSync(data); 98 | marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(this.onMarkerClick); 99 | marker.on(GoogleMapsEvent.INFO_CLICK).subscribe(this.onMarkerClick); 100 | }); 101 | 102 | } 103 | 104 | onMarkerClick(params: any) { 105 | let marker: Marker = params[1]; 106 | let iconData: any = marker.get('iconData'); 107 | marker.setIcon(iconData); 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /src/pages/polygon/polygon.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | PolygonPage 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 | -------------------------------------------------------------------------------- /src/pages/polygon/polygon.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { PolygonPage } from './polygon'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | PolygonPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(PolygonPage), 11 | ], 12 | }) 13 | export class PolygonPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/polygon/polygon.scss: -------------------------------------------------------------------------------- 1 | page-polygon { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/polygon/polygon.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | GoogleMapsEvent, 7 | Marker, 8 | Polygon, 9 | BaseArrayClass, 10 | ILatLng, 11 | LatLng 12 | } from '@ionic-native/google-maps'; 13 | 14 | /** 15 | * Generated class for the PolygonPage page. 16 | * 17 | * See https://ionicframework.com/docs/components/#navigation for more info on 18 | * Ionic pages and navigation. 19 | */ 20 | 21 | @IonicPage() 22 | @Component({ 23 | selector: 'page-polygon', 24 | templateUrl: 'polygon.html', 25 | }) 26 | export class PolygonPage { 27 | 28 | map: GoogleMap; 29 | 30 | GORYOKAKU_POINTS: ILatLng[] = [ 31 | {lat: 41.79883, lng: 140.75675}, 32 | {lat: 41.799240000000005, lng: 140.75875000000002}, 33 | {lat: 41.797650000000004, lng: 140.75905}, 34 | {lat: 41.79637, lng: 140.76018000000002}, 35 | {lat: 41.79567, lng: 140.75845}, 36 | {lat: 41.794470000000004, lng: 140.75714000000002}, 37 | {lat: 41.795010000000005, lng: 140.75611}, 38 | {lat: 41.79477000000001, lng: 140.75484}, 39 | {lat: 41.79576, lng: 140.75475}, 40 | {lat: 41.796150000000004, lng: 140.75364000000002}, 41 | {lat: 41.79744, lng: 140.75454000000002}, 42 | {lat: 41.79909000000001, lng: 140.75465} 43 | ]; 44 | 45 | constructor() { 46 | } 47 | 48 | ionViewDidLoad() { 49 | console.log('ionViewDidLoad PolygonPage'); 50 | this.loadMap(); 51 | } 52 | 53 | loadMap() { 54 | this.map = GoogleMaps.create('map_canvas', { 55 | camera: { 56 | target: this.GORYOKAKU_POINTS 57 | } 58 | }); 59 | 60 | let polygon: Polygon = this.map.addPolygonSync({ 61 | 'points': this.GORYOKAKU_POINTS, 62 | 'strokeColor' : '#AA00FF', 63 | 'fillColor' : '#00FFAA', 64 | 'strokeWidth': 10 65 | }); 66 | 67 | let points: BaseArrayClass = polygon.getPoints(); 68 | 69 | points.forEach((latLng: ILatLng, idx: number) => { 70 | let marker: Marker = this.map.addMarkerSync({ 71 | draggable: true, 72 | position: latLng 73 | }); 74 | marker.on(GoogleMapsEvent.MARKER_DRAG).subscribe((params) => { 75 | let position: LatLng = params[0]; 76 | points.setAt(idx, position); 77 | }); 78 | }); 79 | 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/pages/polyline/polyline.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | PolylinePage 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 | -------------------------------------------------------------------------------- /src/pages/polyline/polyline.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { PolylinePage } from './polyline'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | PolylinePage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(PolylinePage), 11 | ], 12 | }) 13 | export class PolylinePageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/polyline/polyline.scss: -------------------------------------------------------------------------------- 1 | page-polyline { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/polyline/polyline.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | GoogleMapsEvent, 7 | Polyline, 8 | LatLng, 9 | Marker 10 | } from '@ionic-native/google-maps'; 11 | 12 | /** 13 | * Generated class for the PolylinePage page. 14 | * 15 | * See https://ionicframework.com/docs/components/#navigation for more info on 16 | * Ionic pages and navigation. 17 | */ 18 | 19 | @IonicPage() 20 | @Component({ 21 | selector: 'page-polyline', 22 | templateUrl: 'polyline.html', 23 | }) 24 | export class PolylinePage { 25 | 26 | map: GoogleMap; 27 | 28 | constructor() { 29 | } 30 | 31 | ionViewDidLoad() { 32 | console.log('ionViewDidLoad PolylinePage'); 33 | this.loadMap(); 34 | } 35 | 36 | loadMap() { 37 | let HND_AIR_PORT = {lat: 35.548852, lng: 139.784086}; 38 | let SFO_AIR_PORT = {lat: 37.615223, lng: -122.389979}; 39 | let HNL_AIR_PORT = {lat: 21.324513, lng: -157.925074}; 40 | let AIR_PORTS = [ 41 | HND_AIR_PORT, 42 | HNL_AIR_PORT, 43 | SFO_AIR_PORT 44 | ]; 45 | 46 | this.map = GoogleMaps.create('map_canvas', { 47 | camera: { 48 | target: AIR_PORTS 49 | } 50 | }); 51 | 52 | let polyline: Polyline = this.map.addPolylineSync({ 53 | points: AIR_PORTS, 54 | color: '#AA00FF', 55 | width: 10, 56 | geodesic: true, 57 | clickable: true // clickable = false in default 58 | }); 59 | 60 | polyline.on(GoogleMapsEvent.POLYLINE_CLICK).subscribe((params: any) => { 61 | let position: LatLng = params[0]; 62 | 63 | let marker: Marker = this.map.addMarkerSync({ 64 | position: position, 65 | title: position.toUrlValue(), 66 | disableAutoPan: true 67 | }); 68 | marker.showInfoWindow(); 69 | }); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/pages/street-view/street-view.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | StreetView 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 |
23 |
24 | -------------------------------------------------------------------------------- /src/pages/street-view/street-view.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { StreetViewPage } from './street-view'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | StreetViewPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(StreetViewPage), 11 | ], 12 | }) 13 | export class StreetViewPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/street-view/street-view.scss: -------------------------------------------------------------------------------- 1 | page-street-view { 2 | 3 | #map_canvas { 4 | position: absolute; 5 | bottom: 5%; 6 | right: 5%; 7 | width: 150px; 8 | height: 150px; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/pages/street-view/street-view.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage, NavController, NavParams } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | GoogleMapsEvent, 7 | ILatLng, 8 | Marker, 9 | StreetViewPanorama, 10 | StreetViewCameraPosition, 11 | StreetViewLocation 12 | } from '@ionic-native/google-maps'; 13 | 14 | 15 | /** 16 | * Generated class for the StreetViewPage page. 17 | * 18 | * See https://ionicframework.com/docs/components/#navigation for more info on 19 | * Ionic pages and navigation. 20 | */ 21 | 22 | @IonicPage() 23 | @Component({ 24 | selector: 'page-street-view', 25 | templateUrl: 'street-view.html', 26 | }) 27 | export class StreetViewPage { 28 | 29 | panorama: StreetViewPanorama; 30 | map: GoogleMap; 31 | marker: Marker; 32 | 33 | constructor(public navCtrl: NavController, public navParams: NavParams) { 34 | } 35 | 36 | ionViewDidLoad() { 37 | console.log('ionViewDidLoad StreetViewPage'); 38 | this.loadMap(); 39 | } 40 | 41 | loadMap() { 42 | let initialPos: ILatLng = {lat: 42.345573, lng: -71.098326}; 43 | 44 | // Create a map after the view is loaded. 45 | // (platform is already ready in app.component.ts) 46 | this.panorama = GoogleMaps.createPanorama('pano_canvas', { 47 | camera: { 48 | target: initialPos 49 | } 50 | }); 51 | this.map = GoogleMaps.create('map_canvas', { 52 | camera: { 53 | target: initialPos, 54 | zoom: 17 55 | } 56 | }); 57 | 58 | this.marker = this.map.addMarkerSync({ 59 | flat: true, 60 | position: initialPos 61 | }); 62 | 63 | // Move the marker position when the panorama camera has been moved. 64 | // (this.marker.position = this.panorama.position) 65 | this.panorama.bindTo('position', this.marker); 66 | 67 | // Move the map camera when the panorama camera has been moved. 68 | this.panorama.on(GoogleMapsEvent.PANORAMA_LOCATION_CHANGE).subscribe((params:any[]) => { 69 | let location: StreetViewLocation = params[0]; 70 | this.map.animateCamera({ 71 | target: location.latLng, 72 | duration: 1000 73 | }); 74 | }); 75 | 76 | // Change the marker bearing when the panorama camera is panning. 77 | this.panorama.on(GoogleMapsEvent.PANORAMA_CAMERA_CHANGE).subscribe((params: any[]) => { 78 | let camera: StreetViewCameraPosition = params[0]; 79 | this.marker.setRotation(camera.bearing - 180); 80 | }); 81 | 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/pages/tile-overlay/tile-overlay.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | TileOverlayPage 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |
22 | -------------------------------------------------------------------------------- /src/pages/tile-overlay/tile-overlay.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { IonicPageModule } from 'ionic-angular'; 3 | import { TileOverlayPage } from './tile-overlay'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | TileOverlayPage, 8 | ], 9 | imports: [ 10 | IonicPageModule.forChild(TileOverlayPage), 11 | ], 12 | }) 13 | export class TileOverlayPageModule {} 14 | -------------------------------------------------------------------------------- /src/pages/tile-overlay/tile-overlay.scss: -------------------------------------------------------------------------------- 1 | page-tile-overlay { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/tile-overlay/tile-overlay.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonicPage } from 'ionic-angular'; 3 | import { 4 | GoogleMaps, 5 | GoogleMap, 6 | GoogleMapsEvent 7 | } from '@ionic-native/google-maps'; 8 | 9 | /** 10 | * Generated class for the TileOverlayPage page. 11 | * 12 | * See https://ionicframework.com/docs/components/#navigation for more info on 13 | * Ionic pages and navigation. 14 | */ 15 | 16 | @IonicPage() 17 | @Component({ 18 | selector: 'page-tile-overlay', 19 | templateUrl: 'tile-overlay.html', 20 | }) 21 | export class TileOverlayPage { 22 | 23 | map: GoogleMap; 24 | 25 | constructor() { 26 | } 27 | 28 | ionViewDidLoad() { 29 | console.log('ionViewDidLoad TileOverlayPage'); 30 | this.loadMap(); 31 | } 32 | 33 | loadMap() { 34 | 35 | this.map = GoogleMaps.create('map_canvas'); 36 | 37 | this.map.addTileOverlaySync({ 38 | getTile: (x: number, y: number, zoom: number) => { 39 | return `http://tile.stamen.com/watercolor/${zoom}/${x}/${y}.jpg`; 40 | } 41 | }); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Check out https://googlechromelabs.github.io/sw-toolbox/ for 3 | * more info on how to use sw-toolbox to custom configure your service worker. 4 | */ 5 | 6 | 7 | 'use strict'; 8 | importScripts('./build/sw-toolbox.js'); 9 | 10 | self.toolbox.options.cache = { 11 | name: 'ionic-cache' 12 | }; 13 | 14 | // pre-cache our key assets 15 | self.toolbox.precache( 16 | [ 17 | './build/main.js', 18 | './build/vendor.js', 19 | './build/main.css', 20 | './build/polyfills.js', 21 | 'index.html', 22 | 'manifest.json' 23 | ] 24 | ); 25 | 26 | // dynamically cache any other local assets 27 | self.toolbox.router.any('/*', self.toolbox.fastest); 28 | 29 | // for any other requests go to the network, cache, 30 | // and then only use that cached resource if your user goes offline 31 | self.toolbox.router.default = self.toolbox.networkFirst; 32 | -------------------------------------------------------------------------------- /src/theme/variables.scss: -------------------------------------------------------------------------------- 1 | // Ionic Variables and Theming. For more info, please see: 2 | // http://ionicframework.com/docs/theming/ 3 | 4 | // Font path is used to include ionicons, 5 | // roboto, and noto sans fonts 6 | $font-path: "../assets/fonts"; 7 | 8 | 9 | // The app direction is used to include 10 | // rtl styles in your app. For more info, please see: 11 | // http://ionicframework.com/docs/theming/rtl-support/ 12 | $app-direction: ltr; 13 | 14 | 15 | @import "ionic.globals"; 16 | 17 | 18 | // Shared Variables 19 | // -------------------------------------------------- 20 | // To customize the look and feel of this app, you can override 21 | // the Sass variables found in Ionic's source scss files. 22 | // To view all the possible Ionic variables, see: 23 | // http://ionicframework.com/docs/theming/overriding-ionic-variables/ 24 | 25 | 26 | 27 | 28 | // Named Color Variables 29 | // -------------------------------------------------- 30 | // Named colors makes it easy to reuse colors on various components. 31 | // It's highly recommended to change the default colors 32 | // to match your app's branding. Ionic uses a Sass map of 33 | // colors so you can add, rename and remove colors as needed. 34 | // The "primary" color is the only required color in the map. 35 | 36 | $colors: ( 37 | primary: #488aff, 38 | secondary: #32db64, 39 | danger: #f53d3d, 40 | light: #f4f4f4, 41 | dark: #222 42 | ); 43 | 44 | 45 | // App iOS Variables 46 | // -------------------------------------------------- 47 | // iOS only Sass variables can go here 48 | 49 | 50 | 51 | 52 | // App Material Design Variables 53 | // -------------------------------------------------- 54 | // Material Design only Sass variables can go here 55 | 56 | 57 | 58 | 59 | // App Windows Variables 60 | // -------------------------------------------------- 61 | // Windows only Sass variables can go here 62 | 63 | 64 | 65 | 66 | // App Theme 67 | // -------------------------------------------------- 68 | // Ionic apps can have different themes applied, which can 69 | // then be future customized. This import comes last 70 | // so that the above variables are used and Ionic's 71 | // default are overridden. 72 | 73 | @import "ionic.theme.default"; 74 | 75 | 76 | // Ionicons 77 | // -------------------------------------------------- 78 | // The premium icon font for Ionic. For more info, please see: 79 | // http://ionicframework.com/docs/ionicons/ 80 | 81 | @import "ionic.ionicons"; 82 | 83 | 84 | // Fonts 85 | // -------------------------------------------------- 86 | 87 | @import "roboto"; 88 | @import "noto-sans"; 89 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": [ 8 | "dom", 9 | "es2015" 10 | ], 11 | "module": "es2015", 12 | "moduleResolution": "node", 13 | "sourceMap": true, 14 | "target": "es5" 15 | }, 16 | "include": [ 17 | "src/**/*.ts" 18 | ], 19 | "exclude": [ 20 | "node_modules", 21 | "src/**/*.spec.ts", 22 | "src/**/__tests__/*.ts" 23 | ], 24 | "compileOnSave": false, 25 | "atom": { 26 | "rewriteTsconfig": false 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-duplicate-variable": true, 4 | "no-unused-variable": [ 5 | true 6 | ] 7 | }, 8 | "rulesDirectory": [ 9 | "node_modules/tslint-eslint-rules/dist/rules" 10 | ] 11 | } 12 | --------------------------------------------------------------------------------