Android Map Api 使用和开发(1) 添加地图和界面

 最近正在做和地图相关的项目,想记录和整理一下的这方面的内容发出来,既是自己整理总结,也是和别人分享经验。

 

做过android 地图相关项目的同学估计都会有一些相同的需求,这些需求在android 上谷歌自己做的地图软件都做得很好,很多人想模仿参考来做,比如:

 

1、弹出浮动的搜索框,并能搜索地址并定位

2、长按地图出现当前位置的泡泡(popup),泡泡里有标题和内容,有详细地址和详细信息 

3、自动定位到当前位置

4、显示各种图层

 

这么多需求不是一下子都能做出来的,而且做好了也不容易。

 

那这篇先写一些怎么把google地图添加到android程序中,还有把主界面显示做一下。

 

先看下主界面出来的效果:

 

  1. </span>xml version=“1.0” encoding=“utf-8”gt;  
  2. <LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”  
  3.     android:layout_width=“fill_parent” android:layout_height=“fill_parent”  
  4.     android:orientation=“vertical”>  
  5.     <LinearLayout  
  6.          android:layout_width=“fill_parent” android:layout_height=“wrap_content”  
  7.          android:orientation=“horizontal” android:background=“@drawable/searchbg”>

    声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2012年3月22日
下一篇 2012年3月22日

相关推荐