arcgis api for flex 加载WMS带时间戳的气象服务

3 篇文章 0 订阅
1 篇文章 0 订阅


package dmPlug
{
 import com.esri.ags.Map;
 import com.esri.ags.SpatialReference;
 import com.esri.ags.geometry.Extent;
 import com.esri.ags.layers.ArcGISDynamicMapServiceLayer;
 import com.esri.ags.layers.DynamicMapServiceLayer;
 
 import flash.display.Loader;
 import flash.net.URLRequest;
 import flash.net.URLVariables;
 
 import mx.controls.Alert;
 
 public class WMSMapServiceLayer extends DynamicMapServiceLayer
 {
  internal const service:String="WMS";
  internal const request:String="GetMap"
  internal const scalar:Number=1;
  public var url:String;
  public var format:String="image/png";
  public var serviceName:String;
  public var urlWms:String;
  public var wmstVersion:String;
  public var styles:String;
  public var srs:String="EPSG:4326";
  public var transparentBG:String;
  private var _timeStamp:String;
  private var _layers:String;
  public function WMSMapServiceLayer()
  {
   super();
   this.setLoaded(true);
   this.url=url;
  }
  public function set timeStamp(value:String):void
  {
   _timeStamp=value;
  }
  public function set layers(value:String):void
  {
    _layers=value;
  }
  override protected function loadMapImage(loader:Loader) : void
  {
   var mapExtent:Extent = map.extent;

   if (map.spatialReference)
   
   {
    mapExtent.spatialReference = map.spatialReference;
   }
   
   var spatialReference:SpatialReference = mapExtent.spatialReference;
   var pxHeight:Number =map.height;
   var pxWidth:Number =map.width;
   var _url:String=this.url;
   _url +"SERVICE="+service;
   _url += "&VERSION=1.1.1";
   _url += "&REQUEST="+request;
   _url += "&STYLES=";
   _url += "&layers="+_layers; 
   _url +="&timeStamp="+_timeStamp;
   _url += "&SRS="+srs;
   _url += "&FORMAT=image/png";
   _url += "&WIDTH="+pxWidth;
   _url += "&HEIGHT="+pxHeight;
   _url += "&BBOX="+this.map.extent.xmin+","+this.map.extent.ymin+","+this.map.extent.xmax+","+this.map.extent.ymax; 
   _url += "&transparent=true"
   _url += "&token=";
   _url += "&st=12434"
   var wmsReq:URLRequest = new URLRequest(_url);
   loader.load(wmsReq);
   return;
   
   
   
   
   
   
  }
  
  
  
  
  
 
  

  
 }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值