title: 百度地图之——自定义marker样式
优秀资源集锦
如果我比别人看得远些,那是因为我站在巨人们的肩上
在百度地图提供的API中,我们可以通过图片来设置marker的样式,但是当实现的效果复杂时就不能单单靠图片解决,我们已经见到了太多太多的marker样式。就让我们来实现自己想要的样式。
首先让我们来看看效果图,由这你可以任意发挥想象,做成你想要的样式。
基础的百度地图配置请参照 百度地图开发指南进行配置
一、在布局文件添加百度地图的MapView
android:id="@+id/bmapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true" />
然后新建marker.xml布局文件,实现一个marker的样式。
android:layout_width="200dp"
android:layout_height="wrap_content"
android:orientation="vertical">
android:id="@+id/cover_nameId"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:background="@android:color/darker_gray"
android:gravity="center"
android:text="名称:我擦我擦我擦路"
android:textAppearance="?android:attr/textAppearanceSmall" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="horizontal">
android:id="@+id/cover_temptureId"
android:layout_width="100dp"