<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>demo</title>
<!-- <link rel="stylesheet" href="https://js.arcgis.com/3.18/esri/css/esri.css">
<script src="https://js.arcgis.com/3.18/"></script> -->
<link rel="stylesheet" href="http://192.168.50.135/arcgis_js_v318_sdk/arcgis_js_api/library/3.18/3.18compact/dijit/themes/tundra/tundra.css">
<link rel="stylesheet" href="http://192.168.50.135/arcgis_js_v318_sdk/arcgis_js_api/library/3.18/3.18/esri/css/esri.css">
<script src="http://192.168.50.135/arcgis_js_v318_sdk/arcgis_js_api/library/3.18/3.18/init.js"></script>
<style>
html, body, #map {
height: 100%;
margin: 0;
padding: 0;
}
em{
font-style:normal;
}
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
.dot_box {
z-index: 2;
position: fixed;
width: 20px;
height: 20px;
background: #0080ff;
border-radius: 50%;
}
.line_ele {
z-index: 2;
position: absolute;
top: 50%;
left: 0;
margin-top: -1px;
height: 1px;
border-bottom: 1px solid #0080ff;
}
#box {
z-index: 2;
display: none;
position: fixed;
top: 60px;
right: 20px;
background: rgba(0,0,0,0.4);
width: 240px;
height: 300px;
padding: 20px;
border: 0px solid #ddd;
color: #fff
}
#carInfo{
z-index: 2;
position: fixed;
top: 20px;
left: 100px;
width: 240px;
border: 0px solid #ddd;
color: #fff
}
#box input{
/*color: #fff;*/
}
.box1 {
position: absolute;
top: 20px;
right: 20px;
z-index: 9;
}
#SceneView {
position: absolute;
width: 100%;
height: 100%;
}
.esri-component.esri-attribution.esri-widget {
display: none;
}
#videoBg{
width: 100%;
height: 100%;
background: rgba(0,0,0,0.4);
position: fixed;
z-index: 899;
display: none;
}
#video{
position: fixed;
width: 600px;
height: 400px;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
z-index: 9999;
display: none;
}
</style>
<script>
var map,isDrag,layers={},
gLyr,gLyrLbl,drawLine,drawCarLine,geometryService,totleDistance ,totalGraphic =null,
// 移动图层
moveLayer= null,
moveCarGra= null,
moving= null,
proPoint = null,
startingPoint= {},
startNum= 0,
speed = 0.0001,
dataArr=[],
dataCarArr=[],
polyline=null,
endNum= 0;
require([
"esri/map",
'esri/layers/ArcGISDynamicMapServiceLayer',
'esri/layers/FeatureLayer',
"esri/basemaps",
"esri/layers/ArcGISTiledMapServiceLayer",
'esri/geometry/Point',
"esri/geometry/Polygon",
'esri/geometry/Polyline',
'esri/layers/GraphicsLayer',
"esri/graphic",
"esri/SpatialReference",
"esri/dijit/editing/AttachmentEditor",
'esri/symbols/PictureMarkerSymbol',
"esri/Color",
"esri/symbols/Symbol",
"esri/symbols/CartographicLineSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/MarkerSymbol",
"esri/InfoTemplate",
"dojo/dom-construct",
"dojo/dom",
"dojo/_base/Color","esri/tasks/LengthsParameters", "dojo/number",
"esri/tasks/GeometryService","esri/geometry/Geometry","esri/symbols/TextSymbol","esri/symbols/Font",
"dojo/on",
"dojo/domReady!"
], function(
Map,
ArcGISDynamicMapServiceLayer,
FeatureLayer,
esriBasemaps,
Tiled,
Point,
Polygon,
Polyline,
GraphicsLayer,
Graphic,
Color,
SpatialReference,
AttachmentEditor,
Symbol,
CartographicLineSymbol,
SimpleFillSymbol,
SimpleLineSymbol,
PictureMarkerSymbol,
SimpleMarkerSymbol,
MarkerSymbol,
InfoTemplate,
domConstruct,
GeometryService,Geometry,LengthsParameters,number,TextSymbol,Font,
dom,
on
) {
window.Graphic = Graphic;
map = new Map("viewDiv", {
// basemap: "hybrid",//"hybrid",
center: [116.403414,39.924091],
maxZoom:12,//最大放大等级
minZoom:5,//最小放大等级
logo: false,
height: '100%',
});
// 地图服务
var featureLayer = new ArcGISDynamicMapServiceLayer("https://192.168.50.135:6443/arcgis/rest/services/SampleWorldCities/MapServer",{
mode: FeatureLayer.MODE_ONDEMAND
});
map.addLayer(featureLayer);
// var tiled = new Tiled("http://server.arcgisonline.com/arcgis/rest/services/ESRI_Imagery_World_2D/MapServer",{"id":"tiled"});
// map.addLayer(tiled);
// var mapCenter = new Point(116.403414,39.924091, {"wkid":4326});
// map.centerAndZoom(mapCenter,12);
geometryService = new esri.tasks.GeometryService("https://192.168.50.135:6443/arcgis/rest/services/Utilities/Geometry/GeometryServer");
gLyrLbl = new GraphicsLayer({"id":"gLyrLbl"});
map.addLayer(gLyrLbl);
carLine = new GraphicsLayer({"id":"carLine"});
map.addLayer(carLine);
gLyr = new GraphicsLayer({"id":"gLyr"});
map.addLayer(gLyr);
layers = new GraphicsLayer();
map.addLayer(layers);
// 点
var smsSvg = createSymbol("M510.8 98.2c-134.1 0-239.5 108.4-239.3 242.4 0 4 0.1 8.2 0.3 12.3 1.4 28.6 10.2 57.2 21.4 83.4v0.1l17.9 34.5c1.5 2.9 148.7 277.2 165.1 303.1 9.2 14.5 24.6 20.7 35.5 20.7 10.6 0 27.6-5.7 35.3-20.7 12.3-24 175.8-303.1 175.8-303.1s15.2-26.2 18.7-34.6c13.4-31.7 18.9-49.2 20.3-83.7 0.1-3.6 0.2-9.4 0.2-12.3C761.9 206 644.9 98.2 510.8 98.2z m2.4 368.9c-74.2 0-134.3-60.1-134.3-134.3 0-74.2 60.1-134.3 134.3-134.3 74.2 0 134.3 60.1 134.3 134.3 0 74.2-60.1 134.3-134.3 134.3z ",'#0000ff');
var smsSvg1 = createSymbol("M510.8 98.2c-134.1 0-239.5 108.4-239.3 242.4 0 4 0.1 8.2 0.3 12.3 1.4 28.6 10.2 57.2 21.4 83.4v0.1l17.9 34.5c1.5 2.9 148.7 277.2 165.1 303.1 9.2 14.5 24.6 20.7 35.5 20.7 10.6 0 27.6-5.7 35.3-20.7 12.3-24 175.8-303.1 175.8-303.1s15.2-26.2 18.7-34.6c13.4-31.7 18.9-49.2 20.3-83.7 0.1-3.6 0.2-9.4 0.2-12.3C761.9 206 644.9 98.2 510.8 98.2z m2.4 368.9c-74.2 0-134.3-60.1-134.3-134.3 0-74.2 60.1-134.3 134.3-134.3 74.2 0 134.3 60.1 134.3 134.3 0 74.2-60.1 134.3-134.3 134.3z ",'#fff');
var sms = new SimpleMarkerSymbol();
var symbol = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_SQUARE,
30,
new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([200,235, 254, 0.9]),
2
), new Color([200, 235, 254, 0.5]));
var sls = new SimpleLineSymbol("solid", new Color([0, 0, 255, 0.5]), 3);
var sms2 = new SimpleMarkerSymbol('diamond', 10, sls, new Color([72, 61, 139, 0.5]));
map.on("load", mapLoaded);
// 加载地图feature层
function mapLoaded() {
// dojo.connect(map, "onMouseDrag", showCoord);
// dojo.connect(map, "onMouseMove", showCoord);
dataArr = [];
// 点击事件
map.on("click", addGraphic);
}
function createSymbol(path, color) {
var markerSymbol = new esri.symbol.SimpleMarkerSymbol();
markerSymbol.setPath(path);
markerSymbol.setColor(new dojo.Color(color));
Mr.T'sBlog
- 粉丝: 1608
- 资源: 12
最新资源
- 基于Flink商品实时推荐系统详细文档+全部资料.zip
- 基于flink流数据处理平台详细文档+全部资料.zip
- 基于flink实时流计算任务详细文档+全部资料.zip
- 基于Flink实现实时冰蝎(Behinder)流量检测详细文档+全部资料.zip
- 基于Flink实现的商品实时推荐系统、flink统计商品热度,放入redis缓存,分析日志信息,将画像标签和实时记录放入Hbase,根据用户画像重排序热度榜,并
- 基于flink统计实时ip热点统计详细文档+全部资料.zip
- 基于flink用户画像的基本代码详细文档+全部资料.zip
- 基于Flink用户埋点行为日志分析平台,项用户行为日志收集、存储、分析平台,支持用户自定义查询条件详细文档+全部资料.zip
- 基于flink最新的[FLIP-27]架构对MQTT connector的实现详细文档+全部资料.zip
- 基于Flink与Storm的流式计算详细文档+全部资料.zip
- 远卓—深圳庄维房产—庄维年度培训计划申请表1206.doc
- 远卓—深圳庄维房产—庄维培训实施申请表1206.doc
- 远卓—深圳庄维房产—庄维培训计划制定流程V0.95why1206.doc
- 远卓—深圳庄维房产—庄维年度培训计划申请表V0.95why1206.doc
- 远卓—深圳庄维房产—庄维培训计划制定流程1206.doc
- 远卓—深圳庄维房产—庄维员工培训制度1206.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
前往页