├── .gitignore ├── .npmignore ├── .npmrc ├── LICENSE.md ├── README.md ├── demo ├── app │ ├── App_Resources │ │ ├── Android │ │ │ ├── AndroidManifest.xml │ │ │ ├── app.gradle │ │ │ ├── drawable-hdpi │ │ │ │ └── icon.png │ │ │ ├── drawable-ldpi │ │ │ │ └── icon.png │ │ │ ├── drawable-mdpi │ │ │ │ └── icon.png │ │ │ ├── drawable-nodpi │ │ │ │ └── splashscreen.9.png │ │ │ └── values │ │ │ │ └── nativescript_google_maps_api.xml │ │ └── iOS │ │ │ ├── Default-568h@2x.png │ │ │ ├── Default-667h@2x.png │ │ │ ├── Default-736h@3x.png │ │ │ ├── Default-Landscape-568h@2x.png │ │ │ ├── Default-Landscape-667h@2x.png │ │ │ ├── Default-Landscape.png │ │ │ ├── Default-Landscape@2x.png │ │ │ ├── Default-Landscape@3x.png │ │ │ ├── Default-Portrait.png │ │ │ ├── Default-Portrait@2x.png │ │ │ ├── Default.png │ │ │ ├── Default@2x.png │ │ │ ├── Icon-Small-50.png │ │ │ ├── Icon-Small-50@2x.png │ │ │ ├── Icon-Small.png │ │ │ ├── Icon-Small@2x.png │ │ │ ├── Info.plist │ │ │ ├── build.xcconfig │ │ │ ├── icon-40.png │ │ │ ├── icon-40@2x.png │ │ │ ├── icon-60.png │ │ │ ├── icon-60@2x.png │ │ │ ├── icon-72.png │ │ │ ├── icon-72@2x.png │ │ │ ├── icon-76.png │ │ │ ├── icon-76@2x.png │ │ │ ├── icon.png │ │ │ └── icon@2x.png │ ├── app.css │ ├── app.js │ ├── debug.js │ ├── main-page.js │ ├── main-page.xml │ ├── main-view-model.js │ ├── package.json │ └── references.d.ts ├── package.json └── screenshots │ ├── android.1.png │ ├── android.2.png │ ├── android.3.png │ └── android.4.png ├── index.android.ts ├── index.d.ts ├── index.ios.ts ├── package.json ├── platforms ├── android │ └── include.gradle └── ios │ └── Podfile ├── references.d.ts ├── tsconfig.json └── typings ├── android.d.ts ├── ios.d.ts ├── objc!GoogleMaps.d.ts └── objc!GoogleMapsBase.d.ts /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.js 3 | !demo/app/*.js 4 | *.map 5 | *.d.ts 6 | !references.d.ts 7 | !index.d.ts 8 | !typings/* 9 | typings-* 10 | out 11 | demo/platforms 12 | demo/node_modules 13 | .DS_Store 14 | *.log 15 | lib 16 | .tmp 17 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | demo/ 2 | demo.server 3 | *.ts 4 | !index.d.ts 5 | *.map 6 | *.json 7 | *.log 8 | .tmp 9 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | save-prefix='' 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | nativescript-google-maps-utils 2 | ================================== 3 | 4 | NativeScript Google Maps SDK utility library to support features such as marker clustering, heatmap, ... 5 | 6 | 7 | 8 | ![Andoird #1](./demo/screenshots/android.1.png "Andoird #1") 9 | ![Andoird #2](./demo/screenshots/android.2.png "Andoird #2") 10 | ![Andoird #3](./demo/screenshots/android.3.png "Andoird #3") 11 | ![Andoird #4](./demo/screenshots/android.4.png "Andoird #4") 12 | 13 | # State 14 | 15 | Android implemented. 16 | 17 | iOS not implemented. 18 | 19 | 20 | ## Dependencies 21 | 22 | * [nativescript-google-maps-sdk](https://github.com/dapriett/nativescript-google-maps-sdk) 23 | * https://github.com/googlemaps/android-maps-utils 24 | * https://github.com/googlemaps/google-maps-ios-utils 25 | 26 | # Install 27 | 28 | ``` 29 | tns plugin add nativescript-google-maps-utils 30 | ``` 31 | 32 | # Usage 33 | 34 | 35 | ``` 36 | var GoogleMaps = require('nativescript-google-maps-sdk'); 37 | var GoogleMapsUtils = require('nativescript-google-maps-utils'); 38 | 39 | 40 | function onMapReady(args) { 41 | 42 | var mapView = args.object; 43 | 44 | var positionSet = [ /* GoogleMaps.Position... */ ]; 45 | 46 | GoogleMapsUtils.setupHeatmap(mapView, positionSet); 47 | 48 | 49 | var markerSet = [ /* GoogleMaps.Marker... */ ]; 50 | 51 | GoogleMapsUtils.setupMarkerCluster(mapView, makerSet); 52 | 53 | } 54 | ... 55 | 56 | ``` 57 | 58 | ## Usage with TypeScript 59 | 60 | import using either of 61 | 62 | * `import GoogleMapsUtils = require("nativescript-google-maps-utils")` 63 | * `import * as GoogleMapsUtils from "nativescript-google-maps-utils"` 64 | 65 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/app.gradle: -------------------------------------------------------------------------------- 1 | // Add your native dependencies here: 2 | 3 | // Uncomment to add recyclerview-v7 dependency 4 | //dependencies { 5 | // compile 'com.android.support:recyclerview-v7:+' 6 | //} 7 | 8 | android { 9 | defaultConfig { 10 | generatedDensities = [] 11 | } 12 | aaptOptions { 13 | additionalParameters "--no-version-vectors" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/Android/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/Android/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/Android/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png -------------------------------------------------------------------------------- /demo/app/App_Resources/Android/values/nativescript_google_maps_api.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AIzaSyAtRVvG3Be3xXiZFR7xp-K-9hy4nZ4hMFs 4 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default-568h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default-667h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default-736h@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Landscape-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default-Landscape-568h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Landscape-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default-Landscape-667h@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default-Landscape.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default-Landscape@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Landscape@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default-Landscape@3x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default-Portrait.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default-Portrait@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Default@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Icon-Small-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Icon-Small-50.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Icon-Small-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Icon-Small-50@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Icon-Small.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/Icon-Small@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | icon.png 13 | CFBundleIcons 14 | 15 | CFBundlePrimaryIcon 16 | 17 | CFBundleIconFiles 18 | 19 | icon-40 20 | icon-60 21 | icon-72 22 | icon-76 23 | Icon-Small 24 | Icon-Small-50 25 | 26 | UIPrerenderedIcon 27 | 28 | 29 | 30 | CFBundleInfoDictionaryVersion 31 | 6.0 32 | CFBundleName 33 | ${PRODUCT_NAME} 34 | CFBundlePackageType 35 | APPL 36 | CFBundleShortVersionString 37 | 1.0 38 | CFBundleSignature 39 | ???? 40 | CFBundleVersion 41 | 1.0 42 | LSRequiresIPhoneOS 43 | 44 | UILaunchStoryboardName 45 | LaunchScreen 46 | UIRequiresFullScreen 47 | 48 | UIRequiredDeviceCapabilities 49 | 50 | armv7 51 | 52 | UISupportedInterfaceOrientations 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationLandscapeLeft 56 | UIInterfaceOrientationLandscapeRight 57 | 58 | UISupportedInterfaceOrientations~ipad 59 | 60 | UIInterfaceOrientationPortrait 61 | UIInterfaceOrientationPortraitUpsideDown 62 | UIInterfaceOrientationLandscapeLeft 63 | UIInterfaceOrientationLandscapeRight 64 | 65 | 66 | NSAppTransportSecurity 67 | 68 | NSAllowsArbitraryLoads 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/build.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/icon-40.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/icon-40@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/icon-60.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/icon-60@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/icon-72.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/icon-72@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/icon-76.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/icon-76@2x.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/icon.png -------------------------------------------------------------------------------- /demo/app/App_Resources/iOS/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/app/App_Resources/iOS/icon@2x.png -------------------------------------------------------------------------------- /demo/app/app.css: -------------------------------------------------------------------------------- 1 | .title { 2 | font-size: 30; 3 | horizontal-align: center; 4 | margin: 20; 5 | } 6 | 7 | button { 8 | font-size: 42; 9 | horizontal-align: center; 10 | } 11 | 12 | .message { 13 | font-size: 20; 14 | color: #284848; 15 | horizontal-align: center; 16 | margin: 0 20; 17 | text-align: center; 18 | } 19 | -------------------------------------------------------------------------------- /demo/app/app.js: -------------------------------------------------------------------------------- 1 | var application = require("application"); 2 | 3 | if (application.ios) { 4 | GMSServices.provideAPIKey("AIzaSyAtRVvG3Be3xXiZFR7xp-K-9hy4nZ4hMFs"); 5 | } 6 | 7 | var debug = require('./debug')(__filename); 8 | 9 | application.on(application.uncaughtErrorEvent, function (event) { 10 | debug('ERROR!'); 11 | var error = event.android || event.ios; 12 | debug('ERROR!', error.name, error.message, error.stackTrace, error.nativeException); 13 | }); 14 | 15 | 16 | application.start({ 17 | moduleName: "main-page" 18 | }); -------------------------------------------------------------------------------- /demo/app/debug.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var last = new Date(); 4 | 5 | function debug(label) { 6 | if (label.charAt(0) === '/') { 7 | label = label.substr(label.lastIndexOf('app/')); 8 | } 9 | return function () { 10 | if (!debug.debug) { 11 | return; 12 | } 13 | var args = Array.prototype.slice.call(arguments); 14 | args = args.map(function (value) { 15 | if (typeof value === 'object' && value instanceof Error) { 16 | return value; 17 | } 18 | if (typeof value === 'object' && value) { 19 | try { 20 | var cache = []; 21 | return JSON.stringify('length' in value ? Array.from(value) : value, function (key, value) { 22 | if (typeof value === 'object' && value !== null) { 23 | if (cache.indexOf(value) !== -1) { 24 | // Circular reference found, discard key 25 | return; 26 | } 27 | // Store value in our collection 28 | cache.push(value); 29 | } 30 | return value; 31 | }, 2); 32 | } catch (e) { 33 | return (value && typeof value.toString ? value.toString() : '?') + ' (serialization failed)'; 34 | } 35 | } 36 | return String(value); 37 | }); 38 | var timestamp = new Date(); 39 | if (label) { 40 | args.unshift(label); 41 | } 42 | args.unshift('DEBUG'); 43 | // args.unshift(timestamp.toJSON()); 44 | args.push('+' + (timestamp - last)); 45 | last = timestamp; 46 | console.log.apply(console, args); 47 | }; 48 | } 49 | 50 | debug.debug = true; 51 | 52 | module.exports = debug; 53 | -------------------------------------------------------------------------------- /demo/app/main-page.js: -------------------------------------------------------------------------------- 1 | var vmModule = require("./main-view-model"); 2 | var observableModule = require("tns-core-modules/data/observable"); 3 | var platform = require("tns-core-modules/platform"); 4 | var GoogleMaps = require("nativescript-google-maps-sdk"); 5 | var GoogleMapsUtils = require("nativescript-google-maps-utils"); 6 | // var GoogleMapsUtils = require("./dev"); 7 | var Image = require("ui/image").Image; 8 | var imageSource = require("image-source"); 9 | var Color = require("color").Color; 10 | 11 | var debug = require('./debug')(__filename); 12 | 13 | function wait(milliSeconds) { 14 | return new Promise(function (resolve, reject) { 15 | setTimeout(function () { 16 | resolve(milliSeconds); 17 | }, milliSeconds); 18 | }); 19 | } 20 | 21 | function pageLoaded(args) { 22 | var page = args.object; 23 | page.bindingContext = vmModule.mainViewModel; 24 | } 25 | exports.pageLoaded = pageLoaded; 26 | 27 | 28 | function configureMap(mapView, options) { 29 | 30 | if (platform.isAndroid) { 31 | 32 | options = options || {}; 33 | 34 | var uiSetting = mapView.gMap.getUiSettings(); 35 | 36 | if ('allGesturesEnabled' in options) { 37 | uiSetting.setAllGesturesEnabled(options.allGesturesEnabled); 38 | } 39 | if ('compassEnabled' in options) { 40 | uiSetting.setCompassEnabled(options.compassEnabled); 41 | } 42 | if ('indoorLevelPickerEnabled' in options) { 43 | uiSetting.setIndoorLevelPickerEnabled(options.indoorLevelPickerEnabled); 44 | } 45 | if ('mapToolbarEnabled' in options) { 46 | uiSetting.setMapToolbarEnabled(options.mapToolbarEnabled); 47 | } 48 | if ('myLocationButtonEnabled' in options) { 49 | uiSetting.setMyLocationButtonEnabled(options.myLocationButtonEnabled); 50 | } 51 | if ('rotateGesturesEnabled' in options) { 52 | uiSetting.setRotateGesturesEnabled(options.rotateGesturesEnabled); 53 | } 54 | if ('scrollGesturesEnabled' in options) { 55 | uiSetting.setScrollGesturesEnabled(options.scrollGesturesEnabled); 56 | } 57 | if ('tiltGesturesEnabled' in options) { 58 | uiSetting.setTiltGesturesEnabled(options.tiltGesturesEnabled); 59 | } 60 | if ('zoomControlsEnabled' in options) { 61 | uiSetting.setZoomControlsEnabled(options.zoomControlsEnabled); 62 | } 63 | if ('zoomGesturesEnabled' in options) { 64 | uiSetting.setZoomGesturesEnabled(options.zoomGesturesEnabled); 65 | } 66 | 67 | if ('myLocationEnabled' in options) { 68 | mapView.gMap.setMyLocationEnabled(options.myLocationEnabled); 69 | } 70 | if ('trafficEnabled' in options) { 71 | mapView.gMap.setTrafficEnabled(options.trafficEnabled); 72 | } 73 | 74 | } 75 | 76 | } 77 | 78 | function generateRandomPosition(position, distance) { 79 | var r = distance / 111300; 80 | 81 | var x = position[0]; 82 | var y = position[1]; 83 | 84 | var u = Math.random(); 85 | var v = Math.random(); 86 | 87 | var w = r * Math.sqrt(u); 88 | var t = 2 * Math.PI * v; 89 | 90 | var dx = w * Math.cos(t) / Math.cos(y); 91 | var xy = w * Math.sin(t); 92 | 93 | return [x + dx, y + xy]; 94 | } 95 | 96 | function onMapReady(args) { 97 | debug("onMapReady"); 98 | 99 | var mapView = args.object; 100 | 101 | configureMap(mapView, { 102 | compassEnabled: true, 103 | zoomControlsEnabled: true, 104 | myLocationButtonEnabled: false, 105 | mapToolbarEnabled: true, 106 | allGesturesEnabled: true, 107 | myLocationEnabled: false, 108 | trafficEnabled: true, 109 | }); 110 | 111 | debug("Setting a marker..."); 112 | 113 | var marker = new GoogleMaps.Marker(); 114 | marker.position = GoogleMaps.Position.positionFromLatLng(36.799441, 10.178554); 115 | marker.title = "Tunis"; 116 | marker.snippet = "Tunisia"; 117 | marker.userData = { 118 | index: -1 119 | }; 120 | mapView.addMarker(marker); 121 | 122 | 123 | var positionSet; 124 | var makerSet; 125 | 126 | positionSet = []; 127 | for (var i = 0; i < 200; i++) { 128 | positionSet.push(generateRandomPosition([36.845026, 10.325454], 10000)); 129 | } 130 | 131 | positionSet = positionSet.map(function (position) { 132 | return GoogleMaps.Position.positionFromLatLng(position[0], position[1]); 133 | }); 134 | 135 | GoogleMapsUtils.enableDebug(require('./debug')('nativescript-google-maps-utils')); 136 | 137 | GoogleMapsUtils.setupHeatmap(mapView, positionSet); 138 | 139 | setTimeout(function () { 140 | 141 | positionSet = []; 142 | for (var i = 0; i < 50; i++) { 143 | positionSet.push(generateRandomPosition([36.799441, 10.178554], 10000)); 144 | } 145 | 146 | makerSet = positionSet.map(function (position, index) { 147 | var marker = new GoogleMaps.Marker(); 148 | marker.position = GoogleMaps.Position.positionFromLatLng(position[0], position[1]); 149 | marker.title = "Title #" + index; 150 | marker.snippet = "Snippet #" + index; 151 | marker.userData = { 152 | index: index 153 | }; 154 | return marker; 155 | }); 156 | 157 | GoogleMapsUtils.setupMarkerCluster(mapView, makerSet); 158 | 159 | }, 10000) 160 | 161 | } 162 | 163 | var lastCamera = null; 164 | 165 | function onCameraChanged(args) { 166 | debug("Camera changed: " + JSON.stringify(args.camera), JSON.stringify(args.camera) === lastCamera); 167 | lastCamera = JSON.stringify(args.camera); 168 | } 169 | 170 | function onMarkerSelect(args) { 171 | // debug("Clicked on " + args.marker.title); 172 | debug("Clicked on marker " + (args.marker ? args.marker.title : '?')); 173 | } 174 | 175 | function onMarkerInfoWindowTapped(args) { 176 | debug("Clicked on window " + args.marker.title); 177 | } 178 | 179 | exports.onMapReady = onMapReady; 180 | exports.onCameraChanged = onCameraChanged; 181 | exports.onMarkerSelect = onMarkerSelect; 182 | exports.onMarkerInfoWindowTapped = onMarkerInfoWindowTapped; -------------------------------------------------------------------------------- /demo/app/main-page.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /demo/app/main-view-model.js: -------------------------------------------------------------------------------- 1 | var observable = require("data/observable"); 2 | var HelloWorldModel = (function (_super) { 3 | __extends(HelloWorldModel, _super); 4 | 5 | function HelloWorldModel() { 6 | _super.call(this); 7 | this.set("latitude", 36.800220); 8 | this.set("longitude", 10.186215); 9 | this.set("zoom", 8); 10 | this.set("bearing", 0); 11 | this.set("tilt", 0); 12 | this.set("padding", [40, 40, 40, 40]); 13 | } 14 | 15 | return HelloWorldModel; 16 | })(observable.Observable); 17 | exports.HelloWorldModel = HelloWorldModel; 18 | exports.mainViewModel = new HelloWorldModel(); -------------------------------------------------------------------------------- /demo/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tns-template-hello-world", 3 | "main": "app.js", 4 | "version": "1.5.1", 5 | "author": "Telerik ", 6 | "description": "Nativescript hello-world project template", 7 | "license": "Apache-2.0", 8 | "keywords": [ 9 | "telerik", 10 | "mobile", 11 | "nativescript", 12 | "{N}", 13 | "tns", 14 | "appbuilder", 15 | "template" 16 | ], 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/NativeScript/template-hello-world.git" 20 | }, 21 | "bugs": { 22 | "url": "https://github.com/NativeScript/template-hello-world/issues" 23 | }, 24 | "homepage": "https://github.com/NativeScript/template-hello-world", 25 | "android": { 26 | "v8Flags": "--expose_gc" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /demo/app/references.d.ts: -------------------------------------------------------------------------------- 1 | /// Enable smart suggestions and completions in Visual Studio Code JavaScript projects. 2 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "nativescript": { 3 | "id": "org.nativescript.demo", 4 | "tns-ios": { 5 | "version": "3.0.1" 6 | }, 7 | "tns-android": { 8 | "version": "3.0.1" 9 | } 10 | }, 11 | "dependencies": { 12 | "nativescript-google-maps-sdk": "^2.1.3", 13 | "nativescript-google-maps-utils": "^0.1.2", 14 | "tns-core-modules": "^3.0.1" 15 | }, 16 | "devDependencies": { 17 | "babel-traverse": "6.25.0", 18 | "babel-types": "6.25.0", 19 | "babylon": "6.17.3", 20 | "lazy": "1.0.11" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /demo/screenshots/android.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/screenshots/android.1.png -------------------------------------------------------------------------------- /demo/screenshots/android.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/screenshots/android.2.png -------------------------------------------------------------------------------- /demo/screenshots/android.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/screenshots/android.3.png -------------------------------------------------------------------------------- /demo/screenshots/android.4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naderio/nativescript-google-maps-utils/e27f68ee3e0153e778665b18ab89ae8d417897fa/demo/screenshots/android.4.png -------------------------------------------------------------------------------- /index.android.ts: -------------------------------------------------------------------------------- 1 | 2 | import * as utils from "tns-core-modules/utils/utils"; 3 | 4 | import { MapView, Marker, Position } from "nativescript-google-maps-sdk" 5 | 6 | const LatLng = com.google.android.gms.maps.model.LatLng; 7 | const PolylineOptions = com.google.android.gms.maps.model.PolylineOptions; 8 | const LatLngBounds = com.google.android.gms.maps.model.LatLngBounds; 9 | const CameraUpdateFactory = com.google.android.gms.maps.CameraUpdateFactory; 10 | 11 | const ClusterItem = com.google.maps.android.clustering.ClusterItem; 12 | const ClusterManager = com.google.maps.android.clustering.ClusterManager; 13 | const DefaultClusterRenderer = com.google.maps.android.clustering.view.DefaultClusterRenderer; 14 | 15 | const HeatmapTileProvider = com.google.maps.android.heatmaps.HeatmapTileProvider; 16 | 17 | const TileOverlayOptions = com.google.android.gms.maps.model.TileOverlayOptions; 18 | 19 | const debugNull = function (...args: Array): void { }; 20 | 21 | function debugDefault(...args: Array) { 22 | args = args.map((value) => { 23 | if (typeof value === 'object' && value) { 24 | try { 25 | value = JSON.stringify(value); 26 | } catch (e) { 27 | value = value.toString(); 28 | } 29 | } 30 | return value; 31 | }); 32 | args.unshift('nativescript-socket.io'); 33 | console.log.apply(console, args); 34 | } 35 | 36 | let debug = debugNull; 37 | 38 | export function enableDebug(debugFn: ((...args: Array) => any) = debugDefault): void { 39 | debug = debugFn; 40 | } 41 | 42 | export function disableDebug(): void { 43 | debug = debugNull; 44 | } 45 | 46 | 47 | const CustomClusterItem = java.lang.Object.extend({ 48 | 49 | interfaces: [ClusterItem], 50 | 51 | marker: null, // will be attached manually later 52 | 53 | init: function () { }, 54 | 55 | getMarker: function () { 56 | return this.marker; 57 | }, 58 | 59 | getPosition: function () { 60 | return this.marker.position.android; 61 | }, 62 | 63 | getTitle: function () { 64 | return this.marker.title; 65 | }, 66 | 67 | getSnippet: function () { 68 | return this.marker.snippet; 69 | }, 70 | 71 | }); 72 | 73 | 74 | const CustomClusterManager = ClusterManager.extend({ 75 | 76 | mapView: null, // will be attached manually later 77 | 78 | onMarkerClick(gmsMarker) { 79 | this.super.onMarkerClick(gmsMarker); 80 | let marker = this.mapView.findMarker((marker) => { 81 | if (marker.android.getId) { 82 | return marker.android.getId() === gmsMarker.getId(); 83 | } 84 | return marker.title === gmsMarker.getTitle() && marker.snippet === gmsMarker.getSnippet() && marker.position.android.equals(gmsMarker.getPosition()); 85 | }); 86 | marker && this.mapView.notifyMarkerTapped(marker); 87 | return false; 88 | }, 89 | 90 | onInfoWindowClick(gmsMarker) { 91 | this.super.onInfoWindowClick(gmsMarker); 92 | let marker = this.mapView.findMarker((marker) => { 93 | if (marker.android.getId) { 94 | return marker.android.getId() === gmsMarker.getId(); 95 | } 96 | return marker.title === gmsMarker.getTitle() && marker.snippet === gmsMarker.getSnippet() && marker.position.android.equals(gmsMarker.getPosition()); 97 | }); 98 | marker && this.mapView.notifyMarkerInfoWindowTapped(marker); 99 | return false; 100 | }, 101 | 102 | }); 103 | 104 | export function setupMarkerCluster(mapView: MapView, markers: Array, options) { 105 | debug('setupMarkerCluster'); 106 | 107 | var clusterManager = new CustomClusterManager(utils.ad.getApplicationContext(), mapView.gMap); 108 | 109 | clusterManager.mapView = mapView; 110 | 111 | if (mapView.gMap.setOnCameraIdleListener) { 112 | mapView.gMap.setOnCameraIdleListener(clusterManager); 113 | } else if (mapView.gMap.setOnCameraChangeListener) { 114 | mapView.gMap.setOnCameraChangeListener(clusterManager); 115 | } 116 | 117 | mapView.gMap.setOnMarkerClickListener(clusterManager); 118 | mapView.gMap.setOnInfoWindowClickListener(clusterManager); 119 | 120 | markers.forEach(function (marker) { 121 | let markerItem = new CustomClusterItem(); 122 | markerItem.marker = marker; 123 | clusterManager.addItem(markerItem); 124 | mapView._markers.push(marker); 125 | }); 126 | 127 | clusterManager.cluster(); 128 | 129 | } 130 | 131 | export interface IHeatmapConfig { 132 | 133 | provider: any, 134 | overlay: any, 135 | 136 | } 137 | 138 | export function setupHeatmap(mapView: MapView, positions: Array, config: IHeatmapConfig = null): IHeatmapConfig { 139 | debug('setupHeatmap'); 140 | 141 | var list = new java.util.ArrayList(); 142 | 143 | positions.forEach(function (position) { 144 | list.add(position.android); 145 | }); 146 | 147 | if (config) { 148 | 149 | config.overlay.clearTileCache(); 150 | config.provider.setData(list); 151 | 152 | } else { 153 | 154 | config = {}; 155 | 156 | config.provider = new HeatmapTileProvider.Builder() 157 | .data(list) 158 | .build(); 159 | 160 | config.overlay = mapView.gMap.addTileOverlay(new TileOverlayOptions().tileProvider(config.provider)); 161 | 162 | } 163 | 164 | return config; 165 | } 166 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | 2 | declare module "nativescript-google-maps-utils" { 3 | 4 | import { MapView, Position, Marker } from "nativescript-google-maps-sdk"; 5 | 6 | export function enableDebug(debugFn?: ((...args: Array) => any)): void; 7 | export function disableDebug(): void; 8 | 9 | export function setupMarkerCluster(mapView: MapView, markers: Array, options: any): void; 10 | 11 | export interface IHeatmapConfig { 12 | provider: any; 13 | overlay: any; 14 | } 15 | 16 | export function setupHeatmap(mapView: MapView, positions: Array, config?: IHeatmapConfig) : IHeatmapConfig; 17 | } 18 | -------------------------------------------------------------------------------- /index.ios.ts: -------------------------------------------------------------------------------- 1 | 2 | import * as utils from "tns-core-modules/utils/utils"; 3 | 4 | import { MapView, Marker, Position } from "nativescript-google-maps-sdk" 5 | 6 | 7 | const debugNull = function(...args: Array): void { }; 8 | 9 | function debugDefault(...args: Array) { 10 | args = args.map((value) => { 11 | if (typeof value === 'object' && value) { 12 | try { 13 | value = JSON.stringify(value); 14 | } catch (e) { 15 | value = value.toString(); 16 | } 17 | } 18 | return value; 19 | }); 20 | args.unshift('nativescript-socket.io'); 21 | console.log.apply(console, args); 22 | } 23 | 24 | let debug = debugNull; 25 | 26 | export function enableDebug(debugFn: ((...args: Array) => any) = debugDefault): void { 27 | debug = debugFn; 28 | } 29 | 30 | export function disableDebug(): void { 31 | debug = debugNull; 32 | } 33 | 34 | 35 | export function setupMarkerCluster(mapView: MapView, markers: Array, options) { 36 | debug('setupMarkerCluster'); 37 | // TODO 38 | } 39 | 40 | export interface IHeatmapConfig { 41 | 42 | } 43 | 44 | export function setupHeatmap(mapView: MapView, positions: Array, config: IHeatmapConfig = null) : IHeatmapConfig { 45 | debug('setupHeatmap'); 46 | // TODO 47 | return config; 48 | } 49 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nativescript-google-maps-utils", 3 | "version": "0.1.4", 4 | "description": "NativeScript Google Maps SDK utility library to support features such as marker clustering, heatmap, ...", 5 | "main": "index", 6 | "typings": "index.d.ts", 7 | "nativescript": { 8 | "platforms": { 9 | "ios": "2.0.0", 10 | "android": "2.0.0" 11 | } 12 | }, 13 | "scripts": { 14 | "build": "tsc", 15 | "test": "echo \"Error: no test specified\" && exit 1", 16 | "dev": "rsync -avz --delete ./*.js demo/app/dev/", 17 | "android-native-type-definition": "cd demo ; tns build android ; java -jar platforms/android/build-tools/dts-generator.jar -input platforms/android/build/intermediates/exploded-aar/com.google.android.gms/play-services-maps/11.0.0/jars/classes.jar -input platforms/android/build/intermediates/exploded-aar/com.google.maps.android/android-maps-utils/0.5/jars/classes.jar ; cp -f ./out/android.d.ts ../typings/android.d.ts ; xxxrm -fr ./out ; cd ..", 18 | "ios-native-type-definition": "cd demo ; TNS_TYPESCRIPT_DECLARATIONS_PATH=$(pwd)/typings tns build ios ; cp -f './typings/x86_64/objc!GoogleMaps'*'.d.ts' ../typings/ ; cp -f './typings/x86_64/objc!GoogleMaps.d.ts' ../typings/ios.d.ts ; xxxrm -fr ./typings* ; cd .." 19 | }, 20 | "repository": { 21 | "type": "git", 22 | "url": "git+https://github.com/naderio/nativescript-google-maps-utils.git" 23 | }, 24 | "keywords": [ 25 | "nativescript", 26 | "google-maps", 27 | "google maps", 28 | "marker cluster", 29 | "heatmap", 30 | "android", 31 | "ios" 32 | ], 33 | "author": "Nader Toukabri ", 34 | "license": "Unlicense", 35 | "bugs": { 36 | "url": "https://github.com/naderio/nativescript-google-maps-utils/issues" 37 | }, 38 | "homepage": "https://github.com/naderio/nativescript-google-maps-utils#readme", 39 | "devDependencies": { 40 | "tns-core-modules": "3.0.1", 41 | "tns-platform-declarations": "3.0.1", 42 | "typescript": "2.3.4" 43 | }, 44 | "dependencies": { 45 | "nativescript-google-maps-sdk": "*" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /platforms/android/include.gradle: -------------------------------------------------------------------------------- 1 | android { 2 | productFlavors { 3 | "nativescript-google-maps-utils" { 4 | dimension "nativescriptgooglemapsutils" 5 | } 6 | } 7 | } 8 | 9 | dependencies { 10 | compile 'com.google.maps.android:android-maps-utils:0.5' 11 | } 12 | -------------------------------------------------------------------------------- /platforms/ios/Podfile: -------------------------------------------------------------------------------- 1 | # pod 'Google-Maps-iOS-Utils', '~> 1.0' -------------------------------------------------------------------------------- /references.d.ts: -------------------------------------------------------------------------------- 1 | /// Needed for autocompletion and compilation. 2 | /// Needed for autocompletion and compilation. -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2015", 4 | "module": "commonjs", 5 | "removeComments": true, 6 | "experimentalDecorators": true, 7 | "lib": [ 8 | "es6" 9 | ], 10 | "sourceMap": true 11 | }, 12 | "files": [ 13 | 14 | "./node_modules/tns-platform-declarations/ios.d.ts", 15 | "./node_modules/tns-platform-declarations/android.d.ts", 16 | 17 | "./typings/android.d.ts", 18 | "./typings/ios.d.ts", 19 | 20 | "index.android.ts", 21 | "index.ios.ts" 22 | 23 | ], 24 | "compileOnSave": false 25 | } 26 | -------------------------------------------------------------------------------- /typings/android.d.ts: -------------------------------------------------------------------------------- 1 | declare module com { 2 | export module google { 3 | export module android { 4 | export module gms { 5 | 6 | export module maps { 7 | 8 | export module model { 9 | export class LatLng { } 10 | export class PolylineOptions { } 11 | export class LatLngBounds { } 12 | export class TileOverlayOptions { } 13 | } 14 | 15 | export class CameraUpdateFactory {} 16 | 17 | } 18 | 19 | } 20 | } 21 | } 22 | } 23 | 24 | declare module com { 25 | export module google { 26 | export module maps { 27 | export module android { 28 | 29 | export module clustering { 30 | export class ClusterItem {} 31 | export class ClusterManager {} 32 | export module view { 33 | export class DefaultClusterRenderer {} 34 | } 35 | } 36 | 37 | export module heatmaps { 38 | export class HeatmapTileProvider {} 39 | } 40 | 41 | } 42 | } 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /typings/ios.d.ts: -------------------------------------------------------------------------------- 1 | 2 | /// 3 | /// 4 | -------------------------------------------------------------------------------- /typings/objc!GoogleMaps.d.ts: -------------------------------------------------------------------------------- 1 | 2 | declare class GMSAddress extends NSObject implements NSCopying { 3 | 4 | static alloc(): GMSAddress; // inherited from NSObject 5 | 6 | static new(): GMSAddress; // inherited from NSObject 7 | 8 | readonly administrativeArea: string; 9 | 10 | readonly coordinate: CLLocationCoordinate2D; 11 | 12 | readonly country: string; 13 | 14 | readonly lines: NSArray; 15 | 16 | readonly locality: string; 17 | 18 | readonly postalCode: string; 19 | 20 | readonly subLocality: string; 21 | 22 | readonly thoroughfare: string; 23 | 24 | addressLine1(): string; 25 | 26 | addressLine2(): string; 27 | 28 | copyWithZone(zone: interop.Pointer | interop.Reference): any; 29 | } 30 | 31 | declare class GMSCALayer extends CALayer { 32 | 33 | static alloc(): GMSCALayer; // inherited from NSObject 34 | 35 | static layer(): GMSCALayer; // inherited from CALayer 36 | 37 | static new(): GMSCALayer; // inherited from NSObject 38 | } 39 | 40 | declare class GMSCameraPosition extends NSObject implements NSCopying, NSMutableCopying { 41 | 42 | static alloc(): GMSCameraPosition; // inherited from NSObject 43 | 44 | static cameraWithLatitudeLongitudeZoom(latitude: number, longitude: number, zoom: number): GMSCameraPosition; 45 | 46 | static cameraWithLatitudeLongitudeZoomBearingViewingAngle(latitude: number, longitude: number, zoom: number, bearing: number, viewingAngle: number): GMSCameraPosition; 47 | 48 | static cameraWithTargetZoom(target: CLLocationCoordinate2D, zoom: number): GMSCameraPosition; 49 | 50 | static cameraWithTargetZoomBearingViewingAngle(target: CLLocationCoordinate2D, zoom: number, bearing: number, viewingAngle: number): GMSCameraPosition; 51 | 52 | static new(): GMSCameraPosition; // inherited from NSObject 53 | 54 | static zoomAtCoordinateForMetersPerPoints(coordinate: CLLocationCoordinate2D, meters: number, points: number): number; 55 | 56 | readonly bearing: number; 57 | 58 | readonly target: CLLocationCoordinate2D; 59 | 60 | readonly viewingAngle: number; 61 | 62 | readonly zoom: number; 63 | 64 | constructor(o: { target: CLLocationCoordinate2D; zoom: number; bearing: number; viewingAngle: number; }); 65 | 66 | copyWithZone(zone: interop.Pointer | interop.Reference): any; 67 | 68 | initWithTargetZoomBearingViewingAngle(target: CLLocationCoordinate2D, zoom: number, bearing: number, viewingAngle: number): this; 69 | 70 | mutableCopyWithZone(zone: interop.Pointer | interop.Reference): any; 71 | } 72 | 73 | declare class GMSCameraUpdate extends NSObject { 74 | 75 | static alloc(): GMSCameraUpdate; // inherited from NSObject 76 | 77 | static fitBounds(bounds: GMSCoordinateBounds): GMSCameraUpdate; 78 | 79 | static fitBoundsWithEdgeInsets(bounds: GMSCoordinateBounds, edgeInsets: UIEdgeInsets): GMSCameraUpdate; 80 | 81 | static fitBoundsWithPadding(bounds: GMSCoordinateBounds, padding: number): GMSCameraUpdate; 82 | 83 | static new(): GMSCameraUpdate; // inherited from NSObject 84 | 85 | static scrollByXY(dX: number, dY: number): GMSCameraUpdate; 86 | 87 | static setCamera(camera: GMSCameraPosition): GMSCameraUpdate; 88 | 89 | static setTarget(target: CLLocationCoordinate2D): GMSCameraUpdate; 90 | 91 | static setTargetZoom(target: CLLocationCoordinate2D, zoom: number): GMSCameraUpdate; 92 | 93 | static zoomBy(delta: number): GMSCameraUpdate; 94 | 95 | static zoomByAtPoint(zoom: number, point: CGPoint): GMSCameraUpdate; 96 | 97 | static zoomIn(): GMSCameraUpdate; 98 | 99 | static zoomOut(): GMSCameraUpdate; 100 | 101 | static zoomTo(zoom: number): GMSCameraUpdate; 102 | } 103 | 104 | declare class GMSCircle extends GMSOverlay { 105 | 106 | static alloc(): GMSCircle; // inherited from NSObject 107 | 108 | static circleWithPositionRadius(position: CLLocationCoordinate2D, radius: number): GMSCircle; 109 | 110 | static new(): GMSCircle; // inherited from NSObject 111 | 112 | fillColor: UIColor; 113 | 114 | position: CLLocationCoordinate2D; 115 | 116 | radius: number; 117 | 118 | strokeColor: UIColor; 119 | 120 | strokeWidth: number; 121 | } 122 | 123 | declare const enum GMSFrameRate { 124 | 125 | kGMSFrameRatePowerSave = 0, 126 | 127 | kGMSFrameRateConservative = 1, 128 | 129 | kGMSFrameRateMaximum = 2 130 | } 131 | 132 | declare class GMSGeocoder extends NSObject { 133 | 134 | static alloc(): GMSGeocoder; // inherited from NSObject 135 | 136 | static geocoder(): GMSGeocoder; 137 | 138 | static new(): GMSGeocoder; // inherited from NSObject 139 | 140 | reverseGeocodeCoordinateCompletionHandler(coordinate: CLLocationCoordinate2D, handler: (p1: GMSReverseGeocodeResponse, p2: NSError) => void): void; 141 | } 142 | 143 | declare const enum GMSGeocoderErrorCode { 144 | 145 | kGMSGeocoderErrorInvalidCoordinate = 1, 146 | 147 | kGMSGeocoderErrorInternal = 2 148 | } 149 | 150 | declare function GMSGeometryArea(path: GMSPath): number; 151 | 152 | declare function GMSGeometryContainsLocation(point: CLLocationCoordinate2D, path: GMSPath, geodesic: boolean): boolean; 153 | 154 | declare function GMSGeometryDistance(from: CLLocationCoordinate2D, to: CLLocationCoordinate2D): number; 155 | 156 | declare function GMSGeometryHeading(from: CLLocationCoordinate2D, to: CLLocationCoordinate2D): number; 157 | 158 | declare function GMSGeometryInterpolate(from: CLLocationCoordinate2D, to: CLLocationCoordinate2D, fraction: number): CLLocationCoordinate2D; 159 | 160 | declare function GMSGeometryIsLocationOnPath(point: CLLocationCoordinate2D, path: GMSPath, geodesic: boolean): boolean; 161 | 162 | declare function GMSGeometryIsLocationOnPathTolerance(point: CLLocationCoordinate2D, path: GMSPath, geodesic: boolean, tolerance: number): boolean; 163 | 164 | declare function GMSGeometryLength(path: GMSPath): number; 165 | 166 | declare function GMSGeometryOffset(from: CLLocationCoordinate2D, distance: number, heading: number): CLLocationCoordinate2D; 167 | 168 | declare function GMSGeometrySignedArea(path: GMSPath): number; 169 | 170 | declare class GMSGroundOverlay extends GMSOverlay { 171 | 172 | static alloc(): GMSGroundOverlay; // inherited from NSObject 173 | 174 | static groundOverlayWithBoundsIcon(bounds: GMSCoordinateBounds, icon: UIImage): GMSGroundOverlay; 175 | 176 | static groundOverlayWithPositionIconZoomLevel(position: CLLocationCoordinate2D, icon: UIImage, zoomLevel: number): GMSGroundOverlay; 177 | 178 | static new(): GMSGroundOverlay; // inherited from NSObject 179 | 180 | anchor: CGPoint; 181 | 182 | bearing: number; 183 | 184 | bounds: GMSCoordinateBounds; 185 | 186 | icon: UIImage; 187 | 188 | opacity: number; 189 | 190 | position: CLLocationCoordinate2D; 191 | } 192 | 193 | declare class GMSIndoorBuilding extends NSObject { 194 | 195 | static alloc(): GMSIndoorBuilding; // inherited from NSObject 196 | 197 | static new(): GMSIndoorBuilding; // inherited from NSObject 198 | 199 | readonly defaultLevelIndex: number; 200 | 201 | readonly levels: NSArray; 202 | 203 | readonly underground: boolean; 204 | } 205 | 206 | declare class GMSIndoorDisplay extends NSObject { 207 | 208 | static alloc(): GMSIndoorDisplay; // inherited from NSObject 209 | 210 | static new(): GMSIndoorDisplay; // inherited from NSObject 211 | 212 | readonly activeBuilding: GMSIndoorBuilding; 213 | 214 | activeLevel: GMSIndoorLevel; 215 | 216 | delegate: GMSIndoorDisplayDelegate; 217 | } 218 | 219 | interface GMSIndoorDisplayDelegate extends NSObjectProtocol { 220 | 221 | didChangeActiveBuilding?(building: GMSIndoorBuilding): void; 222 | 223 | didChangeActiveLevel?(level: GMSIndoorLevel): void; 224 | } 225 | declare var GMSIndoorDisplayDelegate: { 226 | 227 | prototype: GMSIndoorDisplayDelegate; 228 | }; 229 | 230 | declare class GMSIndoorLevel extends NSObject { 231 | 232 | static alloc(): GMSIndoorLevel; // inherited from NSObject 233 | 234 | static new(): GMSIndoorLevel; // inherited from NSObject 235 | 236 | readonly name: string; 237 | 238 | readonly shortName: string; 239 | } 240 | 241 | declare const enum GMSLengthKind { 242 | 243 | kGMSLengthGeodesic = 0, 244 | 245 | kGMSLengthRhumb = 1, 246 | 247 | kGMSLengthProjected = 2 248 | } 249 | 250 | declare class GMSMapLayer extends GMSCALayer { 251 | 252 | static alloc(): GMSMapLayer; // inherited from NSObject 253 | 254 | static layer(): GMSMapLayer; // inherited from CALayer 255 | 256 | static new(): GMSMapLayer; // inherited from NSObject 257 | 258 | cameraBearing: number; 259 | 260 | cameraLatitude: number; 261 | 262 | cameraLongitude: number; 263 | 264 | cameraViewingAngle: number; 265 | 266 | cameraZoomLevel: number; 267 | } 268 | 269 | interface GMSMapPoint { 270 | x: number; 271 | y: number; 272 | } 273 | declare var GMSMapPoint: interop.StructType; 274 | 275 | declare function GMSMapPointDistance(a: GMSMapPoint, b: GMSMapPoint): number; 276 | 277 | declare function GMSMapPointInterpolate(a: GMSMapPoint, b: GMSMapPoint, t: number): GMSMapPoint; 278 | 279 | declare class GMSMapStyle extends NSObject { 280 | 281 | static alloc(): GMSMapStyle; // inherited from NSObject 282 | 283 | static new(): GMSMapStyle; // inherited from NSObject 284 | 285 | static styleWithContentsOfFileURLError(fileURL: NSURL): GMSMapStyle; 286 | 287 | static styleWithJSONStringError(style: string): GMSMapStyle; 288 | } 289 | 290 | declare class GMSMapView extends UIView { 291 | 292 | static alloc(): GMSMapView; // inherited from NSObject 293 | 294 | static appearance(): GMSMapView; // inherited from UIAppearance 295 | 296 | static appearanceForTraitCollection(trait: UITraitCollection): GMSMapView; // inherited from UIAppearance 297 | 298 | static appearanceForTraitCollectionWhenContainedIn(trait: UITraitCollection, ContainerClass: typeof NSObject): GMSMapView; // inherited from UIAppearance 299 | 300 | static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray): GMSMapView; // inherited from UIAppearance 301 | 302 | static appearanceWhenContainedIn(ContainerClass: typeof NSObject): GMSMapView; // inherited from UIAppearance 303 | 304 | static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray): GMSMapView; // inherited from UIAppearance 305 | 306 | static mapWithFrameCamera(frame: CGRect, camera: GMSCameraPosition): GMSMapView; 307 | 308 | static new(): GMSMapView; // inherited from NSObject 309 | 310 | buildingsEnabled: boolean; 311 | 312 | camera: GMSCameraPosition; 313 | 314 | cameraTargetBounds: GMSCoordinateBounds; 315 | 316 | delegate: GMSMapViewDelegate; 317 | 318 | readonly indoorDisplay: GMSIndoorDisplay; 319 | 320 | indoorEnabled: boolean; 321 | 322 | readonly layer: GMSMapLayer; 323 | 324 | mapStyle: GMSMapStyle; 325 | 326 | mapType: GMSMapViewType; 327 | 328 | readonly maxZoom: number; 329 | 330 | readonly minZoom: number; 331 | 332 | readonly myLocation: CLLocation; 333 | 334 | myLocationEnabled: boolean; 335 | 336 | padding: UIEdgeInsets; 337 | 338 | preferredFrameRate: GMSFrameRate; 339 | 340 | readonly projection: GMSProjection; 341 | 342 | selectedMarker: GMSMarker; 343 | 344 | readonly settings: GMSUISettings; 345 | 346 | trafficEnabled: boolean; 347 | 348 | animateToBearing(bearing: number): void; 349 | 350 | animateToCameraPosition(cameraPosition: GMSCameraPosition): void; 351 | 352 | animateToLocation(location: CLLocationCoordinate2D): void; 353 | 354 | animateToViewingAngle(viewingAngle: number): void; 355 | 356 | animateToZoom(zoom: number): void; 357 | 358 | animateWithCameraUpdate(cameraUpdate: GMSCameraUpdate): void; 359 | 360 | areEqualForRenderingPositionPosition(position: GMSCameraPosition, otherPosition: GMSCameraPosition): boolean; 361 | 362 | cameraForBoundsInsets(bounds: GMSCoordinateBounds, insets: UIEdgeInsets): GMSCameraPosition; 363 | 364 | clear(): void; 365 | 366 | moveCamera(update: GMSCameraUpdate): void; 367 | 368 | setMinZoomMaxZoom(minZoom: number, maxZoom: number): void; 369 | 370 | startRendering(): void; 371 | 372 | stopRendering(): void; 373 | } 374 | 375 | interface GMSMapViewDelegate extends NSObjectProtocol { 376 | 377 | didTapMyLocationButtonForMapView?(mapView: GMSMapView): boolean; 378 | 379 | mapViewDidBeginDraggingMarker?(mapView: GMSMapView, marker: GMSMarker): void; 380 | 381 | mapViewDidChangeCameraPosition?(mapView: GMSMapView, position: GMSCameraPosition): void; 382 | 383 | mapViewDidCloseInfoWindowOfMarker?(mapView: GMSMapView, marker: GMSMarker): void; 384 | 385 | mapViewDidDragMarker?(mapView: GMSMapView, marker: GMSMarker): void; 386 | 387 | mapViewDidEndDraggingMarker?(mapView: GMSMapView, marker: GMSMarker): void; 388 | 389 | mapViewDidFinishTileRendering?(mapView: GMSMapView): void; 390 | 391 | mapViewDidLongPressAtCoordinate?(mapView: GMSMapView, coordinate: CLLocationCoordinate2D): void; 392 | 393 | mapViewDidLongPressInfoWindowOfMarker?(mapView: GMSMapView, marker: GMSMarker): void; 394 | 395 | mapViewDidStartTileRendering?(mapView: GMSMapView): void; 396 | 397 | mapViewDidTapAtCoordinate?(mapView: GMSMapView, coordinate: CLLocationCoordinate2D): void; 398 | 399 | mapViewDidTapInfoWindowOfMarker?(mapView: GMSMapView, marker: GMSMarker): void; 400 | 401 | mapViewDidTapMarker?(mapView: GMSMapView, marker: GMSMarker): boolean; 402 | 403 | mapViewDidTapOverlay?(mapView: GMSMapView, overlay: GMSOverlay): void; 404 | 405 | mapViewDidTapPOIWithPlaceIDNameLocation?(mapView: GMSMapView, placeID: string, name: string, location: CLLocationCoordinate2D): void; 406 | 407 | mapViewIdleAtCameraPosition?(mapView: GMSMapView, position: GMSCameraPosition): void; 408 | 409 | mapViewMarkerInfoContents?(mapView: GMSMapView, marker: GMSMarker): UIView; 410 | 411 | mapViewMarkerInfoWindow?(mapView: GMSMapView, marker: GMSMarker): UIView; 412 | 413 | mapViewSnapshotReady?(mapView: GMSMapView): void; 414 | 415 | mapViewWillMove?(mapView: GMSMapView, gesture: boolean): void; 416 | } 417 | declare var GMSMapViewDelegate: { 418 | 419 | prototype: GMSMapViewDelegate; 420 | }; 421 | 422 | declare const enum GMSMapViewType { 423 | 424 | kGMSTypeNormal = 1, 425 | 426 | kGMSTypeSatellite = 2, 427 | 428 | kGMSTypeTerrain = 3, 429 | 430 | kGMSTypeHybrid = 4, 431 | 432 | kGMSTypeNone = 5 433 | } 434 | 435 | declare class GMSMarker extends GMSOverlay { 436 | 437 | static alloc(): GMSMarker; // inherited from NSObject 438 | 439 | static markerImageWithColor(color: UIColor): UIImage; 440 | 441 | static markerWithPosition(position: CLLocationCoordinate2D): GMSMarker; 442 | 443 | static new(): GMSMarker; // inherited from NSObject 444 | 445 | appearAnimation: GMSMarkerAnimation; 446 | 447 | draggable: boolean; 448 | 449 | flat: boolean; 450 | 451 | groundAnchor: CGPoint; 452 | 453 | icon: UIImage; 454 | 455 | iconView: UIView; 456 | 457 | infoWindowAnchor: CGPoint; 458 | 459 | readonly layer: GMSMarkerLayer; 460 | 461 | opacity: number; 462 | 463 | panoramaView: GMSPanoramaView; 464 | 465 | position: CLLocationCoordinate2D; 466 | 467 | rotation: number; 468 | 469 | snippet: string; 470 | 471 | tracksInfoWindowChanges: boolean; 472 | 473 | tracksViewChanges: boolean; 474 | } 475 | 476 | declare const enum GMSMarkerAnimation { 477 | 478 | kGMSMarkerAnimationNone = 0, 479 | 480 | kGMSMarkerAnimationPop = 1 481 | } 482 | 483 | declare class GMSMarkerLayer extends CALayer { 484 | 485 | static alloc(): GMSMarkerLayer; // inherited from NSObject 486 | 487 | static layer(): GMSMarkerLayer; // inherited from CALayer 488 | 489 | static new(): GMSMarkerLayer; // inherited from NSObject 490 | 491 | latitude: number; 492 | 493 | longitude: number; 494 | 495 | rotation: number; 496 | } 497 | 498 | declare class GMSMutableCameraPosition extends GMSCameraPosition { 499 | 500 | static alloc(): GMSMutableCameraPosition; // inherited from NSObject 501 | 502 | static cameraWithLatitudeLongitudeZoom(latitude: number, longitude: number, zoom: number): GMSMutableCameraPosition; // inherited from GMSCameraPosition 503 | 504 | static cameraWithLatitudeLongitudeZoomBearingViewingAngle(latitude: number, longitude: number, zoom: number, bearing: number, viewingAngle: number): GMSMutableCameraPosition; // inherited from GMSCameraPosition 505 | 506 | static cameraWithTargetZoom(target: CLLocationCoordinate2D, zoom: number): GMSMutableCameraPosition; // inherited from GMSCameraPosition 507 | 508 | static cameraWithTargetZoomBearingViewingAngle(target: CLLocationCoordinate2D, zoom: number, bearing: number, viewingAngle: number): GMSMutableCameraPosition; // inherited from GMSCameraPosition 509 | 510 | static new(): GMSMutableCameraPosition; // inherited from NSObject 511 | 512 | bearing: number; 513 | 514 | target: CLLocationCoordinate2D; 515 | 516 | viewingAngle: number; 517 | 518 | zoom: number; 519 | } 520 | 521 | declare class GMSMutablePath extends GMSPath { 522 | 523 | static alloc(): GMSMutablePath; // inherited from NSObject 524 | 525 | static new(): GMSMutablePath; // inherited from NSObject 526 | 527 | static path(): GMSMutablePath; // inherited from GMSPath 528 | 529 | static pathFromEncodedPath(encodedPath: string): GMSMutablePath; // inherited from GMSPath 530 | 531 | addCoordinate(coord: CLLocationCoordinate2D): void; 532 | 533 | addLatitudeLongitude(latitude: number, longitude: number): void; 534 | 535 | insertCoordinateAtIndex(coord: CLLocationCoordinate2D, index: number): void; 536 | 537 | removeAllCoordinates(): void; 538 | 539 | removeCoordinateAtIndex(index: number): void; 540 | 541 | removeLastCoordinate(): void; 542 | 543 | replaceCoordinateAtIndexWithCoordinate(index: number, coord: CLLocationCoordinate2D): void; 544 | } 545 | 546 | interface GMSOrientation { 547 | heading: number; 548 | pitch: number; 549 | } 550 | declare var GMSOrientation: interop.StructType; 551 | 552 | declare class GMSOverlay extends NSObject implements NSCopying { 553 | 554 | static alloc(): GMSOverlay; // inherited from NSObject 555 | 556 | static new(): GMSOverlay; // inherited from NSObject 557 | 558 | map: GMSMapView; 559 | 560 | tappable: boolean; 561 | 562 | title: string; 563 | 564 | userData: any; 565 | 566 | zIndex: number; 567 | 568 | copyWithZone(zone: interop.Pointer | interop.Reference): any; 569 | } 570 | 571 | declare class GMSPanorama extends NSObject { 572 | 573 | static alloc(): GMSPanorama; // inherited from NSObject 574 | 575 | static new(): GMSPanorama; // inherited from NSObject 576 | 577 | readonly coordinate: CLLocationCoordinate2D; 578 | 579 | readonly links: NSArray; 580 | 581 | readonly panoramaID: string; 582 | } 583 | 584 | declare class GMSPanoramaCamera extends NSObject { 585 | 586 | static alloc(): GMSPanoramaCamera; // inherited from NSObject 587 | 588 | static cameraWithHeadingPitchZoom(heading: number, pitch: number, zoom: number): GMSPanoramaCamera; 589 | 590 | static cameraWithHeadingPitchZoomFOV(heading: number, pitch: number, zoom: number, FOV: number): GMSPanoramaCamera; 591 | 592 | static cameraWithOrientationZoom(orientation: GMSOrientation, zoom: number): GMSPanoramaCamera; 593 | 594 | static cameraWithOrientationZoomFOV(orientation: GMSOrientation, zoom: number, FOV: number): GMSPanoramaCamera; 595 | 596 | static new(): GMSPanoramaCamera; // inherited from NSObject 597 | 598 | readonly FOV: number; 599 | 600 | readonly orientation: GMSOrientation; 601 | 602 | readonly zoom: number; 603 | 604 | constructor(o: { orientation: GMSOrientation; zoom: number; FOV: number; }); 605 | 606 | initWithOrientationZoomFOV(orientation: GMSOrientation, zoom: number, FOV: number): this; 607 | } 608 | 609 | declare class GMSPanoramaCameraUpdate extends NSObject { 610 | 611 | static alloc(): GMSPanoramaCameraUpdate; // inherited from NSObject 612 | 613 | static new(): GMSPanoramaCameraUpdate; // inherited from NSObject 614 | 615 | static rotateBy(deltaHeading: number): GMSPanoramaCameraUpdate; 616 | 617 | static setHeading(heading: number): GMSPanoramaCameraUpdate; 618 | 619 | static setPitch(pitch: number): GMSPanoramaCameraUpdate; 620 | 621 | static setZoom(zoom: number): GMSPanoramaCameraUpdate; 622 | } 623 | 624 | declare class GMSPanoramaLayer extends GMSCALayer { 625 | 626 | static alloc(): GMSPanoramaLayer; // inherited from NSObject 627 | 628 | static layer(): GMSPanoramaLayer; // inherited from CALayer 629 | 630 | static new(): GMSPanoramaLayer; // inherited from NSObject 631 | 632 | cameraFOV: number; 633 | 634 | cameraHeading: number; 635 | 636 | cameraPitch: number; 637 | 638 | cameraZoom: number; 639 | } 640 | 641 | declare class GMSPanoramaLink extends NSObject { 642 | 643 | static alloc(): GMSPanoramaLink; // inherited from NSObject 644 | 645 | static new(): GMSPanoramaLink; // inherited from NSObject 646 | 647 | heading: number; 648 | 649 | panoramaID: string; 650 | } 651 | 652 | declare class GMSPanoramaService extends NSObject { 653 | 654 | static alloc(): GMSPanoramaService; // inherited from NSObject 655 | 656 | static new(): GMSPanoramaService; // inherited from NSObject 657 | 658 | requestPanoramaNearCoordinateCallback(coordinate: CLLocationCoordinate2D, callback: (p1: GMSPanorama, p2: NSError) => void): void; 659 | 660 | requestPanoramaNearCoordinateRadiusCallback(coordinate: CLLocationCoordinate2D, radius: number, callback: (p1: GMSPanorama, p2: NSError) => void): void; 661 | 662 | requestPanoramaWithIDCallback(panoramaID: string, callback: (p1: GMSPanorama, p2: NSError) => void): void; 663 | } 664 | 665 | declare class GMSPanoramaView extends UIView { 666 | 667 | static alloc(): GMSPanoramaView; // inherited from NSObject 668 | 669 | static appearance(): GMSPanoramaView; // inherited from UIAppearance 670 | 671 | static appearanceForTraitCollection(trait: UITraitCollection): GMSPanoramaView; // inherited from UIAppearance 672 | 673 | static appearanceForTraitCollectionWhenContainedIn(trait: UITraitCollection, ContainerClass: typeof NSObject): GMSPanoramaView; // inherited from UIAppearance 674 | 675 | static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray): GMSPanoramaView; // inherited from UIAppearance 676 | 677 | static appearanceWhenContainedIn(ContainerClass: typeof NSObject): GMSPanoramaView; // inherited from UIAppearance 678 | 679 | static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray): GMSPanoramaView; // inherited from UIAppearance 680 | 681 | static new(): GMSPanoramaView; // inherited from NSObject 682 | 683 | static panoramaWithFrameNearCoordinate(frame: CGRect, coordinate: CLLocationCoordinate2D): GMSPanoramaView; 684 | 685 | static panoramaWithFrameNearCoordinateRadius(frame: CGRect, coordinate: CLLocationCoordinate2D, radius: number): GMSPanoramaView; 686 | 687 | camera: GMSPanoramaCamera; 688 | 689 | delegate: GMSPanoramaViewDelegate; 690 | 691 | readonly layer: GMSPanoramaLayer; 692 | 693 | navigationGestures: boolean; 694 | 695 | navigationLinksHidden: boolean; 696 | 697 | orientationGestures: boolean; 698 | 699 | panorama: GMSPanorama; 700 | 701 | streetNamesHidden: boolean; 702 | 703 | zoomGestures: boolean; 704 | 705 | animateToCameraAnimationDuration(camera: GMSPanoramaCamera, duration: number): void; 706 | 707 | moveNearCoordinate(coordinate: CLLocationCoordinate2D): void; 708 | 709 | moveNearCoordinateRadius(coordinate: CLLocationCoordinate2D, radius: number): void; 710 | 711 | moveToPanoramaID(panoramaID: string): void; 712 | 713 | orientationForPoint(point: CGPoint): GMSOrientation; 714 | 715 | pointForOrientation(orientation: GMSOrientation): CGPoint; 716 | 717 | setAllGesturesEnabled(enabled: boolean): void; 718 | 719 | updateCameraAnimationDuration(cameraUpdate: GMSPanoramaCameraUpdate, duration: number): void; 720 | } 721 | 722 | interface GMSPanoramaViewDelegate extends NSObjectProtocol { 723 | 724 | panoramaViewDidFinishRendering?(panoramaView: GMSPanoramaView): void; 725 | 726 | panoramaViewDidMoveCamera?(panoramaView: GMSPanoramaView, camera: GMSPanoramaCamera): void; 727 | 728 | panoramaViewDidMoveToPanorama?(view: GMSPanoramaView, panorama: GMSPanorama): void; 729 | 730 | panoramaViewDidMoveToPanoramaNearCoordinate?(view: GMSPanoramaView, panorama: GMSPanorama, coordinate: CLLocationCoordinate2D): void; 731 | 732 | panoramaViewDidStartRendering?(panoramaView: GMSPanoramaView): void; 733 | 734 | panoramaViewDidTap?(panoramaView: GMSPanoramaView, point: CGPoint): void; 735 | 736 | panoramaViewDidTapMarker?(panoramaView: GMSPanoramaView, marker: GMSMarker): boolean; 737 | 738 | panoramaViewErrorOnMoveNearCoordinate?(view: GMSPanoramaView, error: NSError, coordinate: CLLocationCoordinate2D): void; 739 | 740 | panoramaViewErrorOnMoveToPanoramaID?(view: GMSPanoramaView, error: NSError, panoramaID: string): void; 741 | 742 | panoramaViewWillMoveToPanoramaID?(view: GMSPanoramaView, panoramaID: string): void; 743 | } 744 | declare var GMSPanoramaViewDelegate: { 745 | 746 | prototype: GMSPanoramaViewDelegate; 747 | }; 748 | 749 | declare class GMSPath extends NSObject implements NSCopying, NSMutableCopying { 750 | 751 | static alloc(): GMSPath; // inherited from NSObject 752 | 753 | static new(): GMSPath; // inherited from NSObject 754 | 755 | static path(): GMSPath; 756 | 757 | static pathFromEncodedPath(encodedPath: string): GMSPath; 758 | 759 | constructor(o: { path: GMSPath; }); 760 | 761 | coordinateAtIndex(index: number): CLLocationCoordinate2D; 762 | 763 | copyWithZone(zone: interop.Pointer | interop.Reference): any; 764 | 765 | count(): number; 766 | 767 | encodedPath(): string; 768 | 769 | initWithPath(path: GMSPath): this; 770 | 771 | lengthOfKind(kind: GMSLengthKind): number; 772 | 773 | mutableCopyWithZone(zone: interop.Pointer | interop.Reference): any; 774 | 775 | pathOffsetByLatitudeLongitude(deltaLatitude: number, deltaLongitude: number): this; 776 | 777 | segmentsForLengthKind(length: number, kind: GMSLengthKind): number; 778 | } 779 | 780 | declare class GMSPolygon extends GMSOverlay { 781 | 782 | static alloc(): GMSPolygon; // inherited from NSObject 783 | 784 | static new(): GMSPolygon; // inherited from NSObject 785 | 786 | static polygonWithPath(path: GMSPath): GMSPolygon; 787 | 788 | fillColor: UIColor; 789 | 790 | geodesic: boolean; 791 | 792 | holes: NSArray; 793 | 794 | path: GMSPath; 795 | 796 | strokeColor: UIColor; 797 | 798 | strokeWidth: number; 799 | } 800 | 801 | declare class GMSPolyline extends GMSOverlay { 802 | 803 | static alloc(): GMSPolyline; // inherited from NSObject 804 | 805 | static new(): GMSPolyline; // inherited from NSObject 806 | 807 | static polylineWithPath(path: GMSPath): GMSPolyline; 808 | 809 | geodesic: boolean; 810 | 811 | path: GMSPath; 812 | 813 | spans: NSArray; 814 | 815 | strokeColor: UIColor; 816 | 817 | strokeWidth: number; 818 | } 819 | 820 | declare function GMSProject(coordinate: CLLocationCoordinate2D): GMSMapPoint; 821 | 822 | declare class GMSProjection extends NSObject { 823 | 824 | static alloc(): GMSProjection; // inherited from NSObject 825 | 826 | static new(): GMSProjection; // inherited from NSObject 827 | 828 | containsCoordinate(coordinate: CLLocationCoordinate2D): boolean; 829 | 830 | coordinateForPoint(point: CGPoint): CLLocationCoordinate2D; 831 | 832 | pointForCoordinate(coordinate: CLLocationCoordinate2D): CGPoint; 833 | 834 | pointsForMetersAtCoordinate(meters: number, coordinate: CLLocationCoordinate2D): number; 835 | 836 | visibleRegion(): GMSVisibleRegion; 837 | } 838 | 839 | declare class GMSReverseGeocodeResponse extends NSObject implements NSCopying { 840 | 841 | static alloc(): GMSReverseGeocodeResponse; // inherited from NSObject 842 | 843 | static new(): GMSReverseGeocodeResponse; // inherited from NSObject 844 | 845 | copyWithZone(zone: interop.Pointer | interop.Reference): any; 846 | 847 | firstResult(): GMSAddress; 848 | 849 | results(): NSArray; 850 | } 851 | 852 | declare class GMSServices extends NSObject { 853 | 854 | static SDKVersion(): string; 855 | 856 | static alloc(): GMSServices; // inherited from NSObject 857 | 858 | static new(): GMSServices; // inherited from NSObject 859 | 860 | static openSourceLicenseInfo(): string; 861 | 862 | static provideAPIKey(APIKey: string): boolean; 863 | 864 | static sharedServices(): NSObjectProtocol; 865 | } 866 | 867 | declare class GMSStrokeStyle extends NSObject { 868 | 869 | static alloc(): GMSStrokeStyle; // inherited from NSObject 870 | 871 | static gradientFromColorToColor(fromColor: UIColor, toColor: UIColor): GMSStrokeStyle; 872 | 873 | static new(): GMSStrokeStyle; // inherited from NSObject 874 | 875 | static solidColor(color: UIColor): GMSStrokeStyle; 876 | } 877 | 878 | declare class GMSStyleSpan extends NSObject { 879 | 880 | static alloc(): GMSStyleSpan; // inherited from NSObject 881 | 882 | static new(): GMSStyleSpan; // inherited from NSObject 883 | 884 | static spanWithColor(color: UIColor): GMSStyleSpan; 885 | 886 | static spanWithColorSegments(color: UIColor, segments: number): GMSStyleSpan; 887 | 888 | static spanWithStyle(style: GMSStrokeStyle): GMSStyleSpan; 889 | 890 | static spanWithStyleSegments(style: GMSStrokeStyle, segments: number): GMSStyleSpan; 891 | 892 | readonly segments: number; 893 | 894 | readonly style: GMSStrokeStyle; 895 | } 896 | 897 | declare function GMSStyleSpans(path: GMSPath, styles: NSArray, lengths: NSArray, lengthKind: GMSLengthKind): NSArray; 898 | 899 | declare function GMSStyleSpansOffset(path: GMSPath, styles: NSArray, lengths: NSArray, lengthKind: GMSLengthKind, lengthOffset: number): NSArray; 900 | 901 | declare class GMSSyncTileLayer extends GMSTileLayer { 902 | 903 | static alloc(): GMSSyncTileLayer; // inherited from NSObject 904 | 905 | static new(): GMSSyncTileLayer; // inherited from NSObject 906 | 907 | tileForXYZoom(x: number, y: number, zoom: number): UIImage; 908 | } 909 | 910 | declare class GMSTileLayer extends NSObject { 911 | 912 | static alloc(): GMSTileLayer; // inherited from NSObject 913 | 914 | static new(): GMSTileLayer; // inherited from NSObject 915 | 916 | fadeIn: boolean; 917 | 918 | map: GMSMapView; 919 | 920 | opacity: number; 921 | 922 | tileSize: number; 923 | 924 | zIndex: number; 925 | 926 | clearTileCache(): void; 927 | 928 | requestTileForXYZoomReceiver(x: number, y: number, zoom: number, receiver: GMSTileReceiver): void; 929 | } 930 | 931 | interface GMSTileReceiver extends NSObjectProtocol { 932 | 933 | receiveTileWithXYZoomImage(x: number, y: number, zoom: number, image: UIImage): void; 934 | } 935 | declare var GMSTileReceiver: { 936 | 937 | prototype: GMSTileReceiver; 938 | }; 939 | 940 | declare class GMSUISettings extends NSObject { 941 | 942 | static alloc(): GMSUISettings; // inherited from NSObject 943 | 944 | static new(): GMSUISettings; // inherited from NSObject 945 | 946 | allowScrollGesturesDuringRotateOrZoom: boolean; 947 | 948 | compassButton: boolean; 949 | 950 | consumesGesturesInView: boolean; 951 | 952 | indoorPicker: boolean; 953 | 954 | myLocationButton: boolean; 955 | 956 | rotateGestures: boolean; 957 | 958 | scrollGestures: boolean; 959 | 960 | tiltGestures: boolean; 961 | 962 | zoomGestures: boolean; 963 | 964 | setAllGesturesEnabled(enabled: boolean): void; 965 | } 966 | 967 | declare class GMSURLTileLayer extends GMSTileLayer { 968 | 969 | static alloc(): GMSURLTileLayer; // inherited from NSObject 970 | 971 | static new(): GMSURLTileLayer; // inherited from NSObject 972 | 973 | static tileLayerWithURLConstructor(constructor: (p1: number, p2: number, p3: number) => NSURL): GMSURLTileLayer; 974 | 975 | userAgent: string; 976 | } 977 | 978 | declare function GMSUnproject(point: GMSMapPoint): CLLocationCoordinate2D; 979 | 980 | interface GMSVisibleRegion { 981 | nearLeft: CLLocationCoordinate2D; 982 | nearRight: CLLocationCoordinate2D; 983 | farLeft: CLLocationCoordinate2D; 984 | farRight: CLLocationCoordinate2D; 985 | } 986 | declare var GMSVisibleRegion: interop.StructType; 987 | 988 | declare var kGMSAccessibilityCompass: string; 989 | 990 | declare var kGMSAccessibilityMyLocation: string; 991 | 992 | declare var kGMSEarthRadius: number; 993 | 994 | declare var kGMSEquatorProjectedMeter: number; 995 | 996 | declare var kGMSGroundOverlayDefaultAnchor: CGPoint; 997 | 998 | declare var kGMSLayerCameraBearingKey: string; 999 | 1000 | declare var kGMSLayerCameraLatitudeKey: string; 1001 | 1002 | declare var kGMSLayerCameraLongitudeKey: string; 1003 | 1004 | declare var kGMSLayerCameraViewingAngleKey: string; 1005 | 1006 | declare var kGMSLayerCameraZoomLevelKey: string; 1007 | 1008 | declare var kGMSLayerPanoramaFOVKey: string; 1009 | 1010 | declare var kGMSLayerPanoramaHeadingKey: string; 1011 | 1012 | declare var kGMSLayerPanoramaPitchKey: string; 1013 | 1014 | declare var kGMSLayerPanoramaZoomKey: string; 1015 | 1016 | declare var kGMSMarkerDefaultGroundAnchor: CGPoint; 1017 | 1018 | declare var kGMSMarkerDefaultInfoWindowAnchor: CGPoint; 1019 | 1020 | declare var kGMSMarkerLayerLatitude: string; 1021 | 1022 | declare var kGMSMarkerLayerLongitude: string; 1023 | 1024 | declare var kGMSMarkerLayerOpacity: string; 1025 | 1026 | declare var kGMSMarkerLayerRotation: string; 1027 | 1028 | declare var kGMSMaxZoomLevel: number; 1029 | 1030 | declare var kGMSMinZoomLevel: number; 1031 | 1032 | declare var kGMSTileLayerNoTile: UIImage; 1033 | -------------------------------------------------------------------------------- /typings/objc!GoogleMapsBase.d.ts: -------------------------------------------------------------------------------- 1 | 2 | declare class GMSCoordinateBounds extends NSObject { 3 | 4 | static alloc(): GMSCoordinateBounds; // inherited from NSObject 5 | 6 | static new(): GMSCoordinateBounds; // inherited from NSObject 7 | 8 | readonly northEast: CLLocationCoordinate2D; 9 | 10 | readonly southWest: CLLocationCoordinate2D; 11 | 12 | readonly valid: boolean; 13 | 14 | constructor(o: { coordinate: CLLocationCoordinate2D; coordinate2: CLLocationCoordinate2D; }); 15 | 16 | constructor(o: { path: GMSPath; }); 17 | 18 | constructor(o: { region: GMSVisibleRegion; }); 19 | 20 | containsCoordinate(coordinate: CLLocationCoordinate2D): boolean; 21 | 22 | includingBounds(other: GMSCoordinateBounds): GMSCoordinateBounds; 23 | 24 | includingCoordinate(coordinate: CLLocationCoordinate2D): GMSCoordinateBounds; 25 | 26 | includingPath(path: GMSPath): GMSCoordinateBounds; 27 | 28 | initWithCoordinateCoordinate(coord1: CLLocationCoordinate2D, coord2: CLLocationCoordinate2D): this; 29 | 30 | initWithPath(path: GMSPath): this; 31 | 32 | initWithRegion(region: GMSVisibleRegion): this; 33 | 34 | intersectsBounds(other: GMSCoordinateBounds): boolean; 35 | } 36 | --------------------------------------------------------------------------------