Search This Blog

Sunday, July 13, 2025

How do I make the map’s tooltip display a detail page

 

Introduction
In Oracle APEX, maps are a powerful way to present location-based data visually. But what if you want to go beyond simple tooltips and allow users to drill into a full detail page directly from a map marker? By configuring your map tooltips to act as clickable links, you can guide users from a high-level overview to specific information with just one click. This blog will explain how to make your map’s tooltip open a detail page, creating a smooth and interactive experience.

How to Make the Map’s Tooltip Display a Detail Page

To configure a map in Oracle APEX so that tooltips display links to detail pages, follow these steps:

  1. Prepare Your Data Source

    • Your SQL query should return all the data needed for the marker and the link.

    • Example:

      SELECT 
        id,
        store_name AS name,
        latitude,
        longitude,
        'Click for details' AS tooltip_text,
        'f?p=&APP_ID.:50:&SESSION.::NO::P50_STORE_ID:' || id AS detail_link
      FROM store_locations
      
    • Replace 50 with the page number of your detail page, and P50_STORE_ID with the appropriate item name.

  2. Configure the Map Region

    • In Page Designer, click on the Map region.

    • Under Map Attributes, go to Marker Layer.

  3. Set Marker Tooltip

    • Set the Tooltip field to the tooltip_text column, or build it dynamically using the link.

    • To embed a hyperlink, use HTML in the tooltip:

      '<a href="' || 'f?p=&APP_ID.:50:&SESSION.::NO::P50_STORE_ID:' || id || '">View Store: ' || store_name || '</a>'
      
    • Be sure to set Escape Special Characters to No so the HTML renders.

  4. Optional: Open in Modal Dialog or New Tab

    • To open in a new tab:

      <a href="..." target="_blank">...</a>
      
    • To open in a modal dialog, use a Dynamic Action or link to a page configured as a modal.

  5. Test and Deploy

    • Run your app.

    • Hover over a map marker, confirm that the tooltip shows the correct link, and test that clicking it navigates to the right detail page. 

In this example we are going to make the tool tip “clickable and display a pre-existing detail page.

Step 1 – Go to the layer that displays the tooltip.

A screenshot of a computer

AI-generated content may be incorrect. 

Step 2- Go to the Link area and select the type of redirect that you want

A screenshot of a computer

AI-generated content may be incorrect. 

Step 3 – Set the link

A screenshot of a computer

Description automatically generated 


Step 4 -  Select

  • Type- In this case “Page in this application”

  • Page – This is the application page number. In this case is page #5.

  • Set Items

    • Name: The name of the control IN THE DESTINATION page

    • Value: The value you are passing TO the destination screen. We are passing the Identity column value.


A screenshot of a computer

AI-generated content may be incorrect.


Save your changes and browse. In this example we open a “drawer” form of the location.

A screenshot of a computer

AI-generated content may be incorrect.



 

Conclusion
Enabling users to navigate from map tooltips to detailed views adds depth and interactivity to your Oracle APEX applications. With just a few changes to your SQL and map region settings, you can create dynamic, data-driven maps that double as navigation tools. This small enhancement provides a big improvement to the user experience, helping your application feel more connected, responsive, and intuitive.

How do I Add a tool tip information to a map

 

Introduction
When building interactive Map components in Oracle APEX, tooltips provide a simple yet powerful way to enhance the user experience. By displaying relevant details when hovering over a map marker or shape, users can quickly gather contextual information without needing to click or navigate away. Adding tooltip information to a map region allows you to present key insights like names, addresses, statuses, or numeric values in a compact and user-friendly format.

Detailed Instructions: How to Add Tooltip Information to a Map in Oracle APEX

To add tooltips to a map in Oracle APEX, follow these detailed steps:

  1. Create or Edit a Map Region

    • Open your application in Page Designer.

    • Select an existing Map region or create a new one by adding a Map region to your page.

  2. Set Up Your SQL Query with Tooltip Data

    • Your data source must include a column with the information you want to show in the tooltip.

    • Example:

      SELECT 
        id,
        store_name AS name,
        latitude,
        longitude,
        'Store: ' || store_name || '<br>Status: ' || status AS tooltip_text
      FROM store_locations
      
    • The concatenated string becomes your tooltip content. Use HTML (like <br>) to format multiline tooltips if needed.

  3. Assign the Tooltip Column to the Marker Layer

    • In the Map Attributes section, go to Marker Layer > Tooltip.

    • Choose the column you defined for tooltips (e.g., tooltip_text).

    • This tells APEX to show that column’s content when a user hovers over a map marker.

  4. Optional: Use HTML or CSS for Styling

    • You can add simple HTML (line breaks, bold text) or apply inline styles if HTML Escaping is disabled.

    • Example:

      '<b>' || store_name || '</b><br><span style="color:gray">Status: ' || status || '</span>'
      
  5. Preview and Test

    • Run the page and hover over map markers.

    • Tooltips should now display the assigned content.

    • If nothing appears, ensure the Tooltip field is correctly mapped, and HTML escaping is set appropriately.

  6. Advanced (Optional): Use Dynamic Tooltips

    • Tooltips can also be generated dynamically using PL/SQL functions or LOVs if you want to display real-time values or multilingual data.

 

Adding a Tooltip to a Map Faceted Report in Oracle APEX

A Map Faceted Report in Oracle APEX provides users with an interactive way to visualize data based on geographic locations while allowing them to refine results using facets. Adding a tooltip enhances the user experience by displaying additional details when they hover over map points, allowing them to get more information without clicking or navigating away.

 

Why Use Tooltips in a Map Faceted Report?

Tooltips provide an efficient way to show extra details about a location without cluttering the interface. They allow users to quickly understand key attributes of a map point, such as address, population, revenue, or other relevant information.

 

Steps to Add a Tooltip to a Map Faceted Report

Step 1: Create a Map Faceted Report

  1. Open App Builder in Oracle APEX and navigate to your application.

  2. Click Create Page and select Faceted Search under the Report section.

  3. Choose a table or SQL query containing location-based data (such as latitude and longitude).

  4. Click Next, set up the page attributes, and click Create.

  5. Once the report is created, go to Page Designer and locate the Map Report Region.

 

Step 2: Enable Tooltips for Map Points

  1. Select the Map Region in Page Designer.

  2. Open the Attributes section and find the Tooltip settings.

  3. In the Tooltip Column option, choose the column that contains the text you want to display in the tooltip.

  4. If no tooltip column exists in the dataset, create a custom SQL Query to concatenate necessary information: 

SELECT location_name, latitude, longitude, 

       'Address: ' || address || '<br>Population: ' || population AS tooltip_info

FROM locations_table;

  1. Save the changes and run the report. Now, hovering over a map point will display the information from the selected tooltip column.

 

Step 3: Customize the Tooltip Appearance Using CSS

APEX allows styling tooltips using CSS to improve readability.

  1. Navigate to Shared ComponentsThemesCSS.

  2. Add the following CSS code to customize tooltip appearance: 

.apex-map-tooltip {

    background-color: rgba(0, 0, 0, 0.8);

    color: white;

    padding: 8px;

    border-radius: 5px;

    font-size: 12px;

}

  1. Save the CSS changes and refresh the page to see the customized tooltip.

 

Step 4: Enhancing Tooltips with JavaScript for Dynamic Content

To further enhance tooltips, use JavaScript to display dynamic content:

  1. Open Page Designer and select the Map Region.

  2. In the JavaScript section, add a dynamic action triggered on Mouse Over for map points.

  3. Add the following JavaScript to format and enhance tooltips dynamically: 

function customizeTooltip(mapPoint) {

    return `<b>${mapPoint.location_name}</b><br>

            Address: ${mapPoint.address}<br>

            Population: ${mapPoint.population}`;

}


apex.region("map_region_static_id").widget().on("mouseover", ".a-map-point", function(event) {

    let tooltipContent = customizeTooltip(event.data);

    apex.tooltip.show(event.target, tooltipContent);

});

  1. Save the changes and test the tooltip behavior.

 Best Practices for Tooltips in Map Faceted Reports

  • Keep tooltip text concise to avoid overwhelming users.

  • Use HTML formatting to make the tooltip content more readable.

  • Ensure tooltips contain relevant and useful information based on the use case.

  • Optimize the dataset query to avoid performance issues when rendering tooltips.

  • Test tooltips on different devices to ensure usability across various screen sizes.

 

Adding tooltips to a Map Faceted Report in Oracle APEX enhances the user experience by providing contextual information without requiring extra clicks. Using APEX’s built-in tooltip options, custom CSS styling, and JavaScript enhancements, developers can create visually appealing and informative tooltips that improve usability and data exploration.


EXAMPLE:

Step 1 – click on the Layer that you’re wanting to use for the tip placement.

A screenshot of a computer

AI-generated content may be incorrect.

Step 2-  Select the Tool Tip area and switch to “Advanced Formatting”.

A screen shot of a computer

AI-generated content may be incorrect.

Step 3 – Add the HTML and table tags to display the data

A screenshot of a computer

Description automatically generated

Here is the code:

Location code: &LOCATION_CODE. <br>

Location name: &LOCATION_NAME.<br>

Address: &ADDRESS_LINE_1.<br>

City: &CITY.<br>

State: &STATE_OR_PROVINCE.<br>

Postal Code: &POSTAL_CODE.<br>

Weather Station: &WEATHER_STATION.<br>

Notice that:

  • Table column names are ALL upper case

  • Table column names start with a “&” and end with a period “.”

  • You can mix HTML and the column names to generate the tool tip.

Save and preview

A map with blue pins

AI-generated content may be incorrect.




Conclusion
Adding tooltips to map markers in Oracle APEX significantly improves how users interact with spatial data. Tooltips provide instant, relevant information without cluttering the map or requiring additional clicks. Whether you're showing store details, customer metrics, or delivery statuses, tooltips offer a simple and elegant way to make your Map Reports more informative and user-friendly. With just a few steps, you can enrich your application’s usability and deliver a better visual experience to your users.

Saturday, July 12, 2025

How do I Work with a Map Report

 

Introduction
Displaying spatial data in a visual, interactive way is increasingly valuable in modern applications. In Oracle APEX, Map Reports offer a powerful and intuitive way to represent geographic information directly within your application. Whether you're tracking locations, plotting assets, or visualizing regions with business data, a Map Report provides an effective tool to enhance the user experience and bring location intelligence into your APEX apps.

Detailed Instructions: How to Work with a Map Report in Oracle APEX

To work with a Map Report in Oracle APEX, follow these steps:

  1. Prepare Your Spatial Data

    • Make sure your table contains spatial data in the form of SDO_GEOMETRY or longitude/latitude pairs.

    • Example table:

      CREATE TABLE store_locations (
        id           NUMBER,
        store_name   VARCHAR2(100),
        longitude    NUMBER,
        latitude     NUMBER
      );
      
  2. Create a Map Region

    • Open Page Designer, click Regions, then create a new Map region.

    • Set the Region Type to Map.

    • Choose the Data Source Type: SQL Query or Table/View.

    • If using SQL, provide a query with longitude and latitude columns.

      SELECT id,
             store_name AS name,
             latitude,
             longitude
      FROM store_locations
      
  3. Configure Map Attributes

    • Under the Map Attributes, choose the map provider (Oracle Maps, OpenStreetMap, or others).

    • Set the marker layer to define what icons will be shown.

    • You can bind column values to tooltips, labels, and popup info windows for interaction.

  4. Style the Map Markers

    • Go to the Appearance settings to assign marker icons based on data.

    • You can use different icons or colors based on location type, category, or status.

  5. Add Interactivity

    • Use Dynamic Actions to respond to user clicks on map markers.

    • For example, when a user clicks a marker, you can redirect them to a details page or open a modal.

  6. Test and Adjust Zoom

    • Customize the map’s initial zoom level and center point to best fit your data coverage.

  7. Use RESTful Data Sources (Optional)

    • APEX also allows loading map data from REST APIs if your location data resides in external systems.

 

The first thing that you need to make a map work is a way to map your points of interest into the map. This can be done using one of three categories:

Geospatial Data Types in Oracle APEX

Oracle APEX supports multiple geospatial data formats, each suited for different use cases in mapping and spatial analysis.

1. SDO_GEOMETRY (Oracle Spatial Object Type)

  • SDO_GEOMETRY is a specialized Oracle Object Type used by Oracle Spatial to store and manipulate geographic data.

  • It includes details such as the coordinate system, geometry type, dimensions, and spatial data points stored in an array.

  • Ideal for map layers in APEX and advanced spatial operations.

  • Utilized by the SDO_UTIL and SDO_SAM packages for: 

    • Calculating distances between points.

    • Performing spatial analysis and geometric transformations.

  • Supports all geometry types, including points, lines, and polygons.

2. GeoJSON (Geospatial JSON Format)

  • GeoJSON is a widely used JSON-based format for representing geographic data.

  • Follows the GeoJSON standard, making it easy to read and exchange between systems.

  • Oracle supports storing and indexing GeoJSON data.

  • Particularly useful in JavaScript-based applications and dynamic map interactions.

  • Supports all geometry types, including points, lines, and polygons.

3. Longitude/Latitude (2D Coordinates)

  • The simplest and most common way to represent locations on a map.

  • Uses two numeric values

    • Longitude (X-axis) – Horizontal position.

    • Latitude (Y-axis) – Vertical position.

  • Familiar to most users and widely available in public datasets and APIs.

  • Suitable for basic mapping needs and integration with mapping tools like Google Maps.

Each of these geospatial data types serves a unique purpose in Oracle APEX, from simple mapping to complex spatial analytics


EXAMPLE:

In this case we will use Longitude/Latitude.

Step 1 – Create a map page

A screenshot of a computer

Description automatically generated

Select table

A screenshot of a computer

Description automatically generated

Select map style

A screenshot of a map

Description automatically generated



Save and Browse


A map of the world

Description automatically generated


Conclusion
Working with a Map Report in Oracle APEX allows you to visually represent data in ways that tables and charts cannot. With support for spatial queries, dynamic interactions, and beautiful visual styling, Map Reports help users explore, analyze, and act on geographic data with ease. Whether you're plotting store locations, delivery zones, or event venues, integrating a Map Report into your application elevates both functionality and user experience.

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 ...