Commit 6d106cc1 by hanjixin

Merge branch 'master' of gitlab.maxrocky.com:hanjixin/MeteorologicalBureau

parents a9a03d40 704b09d1
......@@ -159,9 +159,9 @@
map: map
});
}
AMapUI.loadUI(['geo/DistrictExplorer'], function (DistrictExplorer) {
initMask(DistrictExplorer);
});
// AMapUI.loadUI(['geo/DistrictExplorer'], function (DistrictExplorer) {
// initMask(DistrictExplorer);
// });
// 获取人员信息
$.getJSON('./personal.json').then(res => {
console.log(JSON.parse(res));
......
......@@ -19,10 +19,8 @@
<body>
<div id="container"></div>
<script src="https://cache.amap.com/lbs/static/es5.min.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script
src="https://webapi.amap.com/maps?v=1.4.15&key=ee7327615de4d673c4e455a772da45fd&plugin=Map3D,AMap.DistrictSearch,ElasticMarker"></script>
<script src="https://webapi.amap.com/maps?v=1.4.15&key=ee7327615de4d673c4e455a772da45fd&plugin=Map3D,AMap.DistrictSearch,ElasticMarker,AMap.MarkerClusterer"></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js"></script> -->
<script language="javascript">
......@@ -34,6 +32,7 @@
extensions: 'all',
level: 'district'
};
var Markers = []
var bounds;
var boundsPath = [];
var road = new AMap.TileLayer({
......@@ -124,10 +123,10 @@
// layers: [RoadNet,Satellite ]//Satellite,
// layers: [road, ]//Satellite,
});
map.add(Satellite);
map.add(CanvasLayer);
map.add(SatelliteDown);
map.getLayers()[0].setzIndex(1000)
map.add(Satellite);//高亮mask 卫星图
map.add(CanvasLayer);// 半黑遮罩层
map.add(SatelliteDown);//底图 卫星图
map.getLayers()[0].setzIndex(1000);//个性地图置顶
findsubarea(result);
// map.getLayers()[0].setOpacity(0.5)
// var maskerIn = new AMap.Marker({
......@@ -159,20 +158,23 @@
map: map
});
}
AMapUI.loadUI(['geo/DistrictExplorer'], function (DistrictExplorer) {
initMask(DistrictExplorer);
});
// AMapUI.loadUI(['geo/DistrictExplorer'], function (DistrictExplorer) {
// initMask(DistrictExplorer);
// });
// 获取人员信息
$.getJSON('./personal.json').then(res => {
console.log(JSON.parse(res));
currentDetailList = JSON.parse(res).currentDetailList.slice(
0,
1000
);
currentDetailList.map(item => {
setPersonalPoint(item);
console.log(JSON.parse(res));
currentDetailList = JSON.parse(res).currentDetailList.slice(
0,
100
);
currentDetailList.map(item => {
console.log(123)
setPersonalPoint(item);
});
console.log(Markers)
cluster = new AMap.MarkerClusterer(map, Markers, {gridSize: 80})
});
});
});
};
init();
......@@ -267,33 +269,64 @@
}
}
function setPersonalPoint(item) {
console.log(map)
const marker = new AMap.ElasticMarker({
map: map,
// styles: [
// {
// icon: {
// img:
// 'https://upload.jianshu.io/users/upload_avatars/8613997/15e570d2-9dd0-4be4-b1c7-f0373ef1adc9.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/96/h/96/format/webp'
// console.log(map);
// const marker = new AMap.ElasticMarker({
// map: map,
// styles: [
// {
// icon: {
// img:
// 'https://upload.jianshu.io/users/upload_avatars/8613997/15e570d2-9dd0-4be4-b1c7-f0373ef1adc9.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/96/h/96/format/webp',
// size: [366, 201],
// ancher: [183, 101],
// imageSize: [865, 1156],
// imageOffset: [45, 480],
// fitZoom: 17.5,
// scaleFactor: 2,
// maxScale: 2,
// minScale: 0.125
// }
// }
// ],
// zooms: [0, 20],
// // position: new AMap.LngLat(Number(item.lon), Number(item.lat)),
// position: {Q: 30.8307, R: 104.24599999999998, lng: 104.246, lat: 30.8307},
// zIndex: 100000,
// zoomStyleMapping: {
// 14: 0,
// 15: 0,
// 16: 0,
// 17: 0,
// 18: 0,
// 19: 0,
// 20: 0
// }
// ],
zooms: [14, 20],
center: new AMap.LngLat(Number(item.lon), Number(item.lat)),
position: new AMap.LngLat(Number(item.lon), Number(item.lat)),
zIndex: 1000,
zoomStyleMapping: {
14: 0,
15: 0,
16: 0,
17: 0,
18: 0,
19: 0,
20: 0
}
});
map.add(marker);
}
// });
// console.log(new AMap.LngLat(Number(item.lon), Number(item.lat)))
// marker.setMap(map)
// var circleMarker = new AMap.CircleMarker({
// center: new AMap.LngLat(Number(item.lon), Number(item.lat)),
// radius:5+Math.random()*10,//3D视图下,CircleMarker半径不要超过64px
// strokeColor:'white',
// strokeWeight:2,
// strokeOpacity:0.5,
// fillColor:'rgba(0,0,255,1)',
// fillOpacity:0.5,
// zIndex:10,
// bubble:true,
// cursor:'pointer',
// clickable: true
// })
var marker = new AMap.Marker({
map:map,
position: new AMap.LngLat(Number(item.lon), Number(item.lat)), //基点位置
icon:"https://a.amap.com/jsapi_demos/static/images/darkRed.png", //marker图标,直接传递地址url
offset:{x:-8,y:-34} //相对于基点的位置
});
Markers.push(marker)
// circleMarker.setMap(map)
}
console.log(AMap.ElasticMarker);
</script>
</body>
......
......@@ -289,6 +289,7 @@
offset:{x:-8,y:-34} //相对于基点的位置
});
Markers.push(marker)
// circleMarker.setMap(map)
}
console.log(AMap.ElasticMarker);
......
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 sign in to comment