毕业论文-基于android的地图定位开发内容摘要:

目前 GoogleMaps已经可以支持很多功能了。 Google 提供了不同地域的分辨率不同的卫星照片,在您的家乡,或许只能看到一些山群,但是在一些大城市您甚至可以看到屋顶。 Google Earth 在以下城市提供了不同的细致的信息,在这些城市可以得到关于出行、餐饮、旅游等各方面信息的查询 : 4 总体设计 Inter 连接设计 ( 1) 、申请 Apikey, 并放在正确的位置 ( 2) 、记得导入 useslibrary ( 3) 、需要给予一定的权限 图形界面设计 苏州科技学院毕业论文 13 功能图 Google手机端口 添加标签 查找位置 查找路径 地图类型转换 显示特定位置 放大与缩小 From to 确定 latitude Lngtidue 在次区域显示地图 view 放大 缩小 苏州科技学院毕业论文 14 5 详细设计 与编码实现 显示特定位置 默认情况下,谷歌地图 将 首先 加载 显示的地图 是 美国。 但是, 为了我们的方便和亲切感我们 还可以设置谷歌地图显示一个 自己所在的 位置 苏州。 在这种情况下, 可以使 用 animateTo ( ) 方法 MapController 级。 苏州的经纬度是 ( ,) 下面的代码显示了如何做到这一点: Double latitude = , longitude = ; gMapView = (MapView) findViewById()。 p = new GeoPoint((int) (latitude * 1000000), (int) (longitude * 1000000))。 (true)。 mc = ()。 (p)。 (14)。 苏州科技学院毕业论文 15 添加标签 在地图上添加一个标签可以和清除的看到我们所在的位置,在视觉上给我们带来的很多的好处,下面就是具体实现的方法。 MyLocationOverlay myLocationOverlay = new MyLocationOverlay()。 ListOverlay list = ()。 (myLocationOverlay)。 当然还要添加一个显示的图标了: 命名为 放在 drawable 文件里。 查找位置并显示经纬度 事先说明我这里的查找时根据经纬度查找,具体实现方法如下: public void onLocationChanged(Location location) { if (location != null) { double lat = ()。 double lng = ()。 TextView latText = (TextView) findViewById()。 TextView lngText = (TextView) findViewById()。 String currentLocation = +lat。 String currentLocation1 = + lng。 (currentLocation)。 (currentLocation1)。 p = new GeoPoint((int) lat * 1000000 , (int) lng * 1000000 )。 (p)。 } 查找路径 实现方法如下: final private OnClickListener onClickListener = new OnClickListener() { public void onClick(View arg0) { EditText editFrom = (EditText) findViewById()。 String strFrom = ().toString()。 苏州科技学院毕业论文 16 EditText editTo = (EditText) findViewById()。 String strTo = ().toString()。 String uri = + strFrom + ,amp。 daddr= + strTo + amp。 hl=en。 (RouteSample, uri= + uri)。 startActivity(new Intent(, (uri)))。 } }。 苏州科技学院毕业论文 17 苏州科技学院毕业论文 18 地图类型转换 默认情况下,谷歌地图显示在地图模式。 如果你想显示的卫星地图 ,您可以使用setSatellite ( ) 方法 MapView 类,象这样: (true)。 您也可以显示在街景地图,使用 setStreetView ( )方法 (true)。 苏州科技学院毕业论文 19 放大和缩小功能 首先,添加一个 LinearLayout元素的 文件如下所示: LinearLayout android:id=@+id/zoom android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentBottom=true android:layout_centerHorizontal=true / /RelativeLayout 在 文件,添加以下进口: import。 苏州科技学院毕业论文 20 import。 import。 and add the following code after the line setContentView()。 mapView = (MapView) findViewById()。 LinearLayout zoomLayout = (LinearLayout)findViewById()。 View zoomView = ()。 (zoomView, new ( , ))。 (true)。 } 在上述情况下,缩放控制将显示在屏幕的底部。 当您现在按 F11 在 Eclipse 中,您会看到缩放控制的地图。 苏州科技学院毕业论文 21 6 功能测试 路线测试 测试从苏州到昆山的路线,如下图所示: 苏州科技学院毕业论文 22 苏州科技学院毕业论文 23 结 论 本程序设计实现了基于 google 手机操作系统的地图应用的 开发,具有一定的可玩性和复杂性。 经过了细心的调试和排错解决了绝大部分的问题。 但是我的水平实在有限,还有部分功能没有实现 ,但我相信,随着时间的推移,个人水平的增长,我一定会重写这个 应用 程序,使其更加完善, 这款游戏作为我的毕业设计,是本人目前做过的 最有意义的程序,这期间对java 的学习, 也让我对 android 有了更深层的认识。 因为其各个模块间的联系十分紧密,代码重复执行率高,当经过无数次的调试、修改后,能最终看到成品,有无比自豪的心情。 苏州科技学院毕业论文 24 致 谢 首先感谢我的指导老师周中成老师,他在我的毕业设计过程中提出了指导性的方案和架构,并指引我阅读相关的资料和书籍,使我在不熟悉的领域中仍能迅速掌握新兴的技术。 感谢答辩组对本毕业设计的考核,如果可以得到专家的认可将对我的学习和工作给予极大的鼓励。 你们的评价和建议我将牢 记在心,在今后的发展中扬长避短,更加努力的严格要求自己。 苏州科技学院毕业论文 25 参 考 文 献 1 android 官方网站 2 JAVA 编程思想 机械工业出版社 ISBN 7111104412 Bruce Eckel (著 ) 侯捷 (翻译) 3 游戏设计 —— 原理与实践 电子工业出版社 ISBN 7505392123 Richard Rouse (著) 尤晓东 (翻译) 4 J2ME 应 用教程 清华大学出版社 ISBN 9787810828987 陈旭东 , 徐保民 , 张宏勋编著 5 GPhone 中国论坛 6 7 8 9 10 苏州科技学院毕业论文 26 附录 A 代码 ?xml version= encoding=utf8? LinearLayout xmlns:android= android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent LinearLayout xmlns:android= android:layout_width=wrap_content android:layout_height=wrap_content TextView android:id=@+id/textFrom android:layout_width=wrap_content android:layout_height=wrap_content android:text=From / EditText android:id=@+id/editFrom android:layout_width=fill_parent android:layout_height=wrap_content android:layout_below=@id/textFrom / TextView android:id=@+id/textTo android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@+id/editFrom android:text=To / EditText android:id=@+id/editTo android:layout_width=fill_parent android:layout_height=wrap_content android:layout_below=@+id/textTo / Button android:id=@+id/buttonOk style=?android:attr/buttonStyleSmall android:layout_alignRight=@+id/myMap android:layout_width=wrap_content android:layout_height=wrap_content android:layout_below=@+id/editTo android:text=确定 ! / /LinearLayout LinearLayout xmlns:android= android:layout_width=wrap_content android:layout_height=wrap_content TextView android:id=@+id/latLabel android:layout_width=wrap_content android:layout_height=wrap_content android:text=Latitude:/ T。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。