// create an overview map control with the default options
Control overview1 = new OverviewMap(toMap(pair("maximized", true)));
map1.addControl(overview1);
map1.setCenter(new LonLat(0, 0), 2);
// create the bottom map (with advanced overview map control)
Map mapOptions = toMap(
pair("maxExtent", new Bounds(-8242894.927728, 4965204.031195, -8227290.161511, 4994963.723637)),
pair("maxResolution", 116.2487986015621),
pair("projection", "EPSG:900913"),
pair("units", "m") );
map2.setOptions(mapOptions);
map2.addLayer(ny);
// create an overview map control with non-default options
Map controlOptions = toMap(
pair("maximized", true),
pair("mapOptions",
mergeMap(mapOptions,
pair("maxResolution", 156543.0339),
pair("maxExtent", new Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34)))
),
pair("layers", Arrays.asList(jplOverview)
));
Control overview2 = new OverviewMap(controlOptions);
map2.addControl(overview2);
map2.setCenter(new LonLat(-8233165.3575055, 4980298.21113769), 3);
}