Commit a09d2c4c authored by 张豪's avatar 张豪

完成示例中心demo修改

parent ff546d6b
......@@ -78,21 +78,11 @@
"name": "echarts_web_map",
"branch": "arcgis_latest"
},
{
"label": "Webmap test",
"name": "webmap_test",
"branch": "arcgis_latest"
},
{
"label": "热力图",
"name": "heatmap",
"branch": "arcgis_latest"
},
{
"label": "图层管理",
"name": "manage_layers",
"branch": "arcgis_latest"
},
{
"label": "迁徙图",
"name": "migrate",
......@@ -118,60 +108,10 @@
"name": "bus_line",
"branch": "arcgis_latest"
},
{
"label": "点聚合图",
"name": "flareClusterLayer",
"branch": "arcgis_latest"
},
{
"label": "运动图层",
"name": "movinglayer",
"branch": "arcgis_latest"
},
{
"label": "3.x运动图层",
"name": "3.xmovelayer",
"branch": "arcgis_latest"
},
{
"label": "多图层查询",
"name": "2d_findTaskLayers",
"branch": "arcgis_latest"
},
{
"label": "画框统计",
"name": "2d_queryStatistic",
"branch": "arcgis_latest"
},
{
"label": "视频播放",
"name": "2d_videoView",
"branch": "arcgis_latest"
},
{
"label": "缓冲区分析",
"name": "2d_buffer_analysis",
"branch": "arcgis_latest"
},
{
"label": "加载本地JSON文件/shapefile文件",
"name": "2d_loadGeometry",
"branch": "arcgis_latest"
},
{
"label": "要素编辑",
"name": "editFeatures",
"branch": "arcgis_latest"
},
{
"label": "要素编辑用3.x版本",
"name": "2d_featureEditor3.x",
"branch": "arcgis_latest"
},
{
"label": "要素编辑用3.x版本_贵州",
"name": "2d_featureEditor3.x_guizhou",
"branch": "arcgis_latest"
}
]
}
......
......@@ -17,7 +17,7 @@
</style>
<script src="https://apaas.wodcloud.com/api_3.x/init.js"></script>
<script src="https://apaas.wodcloud.com/mapsamples/static/js/jquery-3.3.1.min.js"></script>
<script src="https://apaas3.wodcloud.com/mapstatic/js/jquery-3.3.1.min.js"></script>
<script>
let map, featureLayer, moveLayer, lineLayer, featureCollection, featureCollection2, selectedGraphics, linesymbol,
selectedLineGraphic, timer, movecounts;
......@@ -206,7 +206,7 @@
"type": "simple",
"symbol": {
"type": "esriPMS",
"url": "https://apaas.wodcloud.com/mapsamples/static/images/ic_wxhuoche.png",
"url": "https://apaas3.wodcloud.com/mapstatic/images/ic_wxhuoche.png",
"contentType": "image/png",
"width": 15,
"height": 15
......@@ -281,7 +281,7 @@
// map.graphics.add(polylineGraphic);
$.get(
"https://apaas.wodcloud.com/mapsamples/static/data/mapLocation.json",
"https://apaas3.wodcloud.com/mapstatic/data/mapLocation.json",
function (data) {
var features = [];
array.forEach(data.features, function (feature) {
......@@ -320,8 +320,6 @@
function selectInMap(response) {
var features = [];
console.log(response.features);
//深拷贝
array.forEach(response.features, function (feature) {
var attr = {};
......@@ -332,10 +330,6 @@
graphic.setAttributes(attr);
features.push(graphic);
});
// var features = response.features;
console.log(features);
map.removeLayer(moveLayer);
map.removeLayer(lineLayer);
moveLayer = new FeatureLayer(featureCollection, {
......
......@@ -29,41 +29,173 @@
</style>
<script src="https://apaas.wodcloud.com/mapsamples/static/js/echarts.min.js"></script>
<script src="https://apaas3.wodcloud.com/mapstatic/js/echarts.min.js"></script>
<link rel="stylesheet" href="https://apaas.wodcloud.com/api_4.x/esri/css/main.css">
<script src="https://apaas.wodcloud.com/api_4.x/init.js"></script>
<script src="https://apaas.wodcloud.com/mapsamples/static/js/jquery-3.3.1.min.js"></script>
<script src="https://apaas3.wodcloud.com/mapstatic/js/jquery-3.3.1.min.js"></script>
<script>
var map, view, option;
require([
"esri/config",
"esri/Map",
"esri/Basemap",
"https://apaas.wodcloud.com/mapsamples/static/js/4EchartsLayer.js",
"https://apaas3.wodcloud.com/mapstatic/js/4EchartsLayer.js",
"esri/views/MapView",
"esri/layers/WebTileLayer",
"esri/layers/support/TileInfo",
"dojo/domReady!"
], function (
Map, Basemap, echartsLayer, MapView, WebTileLayer, TileInfo
ESRICONFIG, Map, Basemap, echartsLayer, MapView, WebTileLayer, TileInfo
) {
// 通过瓦片形式加载天地图的
// 天地图根据投影分为两种:墨卡托和经纬度
let tiledlayer = new WebTileLayer({
urlTemplate:
"http://{subDomain}.tianditu.gov.cn/vec_w/wmts?tk=fbaab7dca87a6ebf0bd1071ad5d837c0&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&FORMAT=tiles&TILEMATRIXSET=w&STYLE=default&LAYER=vec&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",
subDomains: ["t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"]
// 设定瓦片信息,天地图经纬度地图的切片信息全部使用该信息设定
var tileInfo = new TileInfo({
dpi: 90.71428571427429, //解析度,即像素
rows: 256,
cols: 256,
compressionQuality: 0, //压缩像素值
origin: {
x: -180,
y: 90
},
spatialReference: {
wkid: 4326
},
lods: [ //定义平铺方案的细节级别数组
{
level: 1,
levelValue: 1,
resolution: 0.703125,
scale: 295497593.05875003
}, {
level: 2,
levelValue: 2,
resolution: 0.3515625,
scale: 147748796.52937502
}, {
level: 3,
levelValue: 3,
resolution: 0.17578125,
scale: 73874398.264687508
}, {
level: 4,
levelValue: 4,
resolution: 0.087890625,
scale: 36937199.132343754
}, {
level: 5,
levelValue: 5,
resolution: 0.0439453125,
scale: 18468599.566171877
}, {
level: 6,
levelValue: 6,
resolution: 0.02197265625,
scale: 9234299.7830859385
}, {
level: 7,
levelValue: 7,
resolution: 0.010986328125,
scale: 4617149.8915429693
}, {
level: 8,
levelValue: 8,
resolution: 0.0054931640625,
scale: 2308574.9457714846
}, {
level: 9,
levelValue: 9,
resolution: 0.00274658203125,
scale: 1154287.4728857423
}, {
level: 10,
levelValue: 10,
resolution: 0.001373291015625,
scale: 577143.73644287116
}, {
level: 11,
levelValue: 11,
resolution: 0.0006866455078125,
scale: 288571.86822143558
}, {
level: 12,
levelValue: 12,
resolution: 0.00034332275390625,
scale: 144285.93411071779
}, {
level: 13,
levelValue: 13,
resolution: 0.000171661376953125,
scale: 72142.967055358895
}, {
level: 14,
levelValue: 14,
resolution: 8.58306884765625e-005,
scale: 36071.483527679447
}, {
level: 15,
levelValue: 15,
resolution: 4.291534423828125e-005,
scale: 18035.741763839724
}, {
level: 16,
levelValue: 16,
resolution: 2.1457672119140625e-005,
scale: 9017.8708819198619
}, {
level: 17,
levelValue: 17,
resolution: 1.0728836059570313e-005,
scale: 4508.9354409599309
}, {
level: 18,
levelValue: 18,
resolution: 5.3644180297851563e-006,
scale: 2254.4677204799655
}, {
level: 19,
levelValue: 19,
resolution: 2.68220901489257815e-006,
scale: 1127.23386023998275
}, {
level: 20,
levelValue: 2,
resolution: 1.341104507446289075e-006,
scale: 563.616930119991375
}
]
});
let annolayer = new WebTileLayer({
urlTemplate:
"http://{subDomain}.tianditu.gov.cn/cva_w/wmts?tk=fbaab7dca87a6ebf0bd1071ad5d837c0&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&FORMAT=tiles&TILEMATRIXSET=w&STYLE=default&LAYER=cva&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",
subDomains: ["t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"]
// 在加载经纬度地图的时候我们需要使用 {subDomain}, {col}, {row}, {level}分别替换服务器列表,瓦片列编号,瓦片行编号,当前缩放(显示)级别
var tiledLayer = new WebTileLayer(
"http://{subDomain}.tianditu.gov.cn/vec_c/wmts?tk=61ea8586e4f4c5c8bfa980df475f1bdf&service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=c&TileMatrix={level}&TileRow={row}&TileCol={col}&style=default&format=tiles", {
subDomains: ["t1", "t2", "t3", "t4", "t5", "t6", "t7"],
tileInfo: tileInfo,
spatialReference: {
wkid: 4326
}
});
var annomap = new WebTileLayer(
"http://{subDomain}.tianditu.gov.cn/cva_c/wmts?tk=61ea8586e4f4c5c8bfa980df475f1bdf&service=wmts&request=GetTile&version=1.0.0&LAYER=cva&tileMatrixSet=c&TileMatrix={level}&TileRow={row}&TileCol={col}&style=default&format=tiles", {
subDomains: ["t1", "t2", "t3", "t4", "t5", "t6", "t7"],
tileInfo: tileInfo,
spatialReference: {
wkid: 4326
}
});
// 请求天地图服务跨域的设置
ESRICONFIG.request.corsEnabledServers.push(
"t0.tianditu.gov.cn", "t1.tianditu.gov.cn", "t2.tianditu.gov.cn", "t3.tianditu.gov.cn",
"t4.tianditu.gov.cn", "t5.tianditu.gov.cn", "t6.tianditu.gov.cn", "t7.tianditu.gov.cn"
);
// 使用本地字体文件
ESRICONFIG.fontsUrl = "https://apaas.wodcloud.com/mapstatic/font";
// 天地图经纬度地图及注记作为底图
var tdtBasemap = new Basemap({
baseLayers: [tiledlayer, annolayer],
baseLayers: [tiledLayer, annomap],
title: "TDT Basemap",
id: "tdtBasemap",
id: "tdtBasemap"
});
// 创建地图
map = new Map({
......@@ -77,7 +209,7 @@
center: [116.3304, 39.8707]
});
$.get("https://apaas.wodcloud.com/mapsamples/static/data/lines-bus.json", function (data) {
$.get("https://apaas3.wodcloud.com/mapstatic/data/lines-bus.json", function (data) {
var hStep = 300 / (data.length - 1);
var busLines = [].concat.apply([], data.map(function (busLine, idx) {
var prevPt;
......@@ -112,8 +244,6 @@
silent: true,
lineStyle: {
normal: {
// color: '#c23531',
// color: 'rgb(200, 35, 45)',
opacity: 0.2,
width: 1
}
......
......@@ -31,8 +31,8 @@
height: 170px;
}
</style>
<script src="https://apaas.wodcloud.com/mapsamples/static/js/jquery-3.3.1.min.js"></script>
<script src="https://apaas.wodcloud.com/mapsamples/static/js/echarts.min.js"></script>
<script src="https://apaas3.wodcloud.com/mapstatic/js/jquery-3.3.1.min.js"></script>
<script src="https://apaas3.wodcloud.com/mapstatic/js/echarts.min.js"></script>
<script src="https://apaas.wodcloud.com/api_4.x/init.js"></script>
<script>
require([
......@@ -40,10 +40,10 @@
"esri/views/MapView",
"esri/WebMap"
], function (esriConfig, MapView, WebMap) {
esriConfig.portalUrl = "https://apaasgis.wodcloud.com/arcgis";
esriConfig.portalUrl = "https://apaasgis.wodcloud.com/portal";
var webmap = new WebMap({
portalItem: {
id: "54a708b3890a4d1aaff37988697aeaec"
id: "b4f4797eb32342c5b679082bfbbef553"
}
});
......
......@@ -77,7 +77,7 @@
"esri/views/MapView",
"esri/layers/WebTileLayer",
"esri/layers/support/TileInfo",
"esri/layers/FeatureLayer",,
"esri/layers/FeatureLayer",
"dojo/domReady!"
], function (ESRICONFIG, Map, Basemap, MapView, WebTileLayer, TileInfo, FeatureLayer) {
// 通过瓦片形式加载天地图的
......
This diff is collapsed.
......@@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<title>模拟人口迁徙</title>
<link rel="stylesheet" href="https://apaas.wodcloud.com/api_4.x/esri/css/main.css">
<style>
html,
body {
......@@ -26,11 +26,7 @@
height: 100%;
}
</style>
<script src="https://apaas.wodcloud.com/mapsamples/static/js/echarts.min.js"></script>
<link rel="stylesheet" href="https://apaas.wodcloud.com/api_4.x/esri/css/main.css">
<script src="https://apaas3.wodcloud.com/mapstatic/js/echarts.min.js"></script>
<script src="https://apaas.wodcloud.com/api_4.x/init.js"></script>
<script>
var __DEV__ = false;
......@@ -228,32 +224,193 @@
};
require([
"esri/config",
"esri/Map",
"esri/Basemap",
"https://apaas.wodcloud.com/mapsamples/static/js/4EchartsLayer.js",
"https://apaas3.wodcloud.com/mapstatic/js/4EchartsLayer.js",
"esri/views/MapView",
"esri/layers/WebTileLayer",
"esri/layers/support/TileInfo",
"dojo/domReady!"
], function (
Map, Basemap, echartsLayer, MapView, WebTileLayer, TileInfo
ESRICONFIG, Map, Basemap, echartsLayer, MapView, WebTileLayer, TileInfo
) {
// 通过瓦片形式加载天地图的
// 天地图根据投影分为两种:墨卡托和经纬度
// 设定瓦片信息,天地图经纬度地图的切片信息全部使用该信息设定
let tiledlayer = new WebTileLayer({
urlTemplate:
"http://{subDomain}.tianditu.gov.cn/vec_w/wmts?tk=fbaab7dca87a6ebf0bd1071ad5d837c0&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&FORMAT=tiles&TILEMATRIXSET=w&STYLE=default&LAYER=vec&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",
subDomains: ["t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"]
});
let annolayer = new WebTileLayer({
urlTemplate:
"http://{subDomain}.tianditu.gov.cn/cva_w/wmts?tk=fbaab7dca87a6ebf0bd1071ad5d837c0&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&FORMAT=tiles&TILEMATRIXSET=w&STYLE=default&LAYER=cva&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",
subDomains: ["t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"]
var tileInfo = new TileInfo({
dpi: 90.71428571427429, //解析度,即像素
rows: 256,
cols: 256,
compressionQuality: 0, //压缩像素值
origin: {
x: -180,
y: 90,
},
spatialReference: {
wkid: 4326,
},
lods: [
//定义平铺方案的细节级别数组
{
level: 1,
levelValue: 1,
resolution: 0.703125,
scale: 295497593.05875003,
},
{
level: 2,
levelValue: 2,
resolution: 0.3515625,
scale: 147748796.52937502,
},
{
level: 3,
levelValue: 3,
resolution: 0.17578125,
scale: 73874398.264687508,
},
{
level: 4,
levelValue: 4,
resolution: 0.087890625,
scale: 36937199.132343754,
},
{
level: 5,
levelValue: 5,
resolution: 0.0439453125,
scale: 18468599.566171877,
},
{
level: 6,
levelValue: 6,
resolution: 0.02197265625,
scale: 9234299.7830859385,
},
{
level: 7,
levelValue: 7,
resolution: 0.010986328125,
scale: 4617149.8915429693,
},
{
level: 8,
levelValue: 8,
resolution: 0.0054931640625,
scale: 2308574.9457714846,
},
{
level: 9,
levelValue: 9,
resolution: 0.00274658203125,
scale: 1154287.4728857423,
},
{
level: 10,
levelValue: 10,
resolution: 0.001373291015625,
scale: 577143.73644287116,
},
{
level: 11,
levelValue: 11,
resolution: 0.0006866455078125,
scale: 288571.86822143558,
},
{
level: 12,
levelValue: 12,
resolution: 0.00034332275390625,
scale: 144285.93411071779,
},
{
level: 13,
levelValue: 13,
resolution: 0.000171661376953125,
scale: 72142.967055358895,
},
{
level: 14,
levelValue: 14,
resolution: 8.58306884765625e-5,
scale: 36071.483527679447,
},
{
level: 15,
levelValue: 15,
resolution: 4.291534423828125e-5,
scale: 18035.741763839724,
},
{
level: 16,
levelValue: 16,
resolution: 2.1457672119140625e-5,
scale: 9017.8708819198619,
},
{
level: 17,
levelValue: 17,
resolution: 1.0728836059570313e-5,
scale: 4508.9354409599309,
},
{
level: 18,
levelValue: 18,
resolution: 5.3644180297851563e-6,
scale: 2254.4677204799655,
},
{
level: 19,
levelValue: 19,
resolution: 2.68220901489257815e-6,
scale: 1127.23386023998275,
},
{
level: 20,
levelValue: 2,
resolution: 1.341104507446289075e-6,
scale: 563.616930119991375,
},
],
});
// 在加载经纬度地图的时候我们需要使用 {subDomain}, {col}, {row}, {level}分别替换服务器列表,瓦片列编号,瓦片行编号,当前缩放(显示)级别
var tiledLayer = new WebTileLayer(
"http://{subDomain}.tianditu.gov.cn/vec_c/wmts?tk=61ea8586e4f4c5c8bfa980df475f1bdf&service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=c&TileMatrix={level}&TileRow={row}&TileCol={col}&style=default&format=tiles",
{
subDomains: ["t1", "t2", "t3", "t4", "t5", "t6", "t7"],
tileInfo: tileInfo,
spatialReference: {
wkid: 4326,
},
}
);
var annomap = new WebTileLayer(
"http://{subDomain}.tianditu.gov.cn/cva_c/wmts?tk=61ea8586e4f4c5c8bfa980df475f1bdf&service=wmts&request=GetTile&version=1.0.0&LAYER=cva&tileMatrixSet=c&TileMatrix={level}&TileRow={row}&TileCol={col}&style=default&format=tiles",
{
subDomains: ["t1", "t2", "t3", "t4", "t5", "t6", "t7"],
tileInfo: tileInfo,
spatialReference: {
wkid: 4326,
},
}
);
// 请求天地图服务跨域的设置
ESRICONFIG.request.corsEnabledServers.push(
"t0.tianditu.gov.cn",
"t1.tianditu.gov.cn",
"t2.tianditu.gov.cn",
"t3.tianditu.gov.cn",
"t4.tianditu.gov.cn",
"t5.tianditu.gov.cn",
"t6.tianditu.gov.cn",
"t7.tianditu.gov.cn"
);
// 使用本地字体文件
ESRICONFIG.fontsUrl = "https://apaas.wodcloud.com/mapstatic/font";
// 天地图经纬度地图及注记作为底图
var tdtBasemap = new Basemap({
baseLayers: [tiledlayer, annolayer],
baseLayers: [tiledLayer, annomap],
title: "TDT Basemap",
id: "tdtBasemap",
});
......@@ -577,7 +734,6 @@
},
series: series
};
console.log(series);
option.series.push({
name: ' Top10',
type: 'effectScatter',
......@@ -588,13 +744,6 @@
brushType: 'fill',
scale: 4
},
// label: {
// normal: {
// show: true,
// position: 'right',
// formatter: '{b}'
// }
// },
symbolSize: 10,
itemStyle: {
normal: {
......@@ -604,16 +753,6 @@
data: []
})
var chart = new echartsLayer(view, echarts, option);
// view.on('click', event => {
// let pt = view.toMap(event)
// // console.log(pt);
// // option.series[]
// option.series[option.series.length - 1].data = [{ value: [pt.longitude, pt.latitude] }]
// console.log(option.series);
// chart.setChartOption(option)
// console.log(chart);
// })
view.on('pointer-move', event => {
let pt = view.toMap(event)
option.series[option.series.length - 1].data = [{ value: [pt.longitude, pt.latitude] }]
......
......@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>模拟人口迁徙</title>
<link rel="stylesheet" href="https://apaas.wodcloud.com/api_4.x/esri/css/main.css">
<style>
html,
body {
......@@ -24,13 +24,8 @@
width: 50%;
height: 100%;
}
</style>
<script src="https://apaas.wodcloud.com/mapsamples/static/js/echarts.min.js"></script>
<link rel="stylesheet" href="https://apaas.wodcloud.com/api_4.x/esri/css/main.css">
<script src="https://apaas3.wodcloud.com/mapstatic/js/echarts.min.js"></script>
<script src="https://apaas.wodcloud.com/api_4.x/init.js"></script>
<script>
var __DEV__ = false;
......@@ -228,31 +223,193 @@
};
var map,view,scatterData,lineData;
require([
"esri/config",
"esri/Map",
"esri/Basemap",
"https://apaas.wodcloud.com/mapsamples/static/js/4EchartsLayer.js",
"https://apaas3.wodcloud.com/mapstatic/js/4EchartsLayer.js",
"esri/views/MapView",
"esri/layers/WebTileLayer",
"esri/layers/support/TileInfo",
"dojo/domReady!"
], function (
Map, Basemap, echartsLayer, MapView, WebTileLayer, TileInfo
ESRICONFIG, Map, Basemap, echartsLayer, MapView, WebTileLayer, TileInfo
) {
// 通过瓦片形式加载天地图的
// 天地图根据投影分为两种:墨卡托和经纬度
let tiledlayer = new WebTileLayer({
urlTemplate:
"http://{subDomain}.tianditu.gov.cn/vec_w/wmts?tk=fbaab7dca87a6ebf0bd1071ad5d837c0&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&FORMAT=tiles&TILEMATRIXSET=w&STYLE=default&LAYER=vec&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",
subDomains: ["t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"]
});
let annolayer = new WebTileLayer({
urlTemplate:
"http://{subDomain}.tianditu.gov.cn/cva_w/wmts?tk=fbaab7dca87a6ebf0bd1071ad5d837c0&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&FORMAT=tiles&TILEMATRIXSET=w&STYLE=default&LAYER=cva&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",
subDomains: ["t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"]
// 设定瓦片信息,天地图经纬度地图的切片信息全部使用该信息设定
var tileInfo = new TileInfo({
dpi: 90.71428571427429, //解析度,即像素
rows: 256,
cols: 256,
compressionQuality: 0, //压缩像素值
origin: {
x: -180,
y: 90,
},
spatialReference: {
wkid: 4326,
},
lods: [
//定义平铺方案的细节级别数组
{
level: 1,
levelValue: 1,
resolution: 0.703125,
scale: 295497593.05875003,
},
{
level: 2,
levelValue: 2,
resolution: 0.3515625,
scale: 147748796.52937502,
},
{
level: 3,
levelValue: 3,
resolution: 0.17578125,
scale: 73874398.264687508,
},
{
level: 4,
levelValue: 4,
resolution: 0.087890625,
scale: 36937199.132343754,
},
{
level: 5,
levelValue: 5,
resolution: 0.0439453125,
scale: 18468599.566171877,
},
{
level: 6,
levelValue: 6,
resolution: 0.02197265625,
scale: 9234299.7830859385,
},
{
level: 7,
levelValue: 7,
resolution: 0.010986328125,
scale: 4617149.8915429693,
},
{
level: 8,
levelValue: 8,
resolution: 0.0054931640625,
scale: 2308574.9457714846,
},
{
level: 9,
levelValue: 9,
resolution: 0.00274658203125,
scale: 1154287.4728857423,
},
{
level: 10,
levelValue: 10,
resolution: 0.001373291015625,
scale: 577143.73644287116,
},
{
level: 11,
levelValue: 11,
resolution: 0.0006866455078125,
scale: 288571.86822143558,
},
{
level: 12,
levelValue: 12,
resolution: 0.00034332275390625,
scale: 144285.93411071779,
},
{
level: 13,
levelValue: 13,
resolution: 0.000171661376953125,
scale: 72142.967055358895,
},
{
level: 14,
levelValue: 14,
resolution: 8.58306884765625e-5,
scale: 36071.483527679447,
},
{
level: 15,
levelValue: 15,
resolution: 4.291534423828125e-5,
scale: 18035.741763839724,
},
{
level: 16,
levelValue: 16,
resolution: 2.1457672119140625e-5,
scale: 9017.8708819198619,
},
{
level: 17,
levelValue: 17,
resolution: 1.0728836059570313e-5,
scale: 4508.9354409599309,
},
{
level: 18,
levelValue: 18,
resolution: 5.3644180297851563e-6,
scale: 2254.4677204799655,
},
{
level: 19,
levelValue: 19,
resolution: 2.68220901489257815e-6,
scale: 1127.23386023998275,
},
{
level: 20,
levelValue: 2,
resolution: 1.341104507446289075e-6,
scale: 563.616930119991375,
},
],
});
// 在加载经纬度地图的时候我们需要使用 {subDomain}, {col}, {row}, {level}分别替换服务器列表,瓦片列编号,瓦片行编号,当前缩放(显示)级别
var tiledLayer = new WebTileLayer(
"http://{subDomain}.tianditu.gov.cn/vec_c/wmts?tk=61ea8586e4f4c5c8bfa980df475f1bdf&service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=c&TileMatrix={level}&TileRow={row}&TileCol={col}&style=default&format=tiles",
{
subDomains: ["t1", "t2", "t3", "t4", "t5", "t6", "t7"],
tileInfo: tileInfo,
spatialReference: {
wkid: 4326,
},
}
);
var annomap = new WebTileLayer(
"http://{subDomain}.tianditu.gov.cn/cva_c/wmts?tk=61ea8586e4f4c5c8bfa980df475f1bdf&service=wmts&request=GetTile&version=1.0.0&LAYER=cva&tileMatrixSet=c&TileMatrix={level}&TileRow={row}&TileCol={col}&style=default&format=tiles",
{
subDomains: ["t1", "t2", "t3", "t4", "t5", "t6", "t7"],
tileInfo: tileInfo,
spatialReference: {
wkid: 4326,
},
}
);
// 请求天地图服务跨域的设置
ESRICONFIG.request.corsEnabledServers.push(
"t0.tianditu.gov.cn",
"t1.tianditu.gov.cn",
"t2.tianditu.gov.cn",
"t3.tianditu.gov.cn",
"t4.tianditu.gov.cn",
"t5.tianditu.gov.cn",
"t6.tianditu.gov.cn",
"t7.tianditu.gov.cn"
);
// 使用本地字体文件
ESRICONFIG.fontsUrl = "https://apaas.wodcloud.com/mapstatic/font";
// 天地图经纬度地图及注记作为底图
var tdtBasemap = new Basemap({
baseLayers: [tiledlayer, annolayer],
baseLayers: [tiledLayer, annomap],
title: "TDT Basemap",
id: "tdtBasemap",
});
......
......@@ -18,7 +18,7 @@
</style>
<script src="https://apaas.wodcloud.com/api_4.x/init.js"></script>
<script src="https://apaas.wodcloud.com/mapsamples/static/js/jquery-3.3.1.min.js"></script>
<script src="https://apaas3.wodcloud.com/mapstatic/js/jquery-3.3.1.min.js"></script>
<script>
let map,
......@@ -36,6 +36,7 @@
polylineSymbol,
graphics;
require([
"esri/config",
"esri/Map",
"esri/Basemap",
"esri/TimeExtent",
......@@ -55,7 +56,9 @@
"esri/symbols/PictureMarkerSymbol",
"esri/core/watchUtils",
"dojo/domReady!"
], function (Map,
], function (
ESRICONFIG,
Map,
Basemap,
TimeExtent,
TimeInfo,
......@@ -83,10 +86,10 @@
compressionQuality: 0, //压缩像素值
origin: {
x: -180,
y: 90
y: 90,
},
spatialReference: {
wkid: 4326
wkid: 4326,
},
lods: [
//定义平铺方案的细节级别数组
......@@ -94,150 +97,163 @@
level: 1,
levelValue: 1,
resolution: 0.703125,
scale: 295497593.05875003
scale: 295497593.05875003,
},
{
level: 2,
levelValue: 2,
resolution: 0.3515625,
scale: 147748796.52937502
scale: 147748796.52937502,
},
{
level: 3,
levelValue: 3,
resolution: 0.17578125,
scale: 73874398.264687508
scale: 73874398.264687508,
},
{
level: 4,
levelValue: 4,
resolution: 0.087890625,
scale: 36937199.132343754
scale: 36937199.132343754,
},
{
level: 5,
levelValue: 5,
resolution: 0.0439453125,
scale: 18468599.566171877
scale: 18468599.566171877,
},
{
level: 6,
levelValue: 6,
resolution: 0.02197265625,
scale: 9234299.7830859385
scale: 9234299.7830859385,
},
{
level: 7,
levelValue: 7,
resolution: 0.010986328125,
scale: 4617149.8915429693
scale: 4617149.8915429693,
},
{
level: 8,
levelValue: 8,
resolution: 0.0054931640625,
scale: 2308574.9457714846
scale: 2308574.9457714846,
},
{
level: 9,
levelValue: 9,
resolution: 0.00274658203125,
scale: 1154287.4728857423
scale: 1154287.4728857423,
},
{
level: 10,
levelValue: 10,
resolution: 0.001373291015625,
scale: 577143.73644287116
scale: 577143.73644287116,
},
{
level: 11,
levelValue: 11,
resolution: 0.0006866455078125,
scale: 288571.86822143558
scale: 288571.86822143558,
},
{
level: 12,
levelValue: 12,
resolution: 0.00034332275390625,
scale: 144285.93411071779
scale: 144285.93411071779,
},
{
level: 13,
levelValue: 13,
resolution: 0.000171661376953125,
scale: 72142.967055358895
scale: 72142.967055358895,
},
{
level: 14,
levelValue: 14,
resolution: 8.58306884765625e-5,
scale: 36071.483527679447
scale: 36071.483527679447,
},
{
level: 15,
levelValue: 15,
resolution: 4.291534423828125e-5,
scale: 18035.741763839724
scale: 18035.741763839724,
},
{
level: 16,
levelValue: 16,
resolution: 2.1457672119140625e-5,
scale: 9017.8708819198619
scale: 9017.8708819198619,
},
{
level: 17,
levelValue: 17,
resolution: 1.0728836059570313e-5,
scale: 4508.9354409599309
scale: 4508.9354409599309,
},
{
level: 18,
levelValue: 18,
resolution: 5.3644180297851563e-6,
scale: 2254.4677204799655
scale: 2254.4677204799655,
},
{
level: 19,
levelValue: 19,
resolution: 2.68220901489257815e-6,
scale: 1127.23386023998275
scale: 1127.23386023998275,
},
{
level: 20,
levelValue: 2,
resolution: 1.341104507446289075e-6,
scale: 563.616930119991375
}
]
scale: 563.616930119991375,
},
],
});
// 在加载经纬度地图的时候我们需要使用 {subDomain}, {col}, {row}, {level}分别替换服务器列表,瓦片列编号,瓦片行编号,当前缩放(显示)级别
var tiledLayer = new WebTileLayer(
"http://{subDomain}.tianditu.gov.cn/vec_c/wmts?tk=61ea8586e4f4c5c8bfa980df475f1bdf&service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=c&TileMatrix={level}&TileRow={row}&TileCol={col}&style=default&format=tiles", {
"http://{subDomain}.tianditu.gov.cn/vec_c/wmts?tk=61ea8586e4f4c5c8bfa980df475f1bdf&service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=c&TileMatrix={level}&TileRow={row}&TileCol={col}&style=default&format=tiles",
{
subDomains: ["t1", "t2", "t3", "t4", "t5", "t6", "t7"],
tileInfo: tileInfo,
spatialReference: {
wkid: 4326
}
wkid: 4326,
},
}
);
var annomap = new WebTileLayer(
"http://{subDomain}.tianditu.gov.cn/cva_c/wmts?tk=61ea8586e4f4c5c8bfa980df475f1bdf&service=wmts&request=GetTile&version=1.0.0&LAYER=cva&tileMatrixSet=c&TileMatrix={level}&TileRow={row}&TileCol={col}&style=default&format=tiles", {
"http://{subDomain}.tianditu.gov.cn/cva_c/wmts?tk=61ea8586e4f4c5c8bfa980df475f1bdf&service=wmts&request=GetTile&version=1.0.0&LAYER=cva&tileMatrixSet=c&TileMatrix={level}&TileRow={row}&TileCol={col}&style=default&format=tiles",
{
subDomains: ["t1", "t2", "t3", "t4", "t5", "t6", "t7"],
tileInfo: tileInfo,
spatialReference: {
wkid: 4326
}
wkid: 4326,
},
}
);
// 请求天地图服务跨域的设置
ESRICONFIG.request.corsEnabledServers.push(
"t0.tianditu.gov.cn",
"t1.tianditu.gov.cn",
"t2.tianditu.gov.cn",
"t3.tianditu.gov.cn",
"t4.tianditu.gov.cn",
"t5.tianditu.gov.cn",
"t6.tianditu.gov.cn",
"t7.tianditu.gov.cn"
);
// 使用本地字体文件
ESRICONFIG.fontsUrl = "https://apaas.wodcloud.com/mapstatic/font";
// 天地图经纬度地图及注记作为底图
var tdtBasemap = new Basemap({
baseLayers: [tiledLayer, annomap],
title: "TDT Basemap",
id: "tdtBasemap",
spatialReference: {
wkid: 4326
}
});
map = new Map({
basemap: tdtBasemap
......@@ -294,14 +310,6 @@
});
symbol = new PictureMarkerSymbol("https://apaas.wodcloud.com/minemapapi/image/jtqj3/ic_wxhuoche.png",
15, 15);
// var symbol = {
// type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
// color: [0, 0, 139],
// outline: {
// color: [255, 255, 255],
// width: 1.5
// }
// };
var attr = properties;
var popupTemplate = {
title: "两客一危车辆",
......
......@@ -50,7 +50,6 @@
view.popup.watch("selectedFeature", function(graphic) {
if (graphic && graphic.sourceLayer) {
var layerName = graphic.sourceLayer.title;
console(graphic.sourceLayer)
switch (layerName) {
case "贵州视频监控要素微服务":
var name = graphic.attributes.NAME;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment