123456789101112131415161718192021222324252627282930313233343536373839404142 |
- function loadRealtimePOI(config, markerClick, initMethod) {
- console.log(config)
- var host = window.EASYMAP_CONFIG['poihost'];
- //var layerpoi = new L.tileLayer.wmts( 3414801
- var datatime = new Date().getTime();
- var endTimeSecond = Math.ceil(datatime / 100000)*100;
- var startTimeSecond = Math.ceil(datatime / 100000)*100 - (config.time != undefined ? config.time : 1800);
- //console.log(endTimeSecond);
- //console.log(startTimeSecond);
- let _config = Object.assign({
- size: 1000,
- //source: "attributes._targetID,pcolor,location,layerGroupName,lon,lat",
- layer: "zt_cbzt_zc_gj",
- realtimeLayer: 'zt_cbzt_zc_gj',
- gjLayer: 'zt_cbzt_zc_gj',
- //yjLayer: 'xs_cb_cbyj',
- style: "default",
- tilematrixSet: "default",
- format: "realtime_color",//"marker ",//json ,color , hot :热力图,aggs:聚合查询
- //自定义条件查询,需要对ES查询有所了解,字段前必须加上attributes.
- customsQuery: "{\"must\":[{\"range\":{\"attributes.collecTime\":{\"lte\":" + endTimeSecond + ",\"gt\":" + startTimeSecond + "}}}]}",
- //矩形选空间查询
- //bbox:"BBOX(109.6875,111.12671,20.17639,19.44031)",
- //BBOX:"BBOX(minx,maxx,maxy,miny)
- //多边形选空间查询
- //polygon:"[{lat: 20.05966, lng: 110.16678},{lat: 20.05486, lng: 110.42702},{lat: 19.88731, lng: 110.42976},{lat: 19.89899, lng: 110.10841}]",
- //LatLng(20.05966, 110.16678),LatLng(20.05486, 110.42702),LatLng(19.88731, 110.42976),LatLng(19.89899, 110.10841)
- //圈选空间查询
- //point:"19.52109999980007,109.59813000000008",
- //radius:"5000m",
- //关键字查询
- //keyworks:"海口"
- }, config)
- var layerpoi = new initMethod(
- host + '/poiwmts/color/getTile',
- host + '/poiwmts/json/getTile',
- _config,
- markerClick ,
- );
- return layerpoi
- }
|