-
jutil.ajax({
-
url: config.PLATFORM_URL +
'/ssa_topntable',
-
type:
'get',
-
data: {
-
offline_attr:
'_ass_loophole_ip_position',
-
index:
'ipweb_result',
-
type:
'ip_geo_info',
-
aggField:
'ip_position',
-
showField:
'ip_position',
-
page:
1,
-
size:
100
-
},
-
success:
function (data) {
-
-
var map = MAP.buildMap(
'wordMap',
true)
-
-
map.setMapStyle({
style:
'dark'})
-
-
if (data.code ===
0 && data.data.total >
0) {
-
addMarker(
'#wordMap',
false)
-
-
var _data = data.data.rows
-
var point, mark
-
-
var dictTmp = {}
-
for (
var i =
0; i < _data.length; i++) {
-
-
var itemDict = _data[i]._source
-
-
if (itemDict.ip_GeoPosition.D_L) {
-
-
var tmpKey = itemDict.ip_GeoPosition.D_L
-
-
if (tmpKey
in dictTmp) {
-
dictTmp[tmpKey].doc_count += itemDict.doc_count
-
}
-
else {
-
dictTmp[tmpKey] = {}
-
dictTmp[tmpKey].D = itemDict.ip_GeoPosition.D_L.split(
',')[
0]
-
dictTmp[tmpKey].L = itemDict.ip_GeoPosition.D_L.split(
',')[
1]
-
dictTmp[tmpKey].object = itemDict
-
dictTmp[tmpKey].doc_count = itemDict.doc_count
-
}
-
}
-
}
-
-
for (
var tmp2Key
in dictTmp) {
-
-
var earchItemDict = dictTmp[tmp2Key]
-
// if(earchItemDict.D != undefined && earchItemDict.D == "暂无经纬度"){
-
// jutil.ajax({
-
// url: config.PLATFORM_URL + '/getdl',
-
// type: 'get',
-
// data: {},
-
// success: function (data) {
-
//
-
// }
-
// })
-
// }
-
point = MAP.point(earchItemDict.D, earchItemDict.L)
//设置地图点的位置
-
mark = MAP.marker(point)
//给每一个点创建标记
-
map.addOverlay(mark)
将标注添加到地图中
-
-
// console.log(earchItemDict.object.ip_GeoPosition);
-
-
// console.log(itemDict.ip_GeoPosition.D_L[0], itemDict.ip_GeoPosition.D_L[1]);
-
-
mark.setLabel(
-
MAP.label(earchItemDict.doc_count, {
-
offset: MAP.size(
20,
-10)
-
})
-
)
-
registerEvent(mark, earchItemDict, map)
-
}
-
-
map.centerAndZoom(point,
5)
//当然也可以根据城市名称设置地图的中心点:
-
-
// openInfoDefault(firstShow["data"], firstShow["map"]);
-
-
}
else {
-
map.centerAndZoom(MAP.point(
113.1268217112,
27.8307991014),
5)
-
}
-
}
-
})
-
-
-
function registerEvent (el, obj, m) {
-
MAP.event(
'click', el,
function (data) {
-
openInfo(obj, data, m)
-
})
-
}
-
-
function openInfo (obj, g, m) {
-
-
var _getPosition = g.target.getPosition()
-
-
var opts = {
-
// width: 200,
-
// height: 100,
-
// title: obj.legalityInfo.websponsor,
-
enableMessage:
true
-
}
-
-
var txt =
''
-
-
if (obj.doc_count) {
-
txt +=
'IP个数: ' + obj.doc_count +
'<br/>'
-
}
else {
-
txt +=
'IP个数: ' +
0 +
'<br/>'
-
}
-
-
if (obj.object.ip_GeoPosition.P) {
-
txt +=
'地址:' + obj.object.ip_GeoPosition.P +
'<br/>'
-
}
-
-
txt +=
'经纬度:' + _getPosition.lng +
' , ' + _getPosition.lat +
'<br/>'
-
-
var sendData = obj.object
-
-
// var _object = {
-
// //strIP : sendData.strIP,
-
// //type: sendData.type,
-
// //uuid: sendData.uuid,
-
// ip_position: sendData.ip_position
-
// };
-
-
var _object = {
-
//strIP : sendData.strIP,
-
//type: sendData.type,
-
//uuid: sendData.uuid,
-
'ip_GeoPosition.D_L': sendData.ip_GeoPosition.D_L
-
}
-
-
_object = Until.toUrlString(_object)
-
-
console.log(_object)
-
-
txt +=
'<a class="tableLink" href="/scan_result/scan_ip_list' + _object +
'">查看详情</a>' +
'<br/>'
-
-
var NEW_window = MAP.infoWindow(txt, opts)
-
-
m.openInfoWindow(NEW_window, MAP.point(_getPosition.lng, _getPosition.lat))
-
}
-
-
})