2013-05-14 3 views
1

Google 장소 작업을 통해 한 장소 이름을 영어로 기본 이름으로 추가하고 다른 장소에서 다른 언어로 다른 이름을 추가하는 방법. 기본 언어 일 수도 있고 다른 언어의 기본 언어 일 수도 있습니다. 또는 Google에서도 동일한 작업을 수행합니다.GOOGLE Place Api : Google 장소 작업을 통해 한 곳에서 더 많은 장소 이름을 추가하는 방법

감사합니다.

+0

죄송합니다. 장소 세부 정보를 요청하지 않으므로 한 곳에서 이름을 더 추가하는 법을 묻습니다. 예를 들어, 영어로 언어를 제공하여 장소 작업을 통해 장소 이름 ("새 소프트웨어 솔루션")을 추가했습니다. 나는 응답 {id, reference, status}을 얻는다. 같은 장소에 더 많은 이름을 추가하고 싶습니다. 즉, 같은 장소에서 아랍어로 다른 이름을 추가하고 싶습니다. 내가 어떻게 할 수 있니? 내가 몇몇 examaples를 얻을 수 있으면 나는 매우 감사 할 것이다. 감사. – user2378154

+0

내 편집을 볼 수 있습니다. – Dolphin

답변

0

당신이

여기

이 MyInfoWIndowAdapter

public class MyInfoWindowAdapter implements InfoWindowAdapter { 

    private final View mView; 

    public MyInfoWindowAdapter(Activity activity) { 

     mView = activity.getLayoutInflater().inflate(R.layout.custom_info_window, null); 
    } 
    @Override 
    public View getInfoContents(Marker marker) { 

     String title = marker.getTitle(); 
     final String snippet = marker.getSnippet(); 
     final TextView titleUi1 = (TextView) mView.findViewById(R.id.title); 
     final TextView titleUi2 = (TextView) mView.findViewById(R.id.title2); 
     titleUi1.setText(title); 
     titleUi2.setText("Second name"); 
     return mView; 
    } 

    @Override 
    public View getInfoWindow(Marker marker) { 

     return null; 
    } 
} 

custom_info_window (예를 들어) 이름의 2 라인이 마커에 대한 자신 WindowAdapter를 만들 수 있습니다으로 MapFragment에

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" > 

    <TextView 
     android:id="@+id/title" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center_horizontal" 
     android:ellipsize="end" 
     android:paddingBottom="@dimen/padding_small" 
     android:singleLine="true" 
     android:textColor="@color/map_info_title" 
     android:textSize="@dimen/map_info_window_text" 
     android:textStyle="bold" /> 
    <TextView 
     android:id="@+id/title2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center_horizontal" 
     android:ellipsize="end" 
     android:paddingBottom="@dimen/padding_small" 
     android:singleLine="true" 
     android:textColor="@color/map_info_title" 
     android:textSize="@dimen/map_info_window_text" 
     android:textStyle="bold" /> 
    <TextView 
     android:id="@+id/snippet" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textColor="@color/map_info_snippet" 
     android:textSize="@dimen/map_info_window_text" /> 
</LinearLayout> 

를 추가 this onCreate

mMap.setInfoWindowAdapter(new MyInfoWindowAdapter(getActivity())); 
+0

자바 스크립트 나 C#에서 가능합니다. – user2378154

+0

@ user2378154이 예제는 android에서 제공됩니다. 나도 몰라 javascript/C# – Dolphin

+0

지도 작성기가 단일 장소에 대한 더 많은 이름을 제공하기 위해 제공하는 것처럼 나는 아직도 붙어있어 구글 장소 API를 사용하여 동일한 기능이 필요합니다. (여러 이름 섹션 참조) << https://support.google.com/mapmaker/answer/1096113?hl=ko&ref_topic=2889732 >> – user2378154