Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
蒋波涛
/
landsurvey
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
7e0dffd2
authored
2018-04-02 12:15:55 +0800
by
chiangbt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修正了callout的问题
1 parent
30f863e1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
app/src/main/java/com/pashanhoo/landsurvey/GoogleMapActivity.java
app/src/main/res/layout/callout_layout.xml
app/src/main/res/xml/calloutlayout.xml
app/src/main/java/com/pashanhoo/landsurvey/GoogleMapActivity.java
View file @
7e0dffd
...
...
@@ -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
...
...
app/src/main/res/layout/callout_layout.xml
View file @
7e0dffd
...
...
@@ -14,7 +14,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
""
android:textSize=
"1
2
sp"
/>
android:textSize=
"1
8
sp"
/>
<TextView
android:id=
"@+id/content"
android:layout_width=
"wrap_content"
...
...
app/src/main/res/xml/calloutlayout.xml
View file @
7e0dffd
<?xml version="1.0" encoding="utf-8"?>
<resources>
<callout
layout
>
<callout
ViewStyle
>
titleTextColor="#000000"
<!-- 标题颜色 -->
titleTextSize = 10;
<!-- 标题文字大小 -->
titleTextStyle = 0;
<!-- 字体样式 -->
...
...
@@ -11,5 +11,5 @@
flat="true"
<!-- true表示2D图形,false表示3D图形 -->
style.getCornerCurve()="0"
<!-- 边框的角的圆润程度 -->
anchor="5"
<!-- 锚点的位置-->
</callout
layout
>
</callout
ViewStyle
>
</resources>
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment