30f863e1 by chiangbt

更新了高德检索POI

1 parent aeb0af84
......@@ -6,7 +6,9 @@ import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.androidnetworking.AndroidNetworking;
......@@ -14,6 +16,7 @@ import com.androidnetworking.error.ANError;
import com.androidnetworking.interfaces.JSONObjectRequestListener;
import com.arlib.floatingsearchview.FloatingSearchView;
import com.arlib.floatingsearchview.suggestions.model.SearchSuggestion;
import com.esri.android.map.Callout;
import com.esri.android.map.GraphicsLayer;
import com.esri.android.map.LocationDisplayManager;
import com.esri.android.map.MapView;
......@@ -158,6 +161,22 @@ public class GoogleMapActivity extends AppCompatActivity {
graphicsLayer.addGraphic(new Graphic(GISHelper.lonLat2Mercator(poipt),
new PictureMarkerSymbol(getResources().getDrawable(R.mipmap.locator)).setOffsetY(16)));
LayoutInflater inflater = LayoutInflater.from(GoogleMapActivity.this);
View view = inflater.inflate(R.layout.callout_layout, null);
// 设置Callout属性
TextView title = (TextView)view.findViewById(R.id.title);
TextView content = (TextView)view.findViewById(R.id.content);
title.setText("名称:" + colorSuggestion.getName());
content.setText("地址:" + colorSuggestion.getAddress());
// // 获取Callout
Callout callout = mapView.getCallout();
// // 设置Callout样式
// callout.setStyle(R.xml.calloutlayout);
// 设置锚点偏移量
callout.setOffset(0, -5);
// 显示Callout
callout.show(GISHelper.lonLat2Mercator(poipt), view);
}
@Override
......
......@@ -75,6 +75,10 @@ public class POISuggestion implements SearchSuggestion {
}
};
public String getName() {
return name;
}
public String getAddress() {
return address;
}
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="150dp"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="12sp"/>
<TextView
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="12sp"/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<calloutlayout>
titleTextColor="#000000" <!-- 标题颜色 -->
titleTextSize = 10; <!-- 标题文字大小 -->
titleTextStyle = 0; <!-- 字体样式 -->
titleTextTypeFace = 0; <!-- 字体类型设置 -->
backgroundColor="#ffffff" <!-- Callout背景颜色 -->
backgroundAlpha="255" <!-- Callout透明度 -->
frameColor="#000000" <!-- 边框颜色 -->
flat="true" <!-- true表示2D图形,false表示3D图形 -->
style.getCornerCurve()="0" <!-- 边框的角的圆润程度 -->
anchor="5" <!-- 锚点的位置-->
</calloutlayout>
</resources>
\ No newline at end of file