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
d1db004c
authored
2018-04-02 21:48:37 +0800
by
chiangbt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修正了lod中的一个问题
1 parent
be21d1b2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
23 deletions
app/src/main/AndroidManifest.xml
app/src/main/java/com/pashanhoo/landsurvey/MainActivity.java
app/src/main/java/com/pashanhoo/landsurvey/layers/tianditu/TianDiTuLayerTypes.java
app/src/main/java/com/pashanhoo/landsurvey/layers/tianditu/TianDiTuTiledMapServiceLayer.java
app/src/main/java/com/pashanhoo/landsurvey/utils/AppInfo.java
app/src/main/AndroidManifest.xml
View file @
d1db004
...
...
@@ -17,7 +17,10 @@
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".BootActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".MainActivity"
...
...
@@ -26,10 +29,7 @@
android:theme=
"@style/AppTheme.NoActionBar"
>
<!-- 禁止屏幕旋转 -->
</activity>
<activity
android:name=
".GoogleMapActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".BaiduMapActivity"
>
...
...
app/src/main/java/com/pashanhoo/landsurvey/MainActivity.java
View file @
d1db004
...
...
@@ -26,12 +26,10 @@ import com.esri.android.runtime.ArcGISRuntime;
import
com.esri.core.geometry.Point
;
import
com.esri.core.map.Graphic
;
import
com.esri.core.symbol.PictureMarkerSymbol
;
import
com.pashanhoo.landsurvey.layers.tianditu.TDTTileinfo
;
import
com.pashanhoo.landsurvey.layers.tianditu.TianDiTuLocalTiledMapServiceLayer
;
import
com.pashanhoo.landsurvey.layers.tianditu.TianDiTuTiledMapServiceLayer
;
import
com.pashanhoo.landsurvey.layers.tianditu.TianDiTuLayerTypes
;
import
com.pashanhoo.landsurvey.search.POISuggestion
;
import
com.pashanhoo.landsurvey.search.TiandituSearch
;
import
com.pashanhoo.landsurvey.utils.AppInfo
;
import
org.json.JSONArray
;
...
...
@@ -65,16 +63,26 @@ public class MainActivity extends AppCompatActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main
);
// 分别获取控件
// 分别获取控件
对象
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar
);
setSupportActionBar
(
toolbar
);
mapinfoView
=
(
TextView
)
findViewById
(
R
.
id
.
mapinfo
);
floatingSearchView
=
(
FloatingSearchView
)
findViewById
(
R
.
id
.
floating_search_view
);
setSupportActionBar
(
toolbar
);
//初始化-------------------------------------------------------------------
//
初始化-------------------------------------------------------------------
AppInfo
.
Settings
();
//按钮动作-------------------------------------------------------------------
//地图初始化-------------------------------------------------------------------
ArcGISRuntime
.
setClientId
(
"1eFHW78avlnRUPHm"
);
mapView
=
(
MapView
)
findViewById
(
R
.
id
.
map
);
mapView
.
setEsriLogoVisible
(
false
);
mapView
.
enableWrapAround
(
false
);
// GPS设置
locationDisplayManager
=
mapView
.
getLocationDisplayManager
();
locationDisplayManager
.
setShowLocation
(
true
);
locationDisplayManager
.
setAutoPanMode
(
LocationDisplayManager
.
AutoPanMode
.
LOCATION
);
//设置模式
locationDisplayManager
.
setShowPings
(
true
);
// 放大按钮
FloatingActionButton
zoomin
=
(
FloatingActionButton
)
findViewById
(
R
.
id
.
zoomin
);
zoomin
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
@@ -133,6 +141,7 @@ public class MainActivity extends AppCompatActivity {
}
}
});
final
FloatingActionButton
search
=
(
FloatingActionButton
)
findViewById
(
R
.
id
.
search
);
search
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
...
...
@@ -148,11 +157,7 @@ public class MainActivity extends AppCompatActivity {
}
}
});
//地图初始化-------------------------------------------------------------------
ArcGISRuntime
.
setClientId
(
"1eFHW78avlnRUPHm"
);
mapView
=
(
MapView
)
findViewById
(
R
.
id
.
map
);
mapView
.
setEsriLogoVisible
(
false
);
mapView
.
enableWrapAround
(
false
);
// 添加地图图层
t_vec
=
new
TianDiTuTiledMapServiceLayer
(
TianDiTuLayerTypes
.
VEC_C
);
mapView
.
addLayer
(
t_vec
);
...
...
@@ -206,10 +211,6 @@ public class MainActivity extends AppCompatActivity {
});
// GPS
locationDisplayManager
=
mapView
.
getLocationDisplayManager
();
locationDisplayManager
.
setShowLocation
(
true
);
locationDisplayManager
.
setAutoPanMode
(
LocationDisplayManager
.
AutoPanMode
.
LOCATION
);
//设置模式
locationDisplayManager
.
setShowPings
(
true
);
locationDisplayManager
.
setLocationListener
(
new
LocationListener
()
{
@Override
public
void
onLocationChanged
(
Location
location
)
{
...
...
app/src/main/java/com/pashanhoo/landsurvey/layers/tianditu/TianDiTuLayerTypes.java
View file @
d1db004
...
...
@@ -31,7 +31,11 @@ public enum TianDiTuLayerTypes implements BaseTiledMapServiceType {
/**
* 地形注记
*/
CTA_C
;
CTA_C
,
/**
* 浙江省矢量图
*/
VEC_C_ZJ
;
public
void
setName
()
{
...
...
app/src/main/java/com/pashanhoo/landsurvey/layers/tianditu/TianDiTuTiledMapServiceLayer.java
View file @
d1db004
...
...
@@ -199,7 +199,7 @@ public class TianDiTuTiledMapServiceLayer extends TiledServiceLayer {
default
:
return
null
;
}
Log
.
i
(
"map"
,
url
.
toString
());
try
{
// 首先从离线数据库中读取
result
=
getOfflineCacheDB
(
level
,
col
,
row
);
...
...
app/src/main/java/com/pashanhoo/landsurvey/utils/AppInfo.java
View file @
d1db004
...
...
@@ -19,7 +19,7 @@ public class AppInfo {
public
static
SQLiteDatabase
mapcachedb
;
public
static
Point
initPoint
=
new
Point
(
1
16.39167
,
39.90333
);
public
static
Point
initPoint
=
new
Point
(
1
21.557167
,
21.87
);
public
static
double
initRes
=
TDTTileinfo
.
getRes4490
()[
17
];
// public static double initRes = TDTTileinfo.getRes4326()[6];
...
...
Please
register
or
sign in
to post a comment