click

map.on('click', function (evt) {
var pixel5 = map.getEventPixel(evt.originalEvent);
is_pixel=pixel5;
var f= map.forEachFeatureAtPixel(pixel5,function(feature){
if(feature.get('type')){
return feature
}
});
if(f){
var c=f.get('color');
c.getStroke().setColor("rgba(7,104,266,1)")//蓝色,移入地块
c.getStroke().setWidth(2)
f.setStyle(c)

for(var i=0;i<is_GetWatershedInfo.length;i++){
if(is_GetWatershedInfo[i].WatershedName==f.get('RiverName')){

static_GetWatershedInfo_index=i;


click_GetWatershedInfo(static_GetWatershedInfo_index)

var $currentEl = $(".table_item_av")[0];
$(".data_listplan").animate({ scrollTop: $currentEl.offsetTop-150 }, 500 ) ;

}
}
if(static_moudle_index==3){
for(var i=0;i<static_GetTownRainInfo.length;i++){
if(static_GetTownRainInfo[i].Town==f.get('RiverName')){

static_GetWatershedInfo_index=i;


click_GetTownRainInfo(static_GetWatershedInfo_index)

var $currentEl = $(".table_item_av")[0];
$(".data_listplan").animate({ scrollTop: $currentEl.offsetTop-150 }, 500 ) ;

}
}
}
}else {
$("#tsplan").css({

'display':'none'
})
}
isselect_feature=f;

})
posted @ 2022-07-15 10:37  小林222  阅读(657)  评论(0)    收藏  举报