7e0dffd2 by chiangbt

修正了callout的问题

1 parent 30f863e1
......@@ -17,6 +17,7 @@ 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.CalloutStyle;
import com.esri.android.map.GraphicsLayer;
import com.esri.android.map.LocationDisplayManager;
import com.esri.android.map.MapView;
......@@ -169,14 +170,18 @@ public class GoogleMapActivity extends AppCompatActivity {
TextView content = (TextView)view.findViewById(R.id.content);
title.setText("名称:" + colorSuggestion.getName());
content.setText("地址:" + colorSuggestion.getAddress());
// // 获取Callout
// 获取Callout
Callout callout = mapView.getCallout();
// // 设置Callout样式
// callout.setStyle(R.xml.calloutlayout);
callout.setContent(view);
// 设置Callout样式
callout.setStyle(R.xml.calloutlayout);
// 设置锚点偏移量
callout.setOffset(0, -5);
// 显示Callout
callout.show(GISHelper.lonLat2Mercator(poipt), view);
callout.refresh();
callout.show(GISHelper.lonLat2Mercator(poipt));
callout.setMaxHeight(400);
callout.setMaxWidth(600);
}
@Override
......
......@@ -14,7 +14,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="12sp"/>
android:textSize="18sp"/>
<TextView
android:id="@+id/content"
android:layout_width="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<calloutlayout>
<calloutViewStyle>
titleTextColor="#000000" <!-- 标题颜色 -->
titleTextSize = 10; <!-- 标题文字大小 -->
titleTextStyle = 0; <!-- 字体样式 -->
......@@ -11,5 +11,5 @@
flat="true" <!-- true表示2D图形,false表示3D图形 -->
style.getCornerCurve()="0" <!-- 边框的角的圆润程度 -->
anchor="5" <!-- 锚点的位置-->
</calloutlayout>
</calloutViewStyle>
</resources>
\ No newline at end of file
......