private void draw(Geometry geometry) {
    org.geomajas.gwt.client.spatial.geometry.Geometry transformed =
        mapWidget
            .getMapModel()
            .getMapView()
            .getWorldViewTransformer()
            .worldToPan(GeometryConverter.toGwt(geometry));

    GraphicsContext graphics = mapWidget.getVectorContext();
    graphics.drawGroup(mapWidget.getGroup(RenderGroup.VECTOR), geometry);

    if (transformed instanceof MultiPolygon) {
      draw(geometry, null, (MultiPolygon) transformed, graphics);
    } else if (transformed instanceof MultiPoint) {
      draw(geometry, null, (MultiPoint) transformed, graphics);
    } else if (transformed instanceof MultiLineString) {
      draw(geometry, null, (MultiLineString) transformed, graphics);
    } else if (transformed instanceof Polygon) {
      draw(geometry, null, (Polygon) transformed, graphics);
    } else if (transformed instanceof LineString) {
      draw(geometry, null, (LineString) transformed, graphics);
    } else if (transformed instanceof Point) {
      draw(geometry, null, (Point) transformed, graphics);
    }
  }
 @Override
 public void onDraw() {
   if (googleMap == null) {
     // create as first child of raster group
     map.getRasterContext().drawGroup(null, this);
     String id = map.getRasterContext().getId(this);
     // move to first position
     Element mapDiv = DOM.getElementById(id);
     Element rasterGroup =
         DOM.getElementById(map.getRasterContext().getId(map.getGroup(RenderGroup.RASTER)));
     DOM.insertBefore(DOM.getParent(rasterGroup), mapDiv, rasterGroup);
     String graphicsId = map.getVectorContext().getId();
     googleMap =
         createGoogleMap(
             id,
             graphicsId,
             type.name(),
             showMap,
             getVerticalMargin(),
             getHorizontalMargin(),
             getVerticalAlignmentString());
   }
 }