Google Maps V2 - 地图未加载 [英] Google Maps V2 - Map is not loading

查看:79
本文介绍了Google Maps V2 - 地图未加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就个人而言,我是一个问题,因为有一段时间我无法解决,我尝试了几种方式,没有什么....然后我做一个APP位置很简单,但不加载,只是在空白屏幕(笛卡尔平面)。以下是源代码。谁可以帮助我,我是Android应用程序的新手。



AndroidManifest.xml

Personally, I'm a problem, since a while I can not solve, I tried several ways and nothing .... then I'm doing an APP location pretty simple, but does not load, is only in Blank Screen (Cartesian plane). Below is the source code. Who can help me, I'm new to Android application.

AndroidManifest.xml

package nl.codestone.cookbook.maptest;

import android.os.Bundle;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class MapTest extends MapActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        MapView mapview = (MapView) findViewById(R.id.mapview);
        mapview.setBuiltInZoomControls(true); 
    
    }

    @Override
    protected boolean isRouteDisplayed() {
        return false;
    }
}







main.xml




main.xml

<?xml version="1.0" encoding="utf-8"?>

<com.google.android.maps.MapView  

    xmlns:android="http://schemas.android.com/apk/res/android"

    android:id="@+id/mapview"

    android:layout_width="fill_parent" 

    android:layout_height="fill_parent" 

    android:apiKey="AIzaSyBLRbJiQXyenW5t5P0U4tjxfWQhpDpfbcA"

    android:clickable="true"

    />





MapTest.java

package nl.codestone.cookbook.maptest;

import android.os.Bundle;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class MapTest extends MapActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        MapView mapview = (MapView) findViewById(R.id.mapview);
        mapview.setBuiltInZoomControls(true); 
    
    }

    @Override
    protected boolean isRouteDisplayed() {
        return false;
    }
}

推荐答案

您可能在创建正确密钥时遇到问题:



请检查以下链接: 1。回答相同问题 [ ^ ]



2.你可以在这里看到:创建地图的完整教程 [ ^ ]
You may have problem in creating proper key:

Please, Check following links: 1. Answer for same question[^]

2. You can see here : Full Tutorial for Creating Map[^]


这篇关于Google Maps V2 - 地图未加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆