Search code examples
androidgoogle-mapsgoogle-maps-api-2

Why does the anchor of the InfoWindows (Maps API V2) is so badly displayed?


I have a very simple question, with really basic code that really annoys me.

I am just trying to display a dimple info windows on my map with this code:

  mMap.addMarker(new MarkerOptions()
            .position(new LatLng(aTraffic.getLat(), aTraffic.getLon()))
            .title(aTraffic.getCategory())
            .anchor(0.0f, 0.0f)// I tried to remove this line, but does not change anything...
            .snippet(aTraffic.getMessage())
            .icon(BitmapDescriptorFactory
                    .fromResource(R.drawable.ic_c_traffic)));

But it looks like the Dialog is really badly displayed: the anchor is way on the jeft side of the icon

Any idea what I am droing wrong or what I should do to fix that?

enter image description here


Solution

  • I don't know if this issue should be closed or deleted, but I have found this as a reported bug on the Maps API bug tracker:

    https://code.google.com/p/gmaps-api-issues/issues/detail?id=5439

    and this entry leads to some duplicate on StackOverflow.