喜?我正在使用Android中的MapView应用程序.我有三个标记,我希望以后可以使用Google Map API getlocation-function.为了试一试,我想用拖放功能移动标记,然后检查位置.
任何人已经拖延到Android标记工作,或知道一种方法开始搞清楚?
/ AK
可能重复:
谷歌地图输出= kml坏了吗?
几天后,当我尝试使用KML数据检索Google方向时,我开始出现错误.错误似乎我请求的URL不再返回KML数据,它返回整页.为此,我遵循了这一点.
这是什么解决方案?还有其他选择吗?
目前Android Map v2在点击后捕捉到标记位置.我想禁用此行为,但看不到任何选项.
有人知道如何解决这个问题吗?
如何长时间点击地图视图,以便在地图上的该点显示地点标记?
我试了几次没有成功:
1)使用setOnLongClickListener在MapvView其从未检测出的longclicks.
2)我的另一个想法是扩展MapView到覆盖dispatchTouchEvent..创建一个GestureDetector来响应longpress回调.但我被困在中途,因为我无法处理我的子类Mapview.即
MyMapview mymapview; //MyMapView extends MapView
//results in a classcast exception
mymapView = (MyMapView) findViewById(R.id.map);
Run Code Online (Sandbox Code Playgroud)
3)我知道如何尝试这个的唯一另一种方法是:检测MotionEvent.ACTION_DOWN并将延迟的runnable发布到处理程序并检测longpress是否还有其他两个事件:acton_move或action_up.
有人可以提供任何这些方法的想法来检测长按吗?
我想创建一个drawable,它由一个map pin(bubble)和一些文本组成.气泡应该在背景中,文本在前景中.
这个drawable应该传递super(drawable)给BalloonItemizedOverlay扩展的类ItemizedOverlay<Item>.
换句话说,我想在地图中显示的气泡中显示文字.
我正在使用Hello Mapview 教程
很抱歉发布另外一个,但似乎我们还没有记录这个问题的每个解决方案.
这是发生了什么:我添加了mapview,一切都在工作.我添加了一个滑动抽屉并将按钮移入其中,然后将根节点从线性更改为相对.从那时起,我在读取的main.xml类的图形布局中出现错误
缺少风格.是否为此布局选择了正确的主题?使用布局上方的主题组合框选择不同的布局,或修复主题样式引用.无法在当前主题中找到样式'mapViewStyle'.
将根节点切换为线性并返回到相对位置已使地图显示,但错误仍在图形布局中.
到目前为止,我已经完成了以下解决方案,可以解决大多数情况下的问题:
<uses-library android:name="com.google.android.maps"/>是Application的子节点.但是,我的问题仍然存在.这是我的布局xml.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
style="@style/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:apiKey="asdf" //not my real key
android:clickable="true" />
<!-- TODO: update the API key with release signature -->
<SlidingDrawer
android:id="@+id/slidingDrawer1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:content="@+id/content"
android:handle="@+id/handle" >
<Button
android:id="@+id/handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Menu" />
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/about"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/about" /> …Run Code Online (Sandbox Code Playgroud) 我有以下问题:我尝试用SupportMapFragment从com.google.android.gms.maps.SupportMapFragment哪个是谷歌地图的Android API v2的一部分提供.
我的第一种方法是从android-sdk\extras\google\google_play_services\libproject\google-play-services_lib位置向Eclipse添加项目,并将其设置为MyApp的Properties - > Project References菜单中的引用项目.我还将项目添加到Java Build Path/Projects.错误指示符从Eclipse中消失但是当我尝试运行我的应用程序时,我得到了NoClassDefFoundError异常.
所以我的第二种方法是将jar文件从google-play-services_lib/libs复制到我项目的libs目录.MyApp成功启动但是在LogCat中我可以看到死代码......一些消息,所以我想jar文件必须以另一种方式引用.
现在我感到困惑和疲惫..
也许在Android上更有经验的人可以告诉我该怎么办?
我正在创建一个Android应用程序,它根据MapView的可见区域搜索项目.有没有办法在我的MapView上设置一个监听器来检测地图被平移或缩放的时间?
android ×10
android-mapview ×10
google-maps ×4
drawable ×1
eclipse ×1
java ×1
kml ×1
long-click ×1
marker ×1