Demonstration 1: Simplest Map Widget
Demonstration 2: Fully Configured Map Widget
Demonstration 3: Map Widget with Multiple WMS Layers
Tutorial
Features to be Added
The above ORNL DAAC WMS Viewer widget displays an dynamic map for Land Cover Type 1 (2001): IGBP global vegetation classification scheme. With the simplest configuration, users can double click to zoom in, pan the map, and use mouse wheel to zoom in/out the map interactively.
Javascript Code:
var widget1 = new SDAT.MapWidget(
'mapdiv1',
{ layers: ["10004_1"] },
{ bTitle: false },
{ bNavigator: false }
);
The ORNL DAAC WMS Viewer widget can be configured to include title, different background layers (including Google maps), navigation tools, layer opacity slider, layer switcher, scale bar, and time step selector (if a layer contains multiple time steps).
Javascript Code:
var widget2 = new SDAT.MapWidget(
'mapdiv2',
{
layers: ["228_1"]
},
{
height: 300,
width: 400,
bTitle: true,
bBorder: true,
baseLayers: ["ROADMAP","SATELLITE","HYBRID","TERRAIN","WORLD_COUNTRIES"]
},
{
bNavigator: true,
bMousePosition: true,
bLayerSwitcher: true,
bScaleBar: true,
bOpacitySlider: true,
bTimeStep: true
}
);
The above ORNL DAAC WMS Viewer widget displays two WMS layers (NLCD 2001 Land Cover and USDA NASS Cropland Data Layer of Year 2006) over Google Physical map. Users can use the Layer Switcher
to turn on/off layers.
Javascript Code:
var widget3 = new SDAT.MapWidget(
'mapdiv3',
{
layers: ["10009_1","10014_1"]
},
{
height: 350,
width: 700,
bTitle: true,
title: "NLCD (2001) and CDL (2006)",
bBorder: true,
baseLayers: ["TERRAIN"]
},
{
bNavigator: true,
bLayerSwitcher: true,
bScaleBar: true,
}
);
| Tel: +1 (865) 241-3952 E-mail:uso@daac.ornl.gov |
ORNL DAAC | User Services | WebGIS | NASA | ![]() |
||