본문 바로가기

Development/Android

[Android] Map InfoWindow Custom하기~!

1. InfoWindowAdapter 인터페이스를 상속받아 구현하기~!


public class SomethingWindowAdapter implements InfoWindowAdapter{


/*

* Constructor

*/

public SomethingWindowAdapter (final Context context) {

this.mView = (View)((LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(리소스, null);

}//end constructor

/*

* InfoWindowAdapter

*/

@Override

public View getInfoContents (final Marker marker) {

~~~ 설정하기~! 데이터를 넣거나~!

return mView;

}//end getInfoContents Method


@Override

public View getInfoWindow (final Marker marker) {

return null;

}//end getInfoWindow Method

//Variables

private final View mView;


}//end SomethingWindowAdapter Method


2. Map에 Adapter 설정하기~!


this.mMap.setInfoWindowAdapter(new SomethingWindowAdapter(this));