Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
app-FounderMap
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
app-FounderMap
Commits
8753c057
Commit
8753c057
authored
Aug 31, 2020
by
Luosp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加热力图功能
parent
429f6c96
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
298 additions
and
47 deletions
+298
-47
app/src/main/java/cn/com/founder/arcgisserver/MainActivity.java
+24
-2
arcgislib/build.gradle
+3
-2
arcgislib/libs/MineNaviSDK-2.0.7.3.aar
+0
-0
arcgislib/src/main/java/cn/com/founder/arcgislib/constants/Constants.java
+71
-38
arcgislib/src/main/java/cn/com/founder/arcgislib/draw/ArcGisDraw.java
+17
-0
arcgislib/src/main/java/cn/com/founder/arcgislib/draw/option/IArcGisDrawOption.java
+13
-0
arcgislib/src/main/java/cn/com/founder/arcgislib/hotpots/ArcGisHotPots.java
+9
-0
arcgislib/src/main/java/cn/com/founder/arcgislib/hotpots/option/IArcGisHotPotsOption.java
+8
-0
arcgislib/src/main/java/cn/com/founder/arcgislib/utils/ToolUtil.java
+51
-0
arcgislib/src/main/java/cn/com/founder/arcgislib/view/ArcGisClusterView.java
+4
-1
arcgislib/src/main/java/cn/com/founder/arcgislib/view/ArcGisDrawView.java
+55
-0
arcgislib/src/main/java/cn/com/founder/arcgislib/view/ArcGisHotPotsView.java
+0
-0
arcgislib/src/main/java/cn/com/founder/arcgislib/view/ArcGisNaviView.java
+0
-0
arcgislib/src/main/java/cn/com/founder/arcgislib/widget/draw/DrawLayer.java
+24
-4
arcgislib/src/main/java/cn/com/founder/arcgislib/widget/draw/DrawView.java
+19
-0
No files found.
app/src/main/java/cn/com/founder/arcgisserver/MainActivity.java
View file @
8753c057
...
...
@@ -55,9 +55,9 @@ public class MainActivity extends AppCompatActivity {
.
setDefaultArcGisCompass
()
//设置默认罗盘
// .setOpenNavi()//开启导航
// .setOpenSearch()//开启搜索
// .setOpenHotPots()//开启热力图
// .setOpenCluster()//开启聚合
.
setOpenDraw
()
//开启绘制
// .setOpenHotPots()//开启热力图
// .setOpenDraw()//开启绘制
.
createArcGisFounder
();
//创建ArcGisFounder地图实例
IArcGisZoomOption
iArcGisZoomOption
=
arcGisFounder
.
arcGisZoomOption
();
...
...
@@ -151,5 +151,27 @@ public class MainActivity extends AppCompatActivity {
// + "\n补充信息:" + locationModel.getExtraInfo()
// , Toast.LENGTH_LONG).show());
// IArcGisHotPotsOption iArcGisHotPotsOption = arcGisFounder.arcGisHotPotsOption();
//
// List<PointModel> pointList = new ArrayList<>();
// pointList.add(new PointModel(113.935576,22.995918));
// pointList.add(new PointModel(113.959722,23.000176));
// pointList.add(new PointModel(113.97582,22.949069));
// pointList.add(new PointModel(113.952823,22.916051));
// pointList.add(new PointModel(114.019513,22.951198));
// iArcGisHotPotsOption.setHotPotsPonitData(pointList);
// IArcGisDrawOption iArcGisDrawOption = arcGisFounder.arcGisDrawOption();
//
// List<PointModel> pointList = new ArrayList<>();
// pointList.add(new PointModel(113.935576,22.995918));
// pointList.add(new PointModel(113.959722,23.000176));
// pointList.add(new PointModel(113.97582,22.949069));
// pointList.add(new PointModel(113.952823,22.916051));
// pointList.add(new PointModel(114.019513,22.951198));
// iArcGisDrawOption.setDrawPointData("CIRCLE",pointList);
}
}
arcgislib/build.gradle
View file @
8753c057
...
...
@@ -54,6 +54,7 @@ android {
}
dependencies
{
//导航
implementation
fileTree
(
include:
[
'*.jar'
,
'*.aar'
],
dir:
'libs'
)
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
'androidx.constraintlayout:constraintlayout:1.1.3'
...
...
@@ -62,12 +63,12 @@ dependencies {
api
'com.esri.arcgisruntime:arcgis-android:100.6.0'
//权限
implementation
'com.yanzhenjie:permission:2.0.3'
//日志
//日志
类
implementation
'com.jakewharton.timber:timber:4.5.1'
//工具类
implementation
'com.google.code.gson:gson:2.8.5'
implementation
'com.mapzen.android:lost:2.1.2'
implementation
'com.squareup.okhttp3:okhttp:3.12.3'
}
apply
from:
'../mvn_push.gradle'
arcgislib/libs/MineNaviSDK-2.0.7.3.aar
deleted
100644 → 0
View file @
429f6c96
File deleted
arcgislib/src/main/java/cn/com/founder/arcgislib/constants/Constants.java
View file @
8753c057
...
...
@@ -9,7 +9,7 @@ package cn.com.founder.arcgislib.constants;
*/
public
class
Constants
{
/*****************************************互联网*********************************************
/
/*****************************************互联网*********************************************
//互联网-地图
private static String baseUrl = "http://47.92.225.109:6080/arcgis/rest/services/founder/dg20191120/MapServer";
//互联网-Geo
...
...
@@ -18,54 +18,74 @@ public class Constants {
private static String searchUrl = "http://47.92.226.24:8051/selectPoiDataList";
//互联网-导航
private static String naviUrl = "minedata.cn/lbsservice/navi/";
//二标四实-单位
private
static
String
dwUrl
=
"http://68.174.69.46:8051/selectVdwjx"
;
//二标四实-房屋
private
static
String
fwUrl
=
"http://68.174.69.46:8051/selectVfwjx"
;
//二标四实-地址
private
static
String
dzUrl
=
"http://68.174.69.46:8051/selectVdzjx"
;
//二标四实-单位
private static String dwUrl = "http://68.174.69.46:8051/selectVdwjx";
//二标四实-房屋
private static String fwUrl = "http://68.174.69.46:8051/selectVfwjx";
//二标四实-地址
private static String dzUrl = "http://68.174.69.46:8051/selectVdzjx";
//华为网关鉴权服务-accessToken(导航时调用)
private static String apiGUrl = "https://68.26.19.197:8343/v1/apigw/oauth2/token";
//华为网关鉴权服务-userToken(导航时调用)
private static String apiGLoginUrl = "http://68.26.19.197:8380/dcuc/api/checklogin.action";
//热力图
private static String hotMapUrl = "http://47.92.225.109:6080/arcgis/rest/services/gp/rltModel/GPServer/hotPotServer";
/
**********************************************************************************************
/
/ private static String hotMapUrl = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/911CallsHotspot/GPServer/911%20Calls%20Hotspot";
/**********************************************************************************************/
/*****************************************用户网***********************************************
//如果使用公安局的映射,导航907和958行代码需要修改坐标系
//用户网-地图
private static String baseUrl = "http://192.168.2.56:19076/arcgis/rest/services/founder/dg20191120/MapServer";
//用户网-导航
private static String naviUrl = "http://192.168.2.56:19085/PPmap/LBSservice";
//公安网-Geo
private static String baseGeoUrl = "http://192.168.2.56:19087/esBzdzTestQuery";
//用户网-搜索
private static String searchUrl = "http://192.168.2.56:19084/selectPoiDataList";
//二标四实-单位
private static String dwUrl = "http://192.168.2.56:19084/selectVdwjx";
//二标四实-房屋
private static String fwUrl = "http://192.168.2.56:19084/selectVfwjx";
//二标四实-地址
private static String dzUrl = "http://192.168.2.56:19084/selectVdzjx";
/**********************************************************************************************/
/*****************************************用户网***********************************************/
//如果使用公安局的映射,导航907和958行代码需要修改坐标系
//用户网-地图
private
static
String
baseUrl
=
"http://192.168.2.56:19076/arcgis/rest/services/founder/dg20191120/MapServer"
;
//用户网-导航
private
static
String
naviUrl
=
"http://192.168.2.56:19085/PPmap/LBSservice"
;
//公安网-Geo
private
static
String
baseGeoUrl
=
"http://192.168.2.56:19087/esBzdzTestQuery"
;
//用户网-搜索
private
static
String
searchUrl
=
"http://192.168.2.56:19084/selectPoiDataList"
;
//二标四实-单位
private
static
String
dwUrl
=
"http://192.168.2.56:19084/selectVdwjx"
;
//二标四实-房屋
private
static
String
fwUrl
=
"http://192.168.2.56:19084/selectVfwjx"
;
//二标四实-地址
private
static
String
dzUrl
=
"http://192.168.2.56:19084/selectVdzjx"
;
//华为网关鉴权服务-accessToken(导航时调用)
private
static
String
apiGUrl
=
"https://68.26.19.197:8343/v1/apigw/oauth2/token"
;
//华为网关鉴权服务-userToken(导航时调用)
private
static
String
apiGLoginUrl
=
"http://68.26.19.197:8380/dcuc/api/checklogin.action"
;
//热力图
private
static
String
hotMapUrl
=
"http://192.168.2.56:19088/arcgis/rest/services/gp/rltModel/GPServer/hotPotServer"
;
/**********************************************************************************************
/*****************************************公安网***********************************************
//公安网-地图
private static String baseUrl = "http://68.174.69.45:6080/arcgis/rest/services/founder/dg20191120/MapServer";
//公安网-Geo
private static String baseGeoUrl = "http://68.174.25.107:8090/esBzdzTestQuery";
//公安网-搜索
private static String searchUrl = "http://68.174.69.46:8051/selectPoiDataList";
//公安网-导航
private static String naviUrl = "http://68.26.19.197:8380/PPmap/LBSservice";
//公安网-地图
private static String baseUrl = "http://68.174.69.45:6080/arcgis/rest/services/founder/dg20191120/MapServer";
//公安网-Geo
private static String baseGeoUrl = "http://68.174.25.107:8090/esBzdzTestQuery";
//公安网-搜索
private static String searchUrl = "http://68.174.69.46:8051/selectPoiDataList";
//公安网-导航
// private static String naviUrl = "http://68.26.19.197:8380/PPmap/LBSservice";
private static String naviUrl = "68.26.19.197:8380/PPmap/LBSservice2/";
//二标四实-单位
private static String dwUrl = "http://68.174.69.46:8051/selectVdwjx";
//二标四实-房屋
private static String fwUrl = "http://68.174.69.46:8051/selectVfwjx";
//二标四实-地址
private static String dzUrl = "http://68.174.69.46:8051/selectVdzjx";
//华为网关鉴权服务-accessToken(导航时调用)
private static String apiGUrl = "https://68.26.19.197:8343/v1/apigw/oauth2/token";
//华为网关鉴权服务-userToken(导航时调用)
private static String apiGLoginUrl = "http://68.26.19.197:8380/dcuc/api/checklogin.action";
//热力图
private static String hotMapUrl = "http://68.174.69.45:6081/arcgis/rest/services/gp/rltModel/GPServer/hotPotServer";
/**********************************************************************************************/
/**********************************************************************************************/
// argis证书
private
static
String
baseRunTime
=
"runtimelite,1000,rud9526010123,none,XXMFA0PL4S0MC2EN0175"
;
...
...
@@ -73,9 +93,11 @@ public class Constants {
private
static
String
baseTianDiTuKey
=
"39edeab91620fe3c5a1b282228ef6e46"
;
//天地图Geo
private
static
String
baseTianDiTuGeoUrl
=
"http://api.tianditu.gov.cn/geocoder"
;
//测试热力图
private
static
String
hotPotsUrl
=
"https://sampleserver6.arcgisonline.com/arcgis/rest/services/911CallsHotspot/GPServer/911%20Calls%20Hotspot"
;
//华为鉴权
private
static
String
baseHuaweiAuthA
=
"445281199401182770"
;
private
static
String
baseHuaweiAuthP
=
"JWY123@cjh"
;
private
static
String
baseHuaweiAuthAppKey
=
"2a1c50f40af443a4b58d1375e87a4810"
;
private
static
String
baseHuaweiAuthAppSecret
=
"1321cbbf9f3947108aee3f44ea007485"
;
//arcGis证书
public
static
final
String
BASE_MAP_RUNTIME
=
baseRunTime
;
//服务器Url
...
...
@@ -91,7 +113,7 @@ public class Constants {
//导航
public
static
final
String
BASE_NAVI_URL
=
naviUrl
;
//热力图
public
static
final
String
BASE_HOT_POTS_URL
=
hot
Pots
Url
;
public
static
final
String
BASE_HOT_POTS_URL
=
hot
Map
Url
;
//二标四实-房屋
public
static
final
String
BASE_FW_URL
=
fwUrl
;
...
...
@@ -100,4 +122,15 @@ public class Constants {
//二标四实-单位
public
static
final
String
BASE_DW_URL
=
dwUrl
;
//华为网关鉴权服务-accessToken
public
static
final
String
BASE_APIG_URL
=
apiGUrl
;
//华为鉴权
public
static
final
String
BASE_HUA_WEI_AUTHA
=
baseHuaweiAuthA
;
public
static
final
String
BASE_HUA_WEI_AUTHP
=
baseHuaweiAuthP
;
public
static
final
String
BASE_HUA_WEI_AUTH_APPKEY
=
baseHuaweiAuthAppKey
;
public
static
final
String
BASE_HUA_WEI_AUTH_APP_SECRET
=
baseHuaweiAuthAppSecret
;
//华为网关鉴权服务-userToken
public
static
final
String
BASE_APIG_LOGIN_URL
=
apiGLoginUrl
;
}
arcgislib/src/main/java/cn/com/founder/arcgislib/draw/ArcGisDraw.java
View file @
8753c057
package
cn
.
com
.
founder
.
arcgislib
.
draw
;
import
java.util.List
;
import
cn.com.founder.arcgislib.common.Variable
;
import
cn.com.founder.arcgislib.draw.option.IArcGisDrawOption
;
import
cn.com.founder.arcgislib.model.PointModel
;
import
cn.com.founder.arcgislib.view.ArcGisDrawView
;
/**
...
...
@@ -38,4 +41,18 @@ public class ArcGisDraw implements IArcGisDrawOption {
mArcGisDrawView
.
setDrawImage
(
drawImage
);
return
this
;
}
/**
* @param canvaType 绘制类型:
* "LINE" 线
* "POLYGON" 多边形
* "ORTHOGON" 矩形
* "CIRCLE" 圆
* @param pointModelList 数据集合点
*/
@Override
public
IArcGisDrawOption
setDrawPointData
(
String
canvaType
,
List
<
PointModel
>
pointModelList
)
{
mArcGisDrawView
.
setDrawPointData
(
canvaType
,
pointModelList
);
return
this
;
}
}
arcgislib/src/main/java/cn/com/founder/arcgislib/draw/option/IArcGisDrawOption.java
View file @
8753c057
package
cn
.
com
.
founder
.
arcgislib
.
draw
.
option
;
import
java.util.List
;
import
cn.com.founder.arcgislib.common.Variable
;
import
cn.com.founder.arcgislib.model.PointModel
;
/**
* Copyright: 方正国际软件有限公司
...
...
@@ -25,4 +28,14 @@ public interface IArcGisDrawOption {
* @param drawImage int(资源ID)-绘制图片
*/
IArcGisDrawOption
setDrawImage
(
int
drawImage
);
/**
* @param canvaType 绘制类型:
* "LINE" 线
* "POLYGON" 多边形
* "ORTHOGON" 矩形 2的倍数点
* "CIRCLE" 圆 2的倍数点
* @param pointModelList 数据集合点
*/
IArcGisDrawOption
setDrawPointData
(
String
canvaType
,
List
<
PointModel
>
pointModelList
);
}
arcgislib/src/main/java/cn/com/founder/arcgislib/hotpots/ArcGisHotPots.java
View file @
8753c057
package
cn
.
com
.
founder
.
arcgislib
.
hotpots
;
import
java.util.List
;
import
cn.com.founder.arcgislib.common.Variable
;
import
cn.com.founder.arcgislib.hotpots.option.IArcGisHotPotsOption
;
import
cn.com.founder.arcgislib.model.PointModel
;
import
cn.com.founder.arcgislib.view.ArcGisHotPotsView
;
/**
...
...
@@ -37,4 +40,10 @@ public class ArcGisHotPots implements IArcGisHotPotsOption {
mArcGisHotPots
.
setHotPotsImage
(
hotPotsImage
);
return
this
;
}
@Override
public
IArcGisHotPotsOption
setHotPotsPonitData
(
List
<
PointModel
>
pointList
)
{
mArcGisHotPots
.
setHotPotsPointData
(
pointList
);
return
this
;
}
}
arcgislib/src/main/java/cn/com/founder/arcgislib/hotpots/option/IArcGisHotPotsOption.java
View file @
8753c057
package
cn
.
com
.
founder
.
arcgislib
.
hotpots
.
option
;
import
java.util.List
;
import
cn.com.founder.arcgislib.common.Variable
;
import
cn.com.founder.arcgislib.model.PointModel
;
/**
* Copyright: 方正国际软件有限公司
...
...
@@ -25,4 +28,9 @@ public interface IArcGisHotPotsOption {
* @param hotPotsImage int(资源ID)-热力图图片
*/
IArcGisHotPotsOption
setHotPotsImage
(
int
hotPotsImage
);
/**
* @param pointList 点集合
*/
IArcGisHotPotsOption
setHotPotsPonitData
(
List
<
PointModel
>
pointList
);
}
arcgislib/src/main/java/cn/com/founder/arcgislib/utils/ToolUtil.java
View file @
8753c057
...
...
@@ -19,11 +19,20 @@ import java.io.File;
import
java.io.FileInputStream
;
import
java.io.InputStreamReader
;
import
java.math.BigDecimal
;
import
java.security.SecureRandom
;
import
java.security.cert.X509Certificate
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Timer
;
import
java.util.TimerTask
;
import
javax.net.ssl.HostnameVerifier
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.SSLSession
;
import
javax.net.ssl.SSLSocketFactory
;
import
javax.net.ssl.TrustManager
;
import
javax.net.ssl.X509TrustManager
;
import
cn.com.founder.arcgislib.common.Variable
;
/**
...
...
@@ -277,4 +286,46 @@ public class ToolUtil {
return
null
;
}
//获取这个SSLSocketFactory
public
static
SSLSocketFactory
getSSLSocketFactory
()
{
try
{
SSLContext
sslContext
=
SSLContext
.
getInstance
(
"SSL"
);
sslContext
.
init
(
null
,
getTrustManager
(),
new
SecureRandom
());
return
sslContext
.
getSocketFactory
();
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
//获取TrustManager
private
static
TrustManager
[]
getTrustManager
()
{
TrustManager
[]
trustAllCerts
=
new
TrustManager
[]{
new
X509TrustManager
()
{
@Override
public
void
checkClientTrusted
(
X509Certificate
[]
chain
,
String
authType
)
{
}
@Override
public
void
checkServerTrusted
(
X509Certificate
[]
chain
,
String
authType
)
{
}
@Override
public
X509Certificate
[]
getAcceptedIssuers
()
{
return
new
X509Certificate
[]{};
}
}
};
return
trustAllCerts
;
}
//获取HostnameVerifier
public
static
HostnameVerifier
getHostnameVerifier
()
{
HostnameVerifier
hostnameVerifier
=
new
HostnameVerifier
()
{
@Override
public
boolean
verify
(
String
s
,
SSLSession
sslSession
)
{
return
true
;
}
};
return
hostnameVerifier
;
}
}
arcgislib/src/main/java/cn/com/founder/arcgislib/view/ArcGisClusterView.java
View file @
8753c057
...
...
@@ -169,7 +169,6 @@ public class ArcGisClusterView extends LinearLayout implements View.OnClickListe
mPointCollection
=
new
PointCollection
(
SpatialReference
.
create
(
4326
));
mClusterStyleBuilder
=
new
ClusterStyleBuilder
(
mContext
);
// addFeatureLayer();
}
...
...
@@ -193,6 +192,10 @@ public class ArcGisClusterView extends LinearLayout implements View.OnClickListe
@Override
public
void
onClick
(
View
view
)
{
if
(
clusterLayer
==
null
){
return
;
}
if
(
isClean
)
{
graphicsOverlay
.
setVisible
(
false
);
clusterLayer
.
setGraphicVisible
(
false
);
...
...
arcgislib/src/main/java/cn/com/founder/arcgislib/view/ArcGisDrawView.java
View file @
8753c057
package
cn
.
com
.
founder
.
arcgislib
.
view
;
import
android.content.Context
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
import
android.view.Gravity
;
import
android.view.MotionEvent
;
...
...
@@ -8,13 +9,19 @@ import android.view.View;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.Toast
;
import
androidx.annotation.Nullable
;
import
com.esri.arcgisruntime.geometry.Point
;
import
com.esri.arcgisruntime.geometry.SpatialReference
;
import
com.esri.arcgisruntime.mapping.view.MapView
;
import
java.util.List
;
import
cn.com.founder.arcgislib.R
;
import
cn.com.founder.arcgislib.common.Variable
;
import
cn.com.founder.arcgislib.model.PointModel
;
import
cn.com.founder.arcgislib.widget.draw.DrawEntity
;
import
cn.com.founder.arcgislib.widget.draw.DrawLayer
;
import
cn.com.founder.arcgislib.widget.draw.DrawView
;
...
...
@@ -235,6 +242,54 @@ public class ArcGisDrawView extends LinearLayout implements View.OnClickListener
mDrawIv
.
setImageDrawable
(
getResources
().
getDrawable
(
drawImage
));
}
public
void
setDrawPointData
(
String
canvaType
,
List
<
PointModel
>
pointModelList
){
if
(
TextUtils
.
isEmpty
(
canvaType
)){
Toast
.
makeText
(
mContext
,
"请设置绘画类型"
,
Toast
.
LENGTH_LONG
).
show
();
return
;
}
boolean
isEmpty
=
pointModelList
==
null
||
pointModelList
.
isEmpty
();
if
(
isEmpty
)
{
Toast
.
makeText
(
mContext
,
"暂无数据源"
,
Toast
.
LENGTH_LONG
).
show
();
return
;
}
if
(
canvaType
.
equals
(
"LINE"
)){
//线
drawType
=
Variable
.
DrawType
.
LINE
;
mDrawView
.
endMeasure
();
}
else
if
(
canvaType
.
equals
(
"POLYGON"
)){
//多边形
drawType
=
Variable
.
DrawType
.
POLYGON
;
mDrawView
.
endMeasure
();
}
else
if
(
canvaType
.
equals
(
"ORTHOGON"
)){
//矩形
drawType
=
Variable
.
DrawType
.
ORTHOGON
;
}
else
if
(
canvaType
.
equals
(
"CIRCLE"
)){
//圆
drawType
=
Variable
.
DrawType
.
CIRCLE
;
}
for
(
PointModel
pointModel
:
pointModelList
)
{
double
x
=
pointModel
.
getxPoint
();
double
y
=
pointModel
.
getyPoint
();
if
(
x
<
0
||
y
<
0
){
break
;
}
Point
point
=
new
Point
(
x
,
y
,
SpatialReference
.
create
(
4326
));
if
(
drawType
==
Variable
.
DrawType
.
LINE
)
{
mDrawView
.
drawPointLine
(
point
);
}
else
if
(
drawType
==
Variable
.
DrawType
.
POLYGON
){
mDrawView
.
drawPointPolygon
(
point
);
}
else
if
(
drawType
==
Variable
.
DrawType
.
CIRCLE
){
mDrawView
.
drawCircle
(
point
);
}
else
if
(
drawType
==
Variable
.
DrawType
.
ORTHOGON
){
mDrawView
.
drawBox
(
point
);
}
}
drawType
=
null
;
DrawEntity
draw
=
mDrawView
.
endMeasure
();
}
@Override
public
void
onMapSingleTapUp
(
MotionEvent
e
)
{
...
...
arcgislib/src/main/java/cn/com/founder/arcgislib/view/ArcGisHotPotsView.java
View file @
8753c057
This diff is collapsed.
Click to expand it.
arcgislib/src/main/java/cn/com/founder/arcgislib/view/ArcGisNaviView.java
View file @
8753c057
This diff is collapsed.
Click to expand it.
arcgislib/src/main/java/cn/com/founder/arcgislib/widget/draw/DrawLayer.java
View file @
8753c057
...
...
@@ -109,10 +109,10 @@ public class DrawLayer {
}
private
SpatialReference
getSpatialReference
()
{
if
(
spatialReference
==
null
){
return
mapView
.
getSpatialReference
();
}
return
spatialReference
;
//
if(spatialReference==null){
//
return mapView.getSpatialReference();
//
}
return
SpatialReference
.
create
(
4326
)
;
}
protected
Object
drawByScreenPoint
(
android
.
graphics
.
Point
point
){
...
...
@@ -199,6 +199,16 @@ public class DrawLayer {
}
}
public
void
drawBox
(
Point
point
)
{
circlePointList
.
add
(
point
);
drawPoint
(
point
);
if
(
circlePointList
.
size
()==
2
){
drawBox
(
circlePointList
.
get
(
0
),
circlePointList
.
get
(
1
));
circlePointList
.
clear
();
removeGraphics
(
pointGraphicList
);
}
}
public
void
drawBox
(
Point
point1
,
Point
point2
)
{
PolygonBuilder
polygonGeometry
=
new
PolygonBuilder
(
getSpatialReference
());
polygonGeometry
.
addPoint
(
point1
);
...
...
@@ -217,6 +227,16 @@ public class DrawLayer {
removeGraphics
(
pointGraphicList
);
}
}
public
void
drawCircle
(
Point
point
)
{
circlePointList
.
add
(
point
);
drawPoint
(
point
);
if
(
circlePointList
.
size
()==
2
){
drawCircle
(
circlePointList
.
get
(
0
),
circlePointList
.
get
(
1
));
circlePointList
.
clear
();
removeGraphics
(
pointGraphicList
);
}
}
public
void
drawCircle
(
Point
point1
,
Point
point2
)
{
double
radius
=
0
;
double
x
=
(
point2
.
getX
()
-
point1
.
getX
());
...
...
arcgislib/src/main/java/cn/com/founder/arcgislib/widget/draw/DrawView.java
View file @
8753c057
...
...
@@ -124,8 +124,27 @@ public class DrawView extends DrawLayer{
PolygonBuilder
polygon
=(
PolygonBuilder
)
super
.
drawByGisPoint
(
point
);
showArea
(
polygon
);
}
}
public
void
drawPointLine
(
Point
point
){
if
(
drawType
==
null
)
{
super
.
startLine
();
drawType
=
Variable
.
DrawType
.
LINE
;
}
PolylineBuilder
line
=(
PolylineBuilder
)
super
.
drawByGisPoint
(
point
);
showLength
(
line
,
point
);
}
public
void
drawPointPolygon
(
Point
point
){
if
(
drawType
==
null
)
{
super
.
startPolygon
();
drawType
=
Variable
.
DrawType
.
POLYGON
;
}
PolygonBuilder
polygon
=(
PolygonBuilder
)
super
.
drawByGisPoint
(
point
);
showArea
(
polygon
);
}
private
void
drawScreenPoint
(
android
.
graphics
.
Point
screenPoint
){
Point
point
=
super
.
screenXYtoPpoint
(
screenPoint
.
x
,
screenPoint
.
y
);
if
(
drawType
==
Variable
.
DrawType
.
LINE
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment