Google지도 용 애플리케이션을 하나 만들었습니다.안드로이드에서 Google지도를 만드는 방법?
위도와 경도를 위치로 사용하고 있습니다. 하지만 난 구글지도를 표시 할 수 없습니다입니다 ,
코드가 아래와 같습니다
누군가가 나를 도울 수, 뭐죠 내 코드 문제 :
package com.googlemaps;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import android.app.Activity;
import android.os.Bundle;
public class GooglemapsActivity extends MapActivity{
/** Called when the activity is first created. */
MapController mControl;
GeoPoint GeoP;
MapView mapV;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mapV = (MapView) findViewById(R.id.mapView);
mapV.displayZoomControls(true);
mapV.setBuiltInZoomControls(true);
double lat = 40.8;
double longi = 96.666;
GeoP = new GeoPoint((int)(lat * 1E6), (int) (longi * 1E6));
mControl = mapV.getController();
mControl.animateTo(GeoP);
mControl.setZoom(13);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
}
하고 XML 파일은 다음과 같습니다
main.xml에
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0acFPt8mdFAjqGq9AuToZIgkd4b8jxUM0K8mg0Q"
/>
</LinearLayout>
"Google지도를 표시 할 수 없습니다"는 오류를 나타내거나지도에 점을 표시 할 수 없습니까? – Dharmendra
Google지도를 표시하지 않고 단지 점을 표시합니다. – Jayesh
유효한지도 API 키를 제공하지 않았습니까. API 키를 확인하십시오. – Dharmendra