pair("maxExtent", new Bounds(-20037508, -20037508, 20037508,
20037508)));
map.setOptions(options);
// OpenLayers.Layer.MultiMap is deprecated, use Bing instead.
Layer ve = new Bing(toMap(pair("key", apiKey),
pair("type", "Road"),
// custom metadata parameter to request the new map style - only
// useful
// before May 1st, 2011
pair("metadataParams", toMap(pair("mapVersion", "v1"))),
pair("sphericalMercator",
true)));
Layer merc = new WMS("World Map",
"http://maps.opengeo.org/geowebcache/service/wms", toMap(pair(
"layers", "bluemarble")), toMap(pair("opacity", 0.4),
pair("isBaseLayer", false), pair("wrapDateLine", true)));
// create a vector layer for drawing
Layer vector = new Vector("Editable Vectors");
map.addLayers(Arrays.asList(ve, merc, vector));
map.addControl(new LayerSwitcher());
map.addControl(new EditingToolbar(vector));
map.zoomToMaxExtent();