buttonLayout.setHeight(25);
buttonLayout.setMembersMargin(10);
IButton button1 = new IButton(I18nProvider.getSampleMessages().screenWorldBTNScreen());
button1.setWidth("50%");
final Image screenImage = new Image("imageInScreenSpace");
screenImage.setHref(Geomajas.getIsomorphicDir() + "geomajas/example/images/smile.png");
screenImage.setBounds(new Bbox(60, 60, 48, 48)); // Pixel coordinates
screenImage.setStyle(new PictureStyle(0.6));
button1.addClickHandler(new ClickHandler() {
// Draw an image in screen space:
public void onClick(ClickEvent event) {
map.render(screenImage, RenderGroup.SCREEN, RenderStatus.ALL);
}
});
buttonLayout.addMember(button1);
IButton button2 = new IButton(I18nProvider.getSampleMessages().screenWorldBTNWorld());
button2.setWidth("50%");
// An image
final Image worldImage = new Image("imageInWorldSpace");
worldImage.setHref(Geomajas.getIsomorphicDir() + "geomajas/example/images/smile.png");
worldImage.setBounds(new Bbox(-2000000, -2000000, 4000000, 4000000)); // Mercator coordinates
worldImage.setStyle(new PictureStyle(0.8));
// And some geometries
final GfxGeometry worldGeometry = new GfxGeometry("MultiPolygonInWorldSpace");
final GeometryFactory gf = new GeometryFactory(map.getMapModel().getSrid(), map.getMapModel().getPrecision());
Polygon p1 = gf.createPolygon(gf.createLinearRing(new Bbox(10000000d, 1000d, 1000000d, 1000000d)), null);