Status Update
Comments
ga...@gmail.com <ga...@gmail.com> #2
ma...@googlemail.com <ma...@googlemail.com> #3
The implementation of my project is not different from the example project attached by fernando.
ob...@gmail.com <ob...@gmail.com> #4
ro...@gmail.com <ro...@gmail.com> #5
va...@gmail.com <va...@gmail.com> #6
du...@gmail.com <du...@gmail.com> #7
As an alternative I am using FusedLocationProviderClient with PendingIntent:
IntentFilter intentFilter = new IntentFilter(ACTION_LOCATION);
registerReceiver(locationReceiver, intentFilter);
mFusedLocationClient.requestLocationUpdates(mLocationRequest, locationPendingIntent);
and
unregisterReceiver(locationReceiver);
mFusedLocationClient.removeLocationUpdates(locationPendingIntent)
Here is forked LocationUpdates repo with LeakCanary installed and an option to switch between LocationCallback and PendingIntent. LeakCanary not reporting anything when using PendingIntent.
kl...@gmail.com <kl...@gmail.com> #8
fl...@googlemail.com <fl...@googlemail.com> #9
ka...@gmail.com <ka...@gmail.com> #10
ar...@gmail.com <ar...@gmail.com> #11
ar...@gmail.com <ar...@gmail.com> #12
There is an issuetracker Component available these days for Play Services Location:
Maybe move this issue to that Component to track it better?
ob...@gmail.com <ob...@gmail.com> #13
I can't move it right now, but I think it's ok to stay here.
As I wrote in the code lab issue, I misunderstood when the rewrite went out (which should fix the issue).
It goes live in version 20 (current version location 19.0.1). The engineer who wrote the rewrite checked and wasn't seeing the same issue, i.e., it should be resolved.
However, that does mean we have to wait until 20 is released. I can check in again here when it's live for you to double check.
da...@gmail.com <da...@gmail.com> #14
ar...@gmail.com <ar...@gmail.com> #15
I haven't been on location in awhile, but I wanted to follow up on this.
The issue should be resolved with
ar...@gmail.com <ar...@gmail.com> #16
We may consider that as bug from usage perspective.
@Override
public boolean onMarkerClick(Marker marker)
From business logic this is not the proper place to call marker.isInfoWindowShown() function because it's always false as supposed to be. When OnMarkerClickListener call this function any opened InfoWindow have been already hidden by Map framework itself (so status 'false' technically is correct).
You can check that by example modifying overridden 'onMarkerClick' method
to open InfoWindows on even cliks only. On odd cliks - do nothing and see InfoWindows closes automatically by framework without explicit call to marker.hideInfoWindow();
To get actual InfoWindow status you should call 'marker.isInfoWindowShown' from another events or functions by keeping local references to any markers on map.
[Deleted User] <[Deleted User]> #17
[Deleted User] <[Deleted User]> #18
lm...@google.com <lm...@google.com> #19
As #12 mentions, the second click on the same marker is handled the same as a click on any other marker. First, the currently showing info window is hidden and the onInfoWindowClose listener is called, causing isInfoWindowShown to return false from that point onwards. Next, the onMarkerClick listener is fired. Depending on the return value from the onMarkerClick listener the API will either move the map to centre the marker and show it's info window if it has one, or not. If an info window is shown then the isInfoWindowShown method will start returning true again, from that point onwards.
We've updated the documentation about info windows to make this behavior more explicit. See
We've also submitted a change to the javadoc for the OnMarkerClickListener which points out that calling Marker.isInfoWindowShown from this listener will return false. This javadoc update will be made with a future release.
It seems that some of you want the info window to close if the currently selected marker is tapped again. We cannot change the API to implement this behavior as the default, as that would break other apps which rely on the behavior as it currently is. Instead, we've added a new demo activity which shows how to implement that behavior. See that demo here:
The correct way to know which marker is currently showing an info window (if any) at the point the OnMarkerClickListener is fired is to keep a local reference to the Marker and update this reference at the appropriate times, as #16 mentioned. The demo above shows how to do this as well.
Description
demonstration page if at all possible, or attach code.
Example code:
public class MainActivity extends Activity implements OnMarkerClickListener {
private static final String TAG = "InfoWindowsBug";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
GoogleMap map = ((MapFragment)getFragmentManager().findFragmentById(R.id.map)).getMap();
map.setOnMarkerClickListener(this);
map.addMarker(new MarkerOptions().position(new LatLng(0d, 0d)).title("something"));
}
@Override
public boolean onMarkerClick(Marker marker) {
Log.v(TAG, "before: " + marker.isInfoWindowShown());
if(marker.isInfoWindowShown()) {
marker.hideInfoWindow();
} else {
marker.showInfoWindow();
}
Log.v(TAG, "after: " + marker.isInfoWindowShown());
return true;
}
}
I realize this probably looks like I'm needlessly re-implementing the default behavior of toggling info window visibility when a marker is clicked, but this is needed for a more complex scenario (which would be inappropriate to post in full here) to implement a user's feature request in my clustering library, see
Steps to repeat issue
1. Run the above example code
2. Tap the only marker on the map
3. Tap the only marker on the map again
Expected results
Logcat output
InfoWindowsBug: before: false
InfoWindowsBug: after: true
InfoWindowsBug: before: true
InfoWindowsBug: after: false
User experience
After #2, info window shown
After #3, info window not shown
Actual results
Logcat output
InfoWindowsBug: before: false
InfoWindowsBug: after: true
InfoWindowsBug: before: false
InfoWindowsBug: after: true
User experience
After #2, info window shown
After #3, info window shown
*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************