protected GeometryStyle getGeometryStyle(Geometry geom, String id) {
   List<GeometrySelection> selections = mapView.getSelections();
   for (GeometrySelection set : selections) {
     if (set.isActive() && set.hasData(id)) {
       if (geom instanceof Point) {
         return set.getPointStyle();
       } else if (geom instanceof Line) {
         return set.getLineStyle();
       } else if (geom instanceof Polygon) {
         return set.getPolygonStyle();
       }
     }
   }
   return getGeometryStyle(geom);
 }
  public void loadData(Envelope envelope, int zoom) {
    // long time = System.currentTimeMillis();

    try {
      ArrayList<MapPos> pts = mapView.getMapBoundaryPts();
      Vector<Geometry> objectTemp = null;
      Vector<Geometry> objects = new Vector<Geometry>();

      GeometryData.Type dataType;
      if (type == Type.ENTITY) {
        dataType = GeometryData.Type.ENTITY;
        objectTemp =
            dbmgr.fetchAllVisibleEntityGeometry(
                pts, querySql, renderAll ? FaimsSettings.MAX_VECTOR_OBJECTS : maxObjects);
      } else if (type == Type.RELATIONSHIP) {
        dataType = GeometryData.Type.RELATIONSHIP;
        objectTemp =
            dbmgr.fetchAllVisibleRelationshipGeometry(
                pts, querySql, renderAll ? FaimsSettings.MAX_VECTOR_OBJECTS : maxObjects);
      } else {
        throw new Exception("database layer has no type");
      }

      createElementsInLayer(zoom, objectTemp, objects, dataType);

      setVisibleElementsList(objects);

    } catch (Exception e) {
      FLog.e("error rendering database layer", e);
    }

    if (textLayer != null) {
      textLayer.renderOnce();
      textLayer.calculateVisibleElements(envelope, zoom);
    }

    // FLog.d("time: " + (System.currentTimeMillis() - time) / 1000);
  }