通过触摸或选项卡添加标记在Android谷歌地图 [英] Add Marker on Android Google Map via Touch or Tab

查看:227
本文介绍了通过触摸或选项卡添加标记在Android谷歌地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Android开发的初学者。我想用谷歌地图开发地图应用。 现在,我想通过触摸或轻按在地图上添加标记在地图上。我不知道热应用触摸事件标记在地图上的标记。请告诉我,如果可能的话请给我一些链接或例子。谢谢你,对不起我的英语。

I am a beginner of Android Developer. I want to develop Map Application using Google Map. Now, I want to add marker on the map via Touch or Tap on the Map. I do not know hot to apply touch event to mark the marker on the map. Please tell me and if it is possible please give me some link or example. Thank you and Sorry with my English.

推荐答案

这code为成功运行我的工作是$ C C本code $是动态绘图

This code is Successful run I am working on that code this code is for Dynamic Draw

我觉得这$​​ C $ C帮你多为静态或动态的两个地方,你可以使用   这code

I think this code help you more for Static or dynamic both places you can use this code

  double latval=Double.parseDouble(jsonobject.getString("lat"));
  double longval=Double.parseDouble(jsonobject.getString("lon"));
                     mMap.addMarker(new MarkerOptions()
                     .position(new LatLng( latval,  longval))
                     .title(jsonobject.getString("country"))
                     .snippet("4 E. 28TH Street From $15 /per night")
                     .rotation((float) -15.0)

                     .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ORANGE))
                            );
                     if(i==0){
                         mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
                                new LatLng(latval, longval), 7));
                    mMap.addCircle(new CircleOptions().center(new LatLng(latval,longval))
                            .radius(5000)
                            .strokeColor(Color.RED)
                            .fillColor(Color.RED)); 
                     } 

这篇关于通过触摸或选项卡添加标记在Android谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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