一、设置图色斑图背景为透明
MapLayout mapLayout = new MapLayout();mapLayout.setPageBackColor(new Color(0,0,0,0));//设置图片背景为无色
二、气象色斑图大小设置
//最小边界经度double startlon = shapeLayer.getExtent().minX; //最大边界经度double endlon = shapeLayer.getExtent().maxX;//最小边界纬度double startlat = shapeLayer.getExtent().minY;//最大边界纬度double endlat = shapeLayer.getExtent().maxY;//倍数int noun = 5;//经度差值double xx=endlon-startlon;//纬度差值double yy=endlat-startlat;//获取经纬度差值乘以倍数,也可理解为步长,也可以理解为图片分辨率 int x = (int) (xx*100*noun); //经度(lon)最大最小值差值*100 int y = (int) (yy*100*noun);//纬度(lat)最大最小值差值*100//边界Rectangle _pageBounds = new Rectangle();_pageBounds.x = 0;_pageBounds.y = 0;//色斑图外部框架的大小,当前x,y是色斑图的大小_pageBounds.width = x;_pageBounds.height = y;mapLayout.setPageBounds(_pageBounds);/*******************设置图片大小******************/LayoutMap layoutMap = mapLayout.getActiveLayoutMap();layoutMap.setDrawGridLine(true);layoutMap.setDrawNeatLine(false);layoutMap.setDrawGridLabel(false);layoutMap.setDrawGridTickLine(false);//创建mapView对象MapFrame mapFrame = mapLayout.getActiveMapFrame(); //设置图片高宽int cx = 0;int cy = 0;//cw越大色斑图越往右靠,ch越大越往下int cw = x;int ch = y;mapFrame.setActive(true);mapFrame.setLayoutBounds(new Rectangle(cx, cy, cw, ch));