修正了callout的问题
Showing
3 changed files
with
12 additions
and
7 deletions
... | @@ -17,6 +17,7 @@ import com.androidnetworking.interfaces.JSONObjectRequestListener; | ... | @@ -17,6 +17,7 @@ import com.androidnetworking.interfaces.JSONObjectRequestListener; |
17 | import com.arlib.floatingsearchview.FloatingSearchView; | 17 | import com.arlib.floatingsearchview.FloatingSearchView; |
18 | import com.arlib.floatingsearchview.suggestions.model.SearchSuggestion; | 18 | import com.arlib.floatingsearchview.suggestions.model.SearchSuggestion; |
19 | import com.esri.android.map.Callout; | 19 | import com.esri.android.map.Callout; |
20 | import com.esri.android.map.CalloutStyle; | ||
20 | import com.esri.android.map.GraphicsLayer; | 21 | import com.esri.android.map.GraphicsLayer; |
21 | import com.esri.android.map.LocationDisplayManager; | 22 | import com.esri.android.map.LocationDisplayManager; |
22 | import com.esri.android.map.MapView; | 23 | import com.esri.android.map.MapView; |
... | @@ -169,14 +170,18 @@ public class GoogleMapActivity extends AppCompatActivity { | ... | @@ -169,14 +170,18 @@ public class GoogleMapActivity extends AppCompatActivity { |
169 | TextView content = (TextView)view.findViewById(R.id.content); | 170 | TextView content = (TextView)view.findViewById(R.id.content); |
170 | title.setText("名称:" + colorSuggestion.getName()); | 171 | title.setText("名称:" + colorSuggestion.getName()); |
171 | content.setText("地址:" + colorSuggestion.getAddress()); | 172 | content.setText("地址:" + colorSuggestion.getAddress()); |
172 | // // 获取Callout | 173 | // 获取Callout |
173 | Callout callout = mapView.getCallout(); | 174 | Callout callout = mapView.getCallout(); |
174 | // // 设置Callout样式 | 175 | callout.setContent(view); |
175 | // callout.setStyle(R.xml.calloutlayout); | 176 | // 设置Callout样式 |
177 | callout.setStyle(R.xml.calloutlayout); | ||
176 | // 设置锚点偏移量 | 178 | // 设置锚点偏移量 |
177 | callout.setOffset(0, -5); | 179 | callout.setOffset(0, -5); |
178 | // 显示Callout | 180 | // 显示Callout |
179 | callout.show(GISHelper.lonLat2Mercator(poipt), view); | 181 | callout.refresh(); |
182 | callout.show(GISHelper.lonLat2Mercator(poipt)); | ||
183 | callout.setMaxHeight(400); | ||
184 | callout.setMaxWidth(600); | ||
180 | } | 185 | } |
181 | 186 | ||
182 | @Override | 187 | @Override | ... | ... |
... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
14 | android:layout_width="wrap_content" | 14 | android:layout_width="wrap_content" |
15 | android:layout_height="wrap_content" | 15 | android:layout_height="wrap_content" |
16 | android:text="" | 16 | android:text="" |
17 | android:textSize="12sp"/> | 17 | android:textSize="18sp"/> |
18 | <TextView | 18 | <TextView |
19 | android:id="@+id/content" | 19 | android:id="@+id/content" |
20 | android:layout_width="wrap_content" | 20 | android:layout_width="wrap_content" | ... | ... |
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <resources> | 2 | <resources> |
3 | <calloutlayout> | 3 | <calloutViewStyle> |
4 | titleTextColor="#000000" <!-- 标题颜色 --> | 4 | titleTextColor="#000000" <!-- 标题颜色 --> |
5 | titleTextSize = 10; <!-- 标题文字大小 --> | 5 | titleTextSize = 10; <!-- 标题文字大小 --> |
6 | titleTextStyle = 0; <!-- 字体样式 --> | 6 | titleTextStyle = 0; <!-- 字体样式 --> |
... | @@ -11,5 +11,5 @@ | ... | @@ -11,5 +11,5 @@ |
11 | flat="true" <!-- true表示2D图形,false表示3D图形 --> | 11 | flat="true" <!-- true表示2D图形,false表示3D图形 --> |
12 | style.getCornerCurve()="0" <!-- 边框的角的圆润程度 --> | 12 | style.getCornerCurve()="0" <!-- 边框的角的圆润程度 --> |
13 | anchor="5" <!-- 锚点的位置--> | 13 | anchor="5" <!-- 锚点的位置--> |
14 | </calloutlayout> | 14 | </calloutViewStyle> |
15 | </resources> | 15 | </resources> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment