Search This Blog

Showing posts with label Work with a Map Report. Show all posts
Showing posts with label Work with a Map Report. Show all posts

Monday, June 30, 2025

How do I Work with a Map Report

 In Oracle APEX, a Map Report provides a powerful way to visualize spatial data directly within your application. By using either the built‑in Map region or the REST‑enabled Google Maps component, you can plot geographic information—such as locations, routes, or service areas—on an interactive map. Working with a Map Report involves preparing your data with latitude and longitude columns, creating the Map region in Page Designer, configuring layer types (markers, heat maps, or clusters), and customizing the appearance and behavior through region attributes and dynamic actions.

Using Arial font, size 14px, plain text:

To work with a Map Report in Oracle APEX, begin by ensuring your table or query returns geographic coordinates (latitude and longitude). In the Page Designer, add a new region and select Map as the region type. Choose Static Data if you have a fixed set of points, or SQL Query to dynamically pull location data. In your SQL query, include columns named lat and lon (or map them in the region attributes) alongside any tooltip or label fields.

Next, configure the Map region’s Layer settings. For a simple marker layer, set the layer type to “Point,” specify lat and lon for the latitude and longitude fields, and choose the column that provides the marker’s title or tooltip. If you need clustering—for when many points overlap—enable clustering and adjust the cluster radius. For heat maps, switch the layer type to “Heat Map” and select a weight column if you want point intensity to reflect a data value.

Under Attributes, customize the map provider (Oracle Maps or Google Maps), initial zoom level, and center coordinates. You can also set map controls like zoom buttons, pan controls, or a scale bar. If you want interactive behavior, create Dynamic Actions on map events such as “Marker Click” to populate page items or open a modal with detailed information.

To style the map, use the Appearance section to choose marker icons, colors, and shapes. You can supply a URL for custom marker images or select from the built‑in icon set. For further customization, add JavaScript in the Execute when Page Loads section to manipulate the map object directly (for example, drawing polylines or polygons).

Finally, test the map in the runtime environment. Verify that all markers appear correctly, tooltips display the right information, and interactive features work as expected. By following these steps—preparing your data, configuring layers and attributes, and adding interactivity—you can leverage Oracle APEX Map Reports to deliver compelling geographic visualizations in your applications.

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

By integrating Map Reports into your Oracle APEX applications, you unlock new insights and improve user engagement through geographic visualization. Whether you’re displaying customer locations, tracking asset movements, or highlighting regional trends, maps make your data more intuitive and actionable. With a few configuration steps, you can turn raw coordinate data into an interactive, visually rich report that enhances decision‑making and user experience.