<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>WMS</title> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css"> <script src="http://js.arcgis.com/3.7/"></script> <script> dojo.require("esri.map"); var map; dojo.ready(function() { dojo.declare("my.NOWCoastWMSLayer", esri.layers.DynamicMapServiceLayer, { constructor: function() { this.initialExtent = this.fullExtent = new esri.geometry.Extent({"xmin":-16476154.32,"ymin":2504688.54,"xmax":-6457400.14,"ymax":7514065.62,"spatialReference":{"wkid":102100}}); this.spatialReference = new esri.SpatialReference({wkid:102100}); this.loaded = true; this.onLoad(this); }, getImageUrl: function(extent, width, height, callback) { var params = { request:"GetMap", transparent:true, format:"image/png", bgcolor:"ffffff", version:"1.1.1", layers:"OBS_MET_TEMP,RAS_RIDGE_NEXRAD", styles: "default,default", exceptions: "application/vnd.ogc.se_xml", //changing values bbox:extent.xmin + "," + extent.ymin + "," + extent.xmax + "," + extent.ymax, srs: "EPSG:" + extent.spatialReference.wkid, width: width, height: height }; callback("http://nowcoast.noaa.gov/wms/com.esri.wms.Esrimap/obs?" + dojo.objectToQuery(params)); } }); }); function init() { map = new esri.Map("map", { basemap: "satellite", center: [-103.008, 40.98], zoom: 4 }); map.addLayer(new my.NOWCoastWMSLayer()); } dojo.ready(init); </script> </head> <body class="claro"> <div id="map" style="position:relative; width:1024px; height:512px; border:2px solid #000;"></div> </body> </html>
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.