Toggle navigation
自定义栅格图-高德-京津冀
By
n***人
2019-01-03 07:35:00
脚本
16
21
作品使用的第三方脚本
//webapi.amap.com/maps?v=1.4.12&key=35a871e5905ecfd749bd998448b9cd03&plugin=AMap.DistrictSearch,//webapi.amap.com/ui/1.0/main.js?v=1.0.11,//webapi.amap.com/loca?v=1.2.0&key=35a871e5905ecfd749bd998448b9cd03
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
var map = new AMap.Map('chart-panel', { mapStyle: "amap://styles/3217e099bb7b1bb4a8e063ce169bbb5b", pitch: 52, zoom: 7, center: [116.472804, 39.995725], viewMode: '3D', //开启3D视图,默认为关闭 buildingAnimation: true, //楼块出现是否带动画 cursor: 'pointer', features: ['road', 'building', 'point'] }); map.on('complete', function() { map.plugin(['AMap.ControlBar'], function() { var controlBar = new AMap.ControlBar({ position: { right: '0', bottom: '-173px' } }); map.addControl(controlBar); }); map.plugin(['AMap.MapType'], function() { var mapType = new AMap.MapType({ liteStyle: true }); map.addControl(mapType); }); map.plugin(['AMap.Scale'], function() { var scale = new AMap.Scale(); map.addControl(scale); }); map.plugin(['AMap.ToolBar'], function() { var toolBar = new AMap.ToolBar(); map.addControl(toolBar); }); map.plugin(['AMap.DistrictLayer'], function() { var disCountry = new AMap.DistrictLayer.Country({ SOC: 'CHN', depth: 2, styles: { 'province-stroke': 'cornflowerblue', 'city-stroke': 'white', //中国地级市边界 'county-stroke': 'white', //'#3c648780', //中国区县边界 'fill': 'rgba(0,0,0,0)', } }); disCountry.setMap(map); }); var layer = new AMap.TileLayer({ zIndex: -1, getTileUrl: 'https://t{0,1,2,3,4,5,6,7}.tianditu.gov.cn/DataServer?tk=95f31e3625a164fbdc09ef6ba9b971ad&T=ter_w&x=[x]&y=[y]&l=[z]' }); layer.setMap(map); map.on('dblclick', function() { map.remove(layer); layer = new AMap.TileLayer({ zIndex: -1, getTileUrl: 'http://106.38.83.13/ArcGIS/rest/services/JJJSlope/MapServer/tile/[z]/[y]/[x]' }); layer.setMap(map); }); function drawvisualLayer() { $.getJSON("/asset/get/s/data-1544592880173-tRoZbKmvl.json", function(data) { var loca = Loca.create(map); var Player = Loca.visualLayer({ container: loca, type: 'point', shape: 'circle', }); Player.setData(data) Player.setOptions({ lnglat: function(res) { var data = res.value; var center = [data.longitude, data.latitude]; return center; }, style: { unit: 'meter', opacity: 0.521, radius: 2, fill: function(res) { var aqi = res.value.aqi; var color = 'gray'; if (aqi <= 50) { color = '#43ce17'; } else if (aqi <= 100) { color = '#efdc31'; } else if (aqi <= 150) { color = '#fa0'; } else if (aqi <= 200) { color = '#ff401a'; } else if (aqi <= 300) { color = '#d20040'; } else { color = '#9c0a4e'; } return color; } } }); Player.render(); }); } drawvisualLayer(); const area = ['河北省', '北京市', '天津市'] //area = area.concat($option.prop('value').split(',')); map.plugin(['AMap.DistrictSearch'], function() { const district = new AMap.DistrictSearch({ subdistrict: 0, //返回下一级行政区 extensions: 'all', //返回行政区边界坐标组等具体信息 }); let bounds = []; search(); function search(index) { if (!index) { index = 0; } let province = area[index] if (province) { district.search(province, function(status, result) { bounds = bounds.concat(result.districtList[0].boundaries); index++; search(index); }); } else { function run(bounds) { var prism = new AMap.Object3D.Wall({ path: bounds, height: 5000, color: '#0088ffcc' }); prism.transparent = true; var object3Dlayer = new AMap.Object3DLayer({ zIndex: 1 }); object3Dlayer.add(prism) object3Dlayer.setMap(map); var mask = bounds.map(function(item) { return [item] }); map.setMask(mask); } run(bounds); } } }); });