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
df323ef8
authored
2018-04-04 10:44:17 +0800
by
chiangbt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
更新说明信息
1 parent
1893f972
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
39 deletions
app/src/main/AndroidManifest.xml
app/src/main/java/com/pashanhoo/landsurvey/GoogleMapActivity.java
app/src/main/java/com/pashanhoo/landsurvey/layers/tencent/TencentMapLayerTypes.java
app/src/main/java/com/pashanhoo/landsurvey/layers/tencent/TencentMapsTiledServiceLayer.java
app/src/main/java/com/pashanhoo/landsurvey/utils/AppInfo.java
app/src/main/res/layout/activity_google_map.xml
app/src/main/AndroidManifest.xml
View file @
df323ef
...
...
@@ -22,13 +22,13 @@
android:label=
"@string/app_name"
android:screenOrientation=
"landscape"
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=
".GoogleMapActivity"
></activity>
<activity
android:name=
".BaiduMapActivity"
></activity>
</application>
...
...
app/src/main/java/com/pashanhoo/landsurvey/GoogleMapActivity.java
View file @
df323ef
...
...
@@ -64,29 +64,34 @@ public class GoogleMapActivity extends AppCompatActivity {
mapView
.
setEsriLogoVisible
(
false
);
mapView
.
enableWrapAround
(
false
);
// GoogleMapsTiledServiceLayer GOOGLE_VECTOR_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.VECTOR_GOOGLE_MAP);
// GoogleMapsTiledServiceLayer GOOGLE_TER_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.TERRAIN_GOOGLE_MAP);
// GoogleMapsTiledServiceLayer GOOGLE_IMAGE_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.IMAGE_GOOGLE_MAP);
// mapView.addLayer(GOOGLE_IMAGE_Layer);
// GoogleMapsTiledServiceLayer GOOGLE_ANNO_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.IMAGE_ANNO_GOOGLE_MAP);
// mapView.addLayer(GOOGLE_ANNO_Layer);
// GoogleMapsTiledServiceLayer OSM_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.OSM_Map);
// mapView.addLayer(GOOGLE_VECTOR_Layer);
//---------------------------------------------------------------------------------------------------------------------
/**
GoogleMapsTiledServiceLayer GOOGLE_VECTOR_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.VECTOR_GOOGLE_MAP);
GoogleMapsTiledServiceLayer GOOGLE_TER_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.TERRAIN_GOOGLE_MAP);
GoogleMapsTiledServiceLayer GOOGLE_IMAGE_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.IMAGE_GOOGLE_MAP);
mapView.addLayer(GOOGLE_IMAGE_Layer);
GoogleMapsTiledServiceLayer GOOGLE_ANNO_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.IMAGE_ANNO_GOOGLE_MAP);
mapView.addLayer(GOOGLE_ANNO_Layer);
GoogleMapsTiledServiceLayer OSM_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.OSM_Map);
mapView.addLayer(GOOGLE_VECTOR_Layer);
*/
/**
// 高德矢量图层(含路网,含注记)
final GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_VECTOR);
// 高德影像图层(不含路网,不含注记)
//
GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_IMAGE);
GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_IMAGE);
// 高德路网图层(含路网,含注记)
//
GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_ROAD);
GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_ROAD);
// 高德实时交通图层
//
GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_TRAFFIC);
GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_TRAFFIC);
mapView.addLayer(gaodeMapsTiledServiceLayer);
//---------------------------------------------------------------------------------------------------------------------
*/
// TencentMapsTiledServiceLayer tencentMapsTiledServiceLayer = new TencentMapsTiledServiceLayer(TencentMapLayerTypes.TENCENT_MAP_VECTOR);
// mapView.addLayer(tencentMapsTiledServiceLayer);
TencentMapsTiledServiceLayer
tencentMapsTiledServiceLayer
=
new
TencentMapsTiledServiceLayer
(
TencentMapLayerTypes
.
TENCENT_MAP_TERRAIN
);
TencentMapsTiledServiceLayer
tencentMapsTiledServiceLayer2
=
new
TencentMapsTiledServiceLayer
(
TencentMapLayerTypes
.
TENCENT_MAP_ROAD
);
mapView
.
addLayer
(
tencentMapsTiledServiceLayer
);
mapView
.
addLayer
(
tencentMapsTiledServiceLayer2
);
//---------------------------------------------------------------------------------------------------------------------
// GeoQMapsTiledServiceLayer geoQMapsTiledServiceLayer = new GeoQMapsTiledServiceLayer(GeoQMapLayerTypes.ChinaOnlineCommunity_Mobile);
...
...
@@ -96,13 +101,13 @@ public class GoogleMapActivity extends AppCompatActivity {
graphicsLayer
=
new
GraphicsLayer
();
mapView
.
addLayer
(
graphicsLayer
);
mapView
.
setMaxResolution
(
156543.03392800014
);
mapView
.
setMinResolution
(
0.29858214164761665
);
mapView
.
setMaxResolution
(
TencentMapsTiledServiceLayer
.
getRes
(
2
)
);
mapView
.
setMinResolution
(
TencentMapsTiledServiceLayer
.
getRes
(
18
)
);
Point
curPt
=
JZLocationConverter
.
wgs84ToGcj02
(
AppInfo
.
initPoint
);
Point
pt
=
GISHelper
.
lonLat2Mercator
(
curPt
);
mapView
.
zoomToResolution
(
pt
,
GoogleMapsTiledServiceLayer
.
getRes
(
17
));
mapView
.
zoomToResolution
(
pt
,
TencentMapsTiledServiceLayer
.
getRes
(
14
));
locationDisplayManager
=
mapView
.
getLocationDisplayManager
();
locationDisplayManager
.
setShowLocation
(
true
);
...
...
@@ -158,7 +163,7 @@ public class GoogleMapActivity extends AppCompatActivity {
POISuggestion
colorSuggestion
=
(
POISuggestion
)
searchSuggestion
;
Point
poipt
=
new
Point
(
colorSuggestion
.
getLng
(),
colorSuggestion
.
getLat
());
mapView
.
zoomToResolution
(
GISHelper
.
lonLat2Mercator
(
poipt
),
gaode
MapsTiledServiceLayer
.
getRes
(
18
));
mapView
.
zoomToResolution
(
GISHelper
.
lonLat2Mercator
(
poipt
),
Tencent
MapsTiledServiceLayer
.
getRes
(
18
));
graphicsLayer
.
addGraphic
(
new
Graphic
(
GISHelper
.
lonLat2Mercator
(
poipt
),
new
PictureMarkerSymbol
(
getResources
().
getDrawable
(
R
.
mipmap
.
locator
)).
setOffsetY
(
16
)));
...
...
app/src/main/java/com/pashanhoo/landsurvey/layers/tencent/TencentMapLayerTypes.java
View file @
df323ef
...
...
@@ -20,7 +20,7 @@ public enum TencentMapLayerTypes implements BaseTiledMapServiceType {
*/
TENCENT_MAP_ROAD
,
/**
* 腾讯
实时
* 腾讯
地形层
*/
TENCENT_MAP_TERRAIN
;
...
...
app/src/main/java/com/pashanhoo/landsurvey/layers/tencent/TencentMapsTiledServiceLayer.java
View file @
df323ef
...
...
@@ -28,11 +28,6 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer {
private
static
final
double
xmax
=
22041257.773878
;
private
static
final
double
ymax
=
20851350.0432886
;
private
static
final
double
XMin
=
110.35992000000005
;
private
static
final
double
YMin
=
31.382360000000062
;
private
static
final
double
XMax
=
116.65036000000009
;
private
static
final
double
YMax
=
36.36647000000005
;
private
static
final
double
[]
res
=
{
156543.03392800014
,
78271.516963999937
,
...
...
@@ -75,7 +70,8 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer {
9027.9774109999998
,
4513.9887049999998
,
2256.994353
,
1128.497176
};
1128.497176
};
private
static
String
URL
=
"http://maps.iwxlh.com"
;
private
static
Point
origin
=
new
Point
(-
20037508.342787
,
20037508.342787
);
...
...
@@ -138,8 +134,7 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer {
switch
(
tencentMapLayerTypes
)
{
case
TENCENT_MAP_VECTOR:
url
=
"http://rt"
+
(
col
%
4
)
+
".map.gtimg.com/tile?"
+
"z="
+
level
+
"&x="
+
col
+
"&y="
+
row
+
"&type=vector&styleid=0"
;
+
"z="
+
level
+
"&x="
+
col
+
"&y="
+
row
+
"&type=vector&styleid=0"
;
break
;
case
TENCENT_MAP_IMAGE:
url
=
"http://p"
+
(
col
%
4
)
+
".map.gtimg.com/sateTiles/"
+
level
+
"/"
+
(
int
)
Math
.
floor
(
col
/
16
)
+
"/"
+
(
int
)
Math
.
floor
(
row
/
16
)
...
...
@@ -147,8 +142,7 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer {
break
;
case
TENCENT_MAP_ROAD:
url
=
"http://rt"
+
(
col
%
4
)
+
".map.gtimg.com/tile?"
+
"z="
+
level
+
"&x="
+
col
+
"&y="
+
row
+
"&type=vector&styleid=3"
;
+
"z="
+
level
+
"&x="
+
col
+
"&y="
+
row
+
"&type=vector&styleid=3"
;
break
;
case
TENCENT_MAP_TERRAIN:
url
=
"http://p"
+
(
col
%
4
)
+
".map.gtimg.com/demTiles/"
+
level
+
"/"
+
(
int
)
Math
.
floor
(
col
/
16
)
+
"/"
+
(
int
)
Math
.
floor
(
row
/
16
)
...
...
@@ -156,8 +150,7 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer {
break
;
case
TENCENT_MAP_VECTOR_NIGHT:
url
=
"http://rt"
+
(
col
%
4
)
+
".map.gtimg.com/tile?"
+
"z="
+
level
+
"&x="
+
col
+
"&y="
+
row
+
"&type=vector&styleid=4"
;
+
"z="
+
level
+
"&x="
+
col
+
"&y="
+
row
+
"&type=vector&styleid=4"
;
break
;
}
try
{
...
...
app/src/main/java/com/pashanhoo/landsurvey/utils/AppInfo.java
View file @
df323ef
...
...
@@ -5,10 +5,11 @@ import android.os.Environment;
import
android.util.Log
;
import
com.esri.core.geometry.Point
;
import
com.pashanhoo.landsurvey.layers.t
ianditu.TianDiTuLocalTiledMap
ServiceLayer
;
import
com.pashanhoo.landsurvey.layers.t
encent.TencentMapsTiled
ServiceLayer
;
import
com.pashanhoo.landsurvey.layers.tianditu.TianDiTuTiledMapServiceLayer
;
import
java.io.File
;
import
java.util.ArrayList
;
/**
* Created by jiangbotao on 2018/3/23.
...
...
@@ -24,8 +25,7 @@ public class AppInfo {
public
static
Point
initPoint
=
new
Point
(
118.778644
,
32.05212
);
public
static
double
initRes
=
TianDiTuTiledMapServiceLayer
.
getRes
(
17
);
// public static double initRes = TDTTileinfo.getRes4326()[6];
public
static
double
initRes3857
=
TencentMapsTiledServiceLayer
.
getRes
(
17
);
public
static
void
Settings
(){
// 新建地图缓存数据库,不要试图新建多级目录,切记切记,如keymapinfo/cache
...
...
app/src/main/res/layout/activity_google_map.xml
View file @
df323ef
...
...
@@ -49,7 +49,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/epsg_target"
android:tint=
"@color/color
Accent
"
android:tint=
"@color/color
Red
"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
Please
register
or
sign in
to post a comment