Google地图添加标记 [英] Google maps add marker

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

问题描述

我想在android中添加标记到谷歌地图,任何人都可以帮助我做到这一点,如果你们有示例代码,它会帮助我很多,并告诉我如何设置地图片段大小?



预先感谢。

解决方案使用 addMarker()



像:

  myMap.addMarker(new MarkerOptions()。position(yourLatLng).icon(BitmapDescriptorFactory.fromResource(R.drawable.yourmarkericon))); 

其中 myMap GoogleMap yourLatlng 经纬度您想添加标记和 yourmarkericon 是您想要的图标在地图上显示



编辑: >



https://开发者.google.com / maps / documentation / android / marker



https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/ maps / model / Marker

简单教程

HTTP://bon-app-etit.blogspot .BE / 20 12/12 / add-informationobject-to-marker-in.html


I want to add marker to Google map in android can any one please help me to do it and if you guys have sample code it would help me a lot, and also tell me that how can i set size to map fragment ?

Thanks in advance.

解决方案

use addMarker()

like :

myMap.addMarker(new MarkerOptions().position(yourLatLng).icon(BitmapDescriptorFactory.fromResource(R.drawable.yourmarkericon)));

where myMap is the Object of GoogleMap and yourLatlng is Latlng Where you want to add marker and yourmarkericon is icon which you want to display on map

Edit :

References

https://developers.google.com/maps/documentation/android/marker

https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Marker

Simple Tutorial

http://bon-app-etit.blogspot.be/2012/12/add-informationobject-to-marker-in.html

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

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