Assigned
Status Update
Comments
ra...@google.com <ra...@google.com> #2
We are checking this issue internally.
[Deleted User] <[Deleted User]> #3
In order to see the location update Maps should be killed and restarted.
ma...@gmail.com <ma...@gmail.com> #4
My village street view plese research my village name masimadu
Description
========================================================================
#REMINDER: Please do not disclose any PII. Some examples of PII are email address, IP, contact number, any part of name, project numbers and billing accounts. Comments or attachments that include PII will be removed and restricted from public viewing as it may violate our security and privacy policies.
Please refrain from emailing a reply to a comment as this will make your email address visible. Instead, you may use the Issue Tracker’s comment feature for your replies.
It is OK to share your API Project ID, but _not_ API keys or client ID credentials.
To learn more about personal data, visit
========================================================================
Feature Request
-----------------------
What would you like to see us add to this API?
Issue report
----------------
What steps will reproduce the problem? Please provide a link to a
demonstration page if at all possible, or attach code.
1. Using Android emulator, mock location enabled in the Developer Options.
2. The following code example have the correct location in the location variable and set the mockLocation with the data.
There is no error or exception in the log file, but mock location doesn't appear on the Maps Preview.
val locationManager = getSystemService(LOCATION_SERVICE) as LocationManager
try {
locationManager.addTestProvider(TEST_LOCATION_PROVIDER_NAME,false, false,
false, false, false, true, true,
ProviderProperties.POWER_USAGE_LOW, ProviderProperties.ACCURACY_COARSE)
locationManager.setTestProviderEnabled(TEST_LOCATION_PROVIDER_NAME, true)
} catch (se: SecurityException) {
Log.e(LOG_TAG, "Not allowed operate as a test location provider")
throw se
}
fun receiveLocations(locationManager: LocationManager) {
Log.d(LOG_TAG, "Start receiving locations")
try {
asyncStub.startLocation(Empty.getDefaultInstance()).collect { location ->
Log.d(LOG_TAG, "Received location $location")
try {
val mockLocation = Location(TEST_LOCATION_PROVIDER_NAME)
mockLocation.latitude = location.latitude.toDouble()
mockLocation.longitude = location.longitude.toDouble()
mockLocation.altitude = 5.0
mockLocation.time = System.currentTimeMillis()
mockLocation.accuracy = 3F
mockLocation.speed = 0.01F
mockLocation.bearing = 1F
mockLocation.elapsedRealtimeNanos = location.unixEpochTimeMs
locationManager.setTestProviderLocation(TEST_LOCATION_PROVIDER_NAME, mockLocation)
} catch (se: SecurityException) {
Log.e(LOG_TAG, "Not allowed to set test location")
throw se
}
}
} catch (e: StatusException) {
Log.e(LOG_TAG, "Error requesting locations: $e")
}
}
3. Can you please suggest how we can see mock location on the maps.