在我的聊天应用程序中我使用共享位置这个我使用的静态地图比地图加载成功但图像显示模糊,我想显示静态地图像Whatsapp只是良好的分辨率图像所以请指导我..
网址
public static String local(String latitudeFinal, String longitudeFinal){
return "https://maps.googleapis.com/maps/api/staticmap?center="+latitudeFinal+","+longitudeFinal+"&zoom=14&size=230x100&scale=2&markers=color:red|"+latitudeFinal+","+longitudeFinal;
}
Xml文件:
<android.support.v7.widget.CardView
android:layout_width="230dp"
android:layout_height="150dp"
app:cardElevation="4dp"
android:layout_margin="5dp"
app:cardCornerRadius="7dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:orientation="vertical">
<ImageView
android:id="@+id/left_map_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="10dp"
android:layout_marginBottom="5dp"
android:layout_marginLeft="3dp"
android:layout_weight="1"
android:scaleType="fitXY"
android:layout_marginTop="3dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/gray"
android:layout_weight="1"
android:gravity="end"
android:id="@+id/left_map_time"
android:text="11 minute ago"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_single_tick"
android:layout_gravity="center_vertical"
android:layout_weight="10"/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
Java代码:
viewHolderSenderMapView.setIvMapPhoto(Util.local(senderMap.getMapModel().getLatitude(),senderMap.getMapModel().getLongitude()));