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
b9cc8134
authored
2018-03-26 17:26:32 +0800
by
chiangbt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update2
1 parent
f878e201
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletions
app/src/main/java/com/pashanhoo/landsurvey/MainActivity.java
app/src/main/java/com/pashanhoo/landsurvey/layers/tianditu/TDTTileinfo.java
app/src/main/java/com/pashanhoo/landsurvey/layers/tianditu/TianDiTuLocalTiledMapServiceLayer.java
app/src/main/java/com/pashanhoo/landsurvey/MainActivity.java
View file @
b9cc813
...
...
@@ -14,6 +14,7 @@ import android.view.MenuItem;
import
com.esri.android.map.LocationDisplayManager
;
import
com.esri.android.map.MapView
;
import
com.esri.android.map.event.OnStatusChangedListener
;
import
com.esri.android.map.event.OnZoomListener
;
import
com.esri.android.runtime.ArcGISRuntime
;
import
com.esri.core.geometry.Point
;
import
com.pashanhoo.landsurvey.layers.tianditu.TDTTileinfo
;
...
...
@@ -118,6 +119,20 @@ public class MainActivity extends AppCompatActivity {
}
}
});
mapView
.
setOnZoomListener
(
new
OnZoomListener
()
{
@Override
public
void
preAction
(
float
v
,
float
v1
,
double
v2
)
{
}
@Override
public
void
postAction
(
float
v
,
float
v1
,
double
v2
)
{
Log
.
i
(
"map"
,
String
.
valueOf
(
TDTTileinfo
.
getCurrentLevel
(
mapView
.
getResolution
())));
int
level
=
TDTTileinfo
.
getCurrentLevel
(
mapView
.
getResolution
());
if
(
level
>
7
||
level
<
10
){
t_local
.
clearTiles
();
}
}
});
// GPS
locationDisplayManager
=
mapView
.
getLocationDisplayManager
();
...
...
app/src/main/java/com/pashanhoo/landsurvey/layers/tianditu/TDTTileinfo.java
View file @
b9cc813
...
...
@@ -141,4 +141,13 @@ public class TDTTileinfo {
public
static
int
getTileHeight
()
{
return
tileHeight
;
}
public
static
int
getCurrentLevel
(
double
resolution
){
for
(
int
i
=
0
;
i
<
res4490
.
length
;
i
++){
if
((
res4490
[
i
]
-
resolution
)<
0.001
){
return
i
;
}
}
return
0
;
}
}
...
...
app/src/main/java/com/pashanhoo/landsurvey/layers/tianditu/TianDiTuLocalTiledMapServiceLayer.java
View file @
b9cc813
...
...
@@ -78,7 +78,7 @@ public class TianDiTuLocalTiledMapServiceLayer extends TiledServiceLayer {
private
byte
[]
getOfflineCacheDB
(
int
level
,
int
col
,
int
row
)
throws
Exception
{
byte
[]
result
=
null
;
Log
.
i
(
"local"
,
level
+
":"
+
col
+
":"
+
row
);
//
Log.i("local", level + ":"+ col + ":" + row);
// row = (int) (Math.pow(2, level) - col - row);
String
sql
=
"select * from "
+
this
.
layername
+
" where TILELEVEL = "
+
level
+
" and TILECOL = "
+
col
+
" and TILEROW = "
+
row
;
...
...
Please
register
or
sign in
to post a comment