Android Google Map API V2 : Open Custom Info Window on Right Side of Marker

前端 未结 2 1133
栀梦
栀梦 2021-01-31 09:11

I have Integrated Google MAP API V2 for Android. I want to have a Custom Info Window at Onclick of My Marker. Up to that it is fine. i have integrate it.

What I

2条回答
  •  余生分开走
    2021-01-31 09:44

    You can do by simple convert marker.getPosition() to screenPosition like below code

    Projection projection = map.getProjection();
    LatLng markerLocation = marker.getPosition();
    Point screenPosition = projection.toScreenLocation(markerLocation);
    
    int x = screenPosition.x +marker. markerImage.getWidth();
    

    You can ref below link for more infomation (which convert getPosition to projection):

    How to get screen coordinates from marker in google maps v2 android

提交回复
热议问题