简体   繁体   English

Android GoogleMaps v2拖放到地图

[英]Android GoogleMaps v2 Drag and Drop to map

As title states, I'm doing an Android GoogleMapsv2 app. 如标题所示,我正在做一个Android GoogleMapsv2应用程序。 The user will be dragging onto the map with a custom drop-shadow image. 用户将使用自定义的阴影图像拖到地图上。

I need to capture the lat/lon of the ACTION_DRAG_ENDED event. 我需要捕获ACTION_DRAG_ENDED事件的经纬度。 I found some guides that discuss adding a SupportMapFragment over the map, but they only support responding to a onMouseClicked event on the map. 我找到了一些讨论如何在地图上添加SupportMapFragment的指南,但它们仅支持响应地图上的onMouseClicked事件。 Since my event is driven by the end of a drag event, this is less than helpful. 由于我的事件是在拖动事件结束时驱动的,因此这无济于事。

I considered having my custom drop-shadow linger and having the user simply click on the drop shadow to trigger the map event, but I think it sucks to force them to take another action and I'm unclear on how I'd keep the drop-shadow from vanishing on release anyway. 我考虑过让我的自定义拖放阴影停留并让用户简单地单击下拉阴影来触发map事件,但是我认为它很烂,迫使他们采取另一种操作,但我不清楚如何保持拖放-阴影从释放时消失。

Any suggestions? 有什么建议么? Is the approach fundamentally flawed or is there a way to navigate the GoogleMap and Android Drag and Drop APIs to make this work? 该方法从根本上是有缺陷的,还是有一种方法可以导航GoogleMap和Android拖放API来实现这一目的?

Not exactly sure what are you dragging on maps ... But according to Google's official documentation shadows were removed in version 3.14 of the Google Maps API. 不完全确定要在地图上拖动什么...但是,根据Google的官方文档,在Google Maps API的3.14版中删除了阴影。 Any shadows specified programmatically will be ignored. 以编程方式指定的任何阴影都将被忽略。

Please refer to the following link. 请参考以下链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM