@@ -392,14 +392,14 @@ suspend fun deleteMap(mapName: String) {
392392 * The results are processed and printed once the search completes successfully.
393393 */
394394suspend fun searchNearby () {
395- val latitude = 37.7749 // San Francisco
395+ val latitude = 37.7749
396396 val longitude = - 122.4194
397397 val queryPosition = listOf (longitude, latitude)
398398
399399 // Set up the request for searching nearby places.
400400 val request = SearchNearbyRequest {
401- this .queryPosition = queryPosition // Set the position
402- this .queryRadius = 1000L // Radius in meters (1000 meters = 1 km)
401+ this .queryPosition = queryPosition
402+ this .queryRadius = 1000L
403403 }
404404
405405 GeoPlacesClient { region = " us-east-1" }.use { client ->
@@ -424,7 +424,7 @@ suspend fun searchNearby() {
424424 * @param searchQuery the search query to be used for the place search (ex, coffee shop)
425425 */
426426suspend fun searchText (searchQuery : String ) {
427- val latitude = 37.7749 // San Francisco
427+ val latitude = 37.7749
428428 val longitude = - 122.4194
429429 val queryPosition = listOf (longitude, latitude)
430430
@@ -475,7 +475,7 @@ suspend fun searchText(searchQuery: String) {
475475 * This method uses the latitude and longitude of San Francisco as the input, and prints the resulting address.
476476 */
477477suspend fun reverseGeocode () {
478- val latitude = 37.7749 // San Francisco
478+ val latitude = 37.7749
479479 val longitude = - 122.4194
480480 println (" Use latitude 37.7749 and longitude -122.4194" )
481481
@@ -528,7 +528,7 @@ suspend fun calcDistance(routeCalcName: String): CalculateRouteResponse {
528528 * @param routeCalcName the name of the route calculator to be created
529529 */
530530suspend fun createRouteCalculator (routeCalcName : String ): CreateRouteCalculatorResponse {
531- val dataSource = " Esri" // or "Here"
531+ val dataSource = " Esri"
532532
533533 val request = CreateRouteCalculatorRequest {
534534 this .calculatorName = routeCalcName
@@ -568,7 +568,7 @@ suspend fun getDevicePosition(trackerName: String, deviceId: String): GetDeviceP
568568 * @param deviceId the unique identifier of the device
569569 */
570570suspend fun updateDevicePosition (trackerName : String , deviceId : String ) {
571- val latitude = 37.7749 // Example: San Francisco
571+ val latitude = 37.7749
572572 val longitude = - 122.4194
573573
574574 val positionUpdate = DevicePositionUpdate {
@@ -620,11 +620,11 @@ suspend fun putGeofence(collectionName: String, geoId: String) {
620620 val geofenceGeometry = GeofenceGeometry {
621621 polygon = listOf (
622622 listOf (
623- listOf (- 122.3381 , 47.6101 ), // First point
623+ listOf (- 122.3381 , 47.6101 ),
624624 listOf (- 122.3281 , 47.6101 ),
625625 listOf (- 122.3281 , 47.6201 ),
626626 listOf (- 122.3381 , 47.6201 ),
627- listOf (- 122.3381 , 47.6101 ) // Closing the polygon
627+ listOf (- 122.3381 , 47.6101 )
628628 )
629629 )
630630 }
0 commit comments