Search This Blog

Wednesday, July 23, 2025

How Do I Make a Faceted Search Map Page in Oracle APEX

Combining faceted search with a map region in Oracle APEX enables users to filter data visually and spatially at the same time. This design pattern is especially useful when presenting data with geographic relevance, like store locations, service areas, or project sites. A faceted search allows users to narrow down results using filter controls such as checkboxes, ranges, and search boxes—while the map visually updates based on those selections.

Step-by-Step: How to Build a Faceted Search Map Page

  1. Create a New Page with Faceted Search and Map

    • Go to the APEX App Builder.

    • Click Create Page.

    • Choose Faceted Search from the Reports section.

    • Choose or define a table or SQL query that includes location data (latitude and longitude or a spatial geometry).

    • Enable the Map option when prompted during page creation.

  2. Ensure Your Data Source Supports Spatial Mapping

    • Your source query should return one of the following:

      • latitude and longitude fields.

      • A JSON-formatted geometry column (GeoJSON).

    • Example SQL:

      SELECT store_id,
             store_name,
             city,
             state,
             region,
             category,
             '{ "type": "Point", "coordinates": [' || longitude || ',' || latitude || '] }' AS geometry
      FROM store_locations
      
  3. Configure the Faceted Search Filters

    • After page creation, go to Page Designer.

    • Under Faceted Search, define filters based on fields like:

      • City

      • State

      • Category

      • Region

    • APEX automatically links the facets to your map region if both use the same data source.

  4. Adjust Map Region Settings

    • In Page Designer, select the Map region.

    • Under Source, make sure it uses the same SQL or table as the Faceted Report.

    • Set Geometry Column to your spatial column (e.g., geometry).

    • Set Tooltip Column to a meaningful value like store_name.

    • Ensure Automatic Refresh is enabled so the map updates when filters are applied.

  5. Synchronize Facets with Map

    • APEX links the search filters to both the faceted report and the map automatically.

    • When a user selects a facet, the results in the report and map will reflect the filtered dataset in real time.

Example Use Case

Imagine an application showing healthcare clinics:

  • Users can filter by state, specialty, or accepted insurance.

  • The map automatically updates to show only those clinics that match.

  • Clicking a marker can open a tooltip or link to a clinic's detail page.

Best Practices

  • Keep facets relevant and limited to avoid clutter.

  • Use APEX_UTIL.PREPARE_URL in the map’s tooltip column if you need clickable links.

  • Use icons or clustering on the map for large datasets.

  • Make sure both the report and map share the exact same data source or query logic.

  • Test on both desktop and mobile to ensure filters and map interactions remain user-friendly.

Example:

Faceted search is a very useful search tool when combined with a map.


Step 1- The easiest way to create this is to CREATE a MAP PAGE and make sure that you select the “Create Faceted Search Page” option

A black and red rectangle with a white circle and a red line

Description automatically generated

Step 2 – There will be some options for the faceted search. Select what you want and move on. After the page is created you can add more faceted search options.

Step 3 Add more faceted searches in the left column. Right click on the Facets Region and add your new Facet.

 A screenshot of a computer

Description automatically generated  A screenshot of a computer

Description automatically generated

Step 4 – Select new Facet. Keep in mind that:

  • Facet is a DISTINCT search criteria

  • Too many DISTINCT searches might break the page.


In Identity make sure that you have selected a Checkbox Group

A screenshot of a computer

Description automatically generated

In List of Values, select Distinct values

A screenshot of a computer

Description automatically generated

In Source select the data column that you want to use for search

A black and red rectangle with white text

Description automatically generated

Optionally you can make additional changes in the following areas as desired

A screenshot of a computer screen

Description automatically generated A black and white square with green squares

Description automatically generated

A black rectangular object with white lights

Description automatically generated

Oracle APEX Documentation

For more details on Faceted Search and Maps in APEX:
https://docs.oracle.com/en/database/oracle/apex/
Search for: “Faceted Search”, “Map Region”, and “Spatial Data Visualization”.

Conclusion

A faceted search map page in Oracle APEX offers a powerful and intuitive way to explore spatial data with rich filtering options. By tightly integrating map visuals with user-driven filters, you enhance usability and make your applications more interactive and informative. Whether you're building a store locator, real estate viewer, or any spatial dashboard, this pattern helps users discover data easily and meaningfully.

No comments:

Post a Comment

How Do I Make a Faceted Search Map Page in Oracle APEX

Combining faceted search with a map region in Oracle APEX enables users to filter data visually and spatially at the same time. This design ...