docs: @SuppressWarnings("unchecked")
      public OsmDroidMapShape addToMap(MapView map, Geometry geometry) {
  
          OsmDroidMapShape shape = null;
  
          GeometryType geometryType = geometry.getGeometryType();
          switch (geometryType) {
              case POINT:
                  shape = new OsmDroidMapShape(geometryType, OsmMapShapeType.MARKER,
                      addLatLngToMap(map, toLatLng2((Point) geometry)));
                  break;
              case LINESTRING:
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.POLYLINE, addPolylineToMap(map,
                      toPolyline((LineString) geometry)));
                  break;
              case POLYGON:
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.POLYGON, addPolygonToMap(map,
                      toPolygon((Polygon) geometry),
                      polygonOptions));
                  break;
              case MULTIPOINT:
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.MULTI_MARKER, addLatLngsToMap(map,
                      toLatLngs((MultiPoint) geometry)));
                  break;
              case MULTILINESTRING:
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.MULTI_POLYLINE, addPolylinesToMap(map,
                      toPolylines((MultiLineString) geometry)));
                  break;
              case MULTIPOLYGON:
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.MULTI_POLYGON, addPolygonsToMap(map,
                      toPolygons((MultiPolygon) geometry),polygonOptions));
                  break;
              case CIRCULARSTRING:
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.POLYLINE, addPolylineToMap(map,
                      toPolyline((CircularString) geometry)));
                  break;
              case COMPOUNDCURVE:
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.MULTI_POLYLINE, addPolylinesToMap(map,
                      toPolylines((CompoundCurve) geometry)));
                  break;
              case CURVEPOLYGON:
  
                  org.osmdroid.views.overlay.Polygon polygon = toCurvePolygon((CurvePolygon) geometry);
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.POLYGON, addPolygonToMap(map,
                      polygon, polygonOptions));
                  break;
              case POLYHEDRALSURFACE:
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.MULTI_POLYGON, addPolygonsToMap(map,
                      toPolygons((PolyhedralSurface) geometry),polygonOptions));
                  break;
              case TIN:
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.MULTI_POLYGON, addPolygonsToMap(map,
                      toPolygons((TIN) geometry),polygonOptions));
                  break;
              case TRIANGLE:
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.POLYGON, addPolygonToMap(map,
                      toPolygon((Triangle) geometry), polygonOptions));
                  break;
              case GEOMETRYCOLLECTION:
                  shape = new OsmDroidMapShape(geometryType,
                      OsmMapShapeType.COLLECTION, addToMap(map,
                      (GeometryCollection<Geometry>) geometry));
                  break;
              default:
                  throw new GeoPackageException("Unsupported Geometry Type: "
                      + geometryType.getName());
          }
  
          return shape;
      }