Oracle APEX Map region and a few words about Layers

Photo by Ståle Grut on Unsplash

Oracle APEX Map region and a few words about Layers

Layers are logical collections of geographic data that are used to create maps. Oracle APEX allows us to create layers based on data from a database or REST service. Additionally, we can easily change the way our layers are displayed and define attributes such as Clustering, Tooltips or Zoom Levels.

Oracle APEX allows to create 5 different types of layers:

  • Points

  • Lines

  • Polygons

  • Heat Maps

  • Extruded Polygons

In addition to the basic attributes, each layer has attributes specific to the selected data type. For a Points layer, this may be the Points Clustering option or for an Extruded Polygons layer - Extrusion Value Column.

In this article, we will use a table that contains data about objects such as:

  • Buildings

  • Streets

  • Trees

An example record from my MAP_OBJECTS table looks like this:

Layers - common attributes

Tooltip - the tooltip is displayed when the user hovers the cursor over the selected object.

Link - action to be performed after clicking on the object. Three possible options:

  • Redirect to Page in this Application

  • Redirect to Page in different Application

  • Redirect to URL

Info Window - a pop-up appears after clicking on a selected object. Extension of tooltip functionality.

Zoom Levels - minimum (1) and maximum (18) zoom values for which the layer becomes visible.

Legend - basic legend settings (layer and icons visibility).

Points

Section: Point Objects

The "Style" attribute identifies how to display the point object. We have two options here. Display as "SVG" shape and select SVG "Shape" from the list of available shapes and specify "Shape Scale" (Scaling factor). The second option is "Icon". We can define "Icon Source" by selecting one of three options - "Icon Class", "Icon Class Column" or "Image URL".

Section: Appearance

In this section, we can define the appearance of markers or icons. If we decide to display the "SVG" shape in the "Appearance" section, we can define the following parameters: "Fill Color", "Fill Opacity", "Stroke Color" and "Stroke Width". If our point is displayed using an icon, we have two parameters: "Fill Color" and "Fill opacity".

Section: Point Clustering

A very interesting option available out-of-the-box. Here we can define parameters such as "Clustering Radius" (in pixels) or modify the appearance of clusters by selecting the "Fill Color" or "Tooltip".

Lines

Section: Appearance

In this section, as in the previous layer, we define the appearance of our objects. There are 3 attributes available. "Stroke Style" with values: "Solid", "Dotted", "Dashed" and "Dot-Dashed". "Stroke Color" and "Stroke Width" (minimum 0.05 and maximum 10).

Polygons

Section: Appearance

No surprises! In this section, we define the appearance of our objects. The first attribute is "Use Color Schema". If we turn off this attribute, the appearance of our objects will be defined by the following parameters: "Fill Color", "Fill Opacity" and "Stroke Color". If we enable the "Use Color Schema" attribute, we will be able to use a ready-made or custom color list. The "Color Scheme" attribute has four values: "Custom", "Sequential", "Diverging" and "Qualitative". The first one allows you to define the list of colors, e.g.: "#ff0000, #ff2020, #ff4040, #ff6060, #ff8080, #ffa0a0, #ffc0c0, #ffffff". In other cases, we can choose a ready-made list.

Heat Map

Heat map is a type of layer that allows you to display points. Heat maps are useful to visualize the density of point objects. As an example, we will use the EBA_SAMPLE_MAP_AIRPORTS table (from the Sample Maps application). Below we have a Heat map of all US airports. In a place where the number of airports is greater, the color is darker. As in the case of Polygons, in the "Appearance" section, we can define a list of colors by selecting one of the 4 possible options. "Custom", "Sequential", "Diverging" and "Qualitative".

Extruded Polygons

"Extruded" Polygons are 3D objects. The basics are polygons, but we can also define the height of our objects. It looks a bit like a chart on our map. In the "Appearance" section, as for Polygons, we can use the "Use Color Schema" attribute. We can choose a ready-made color list, define our own, or disable the "Use Color Schema" option and set the "Fill Color" parameter to get a single color. But we also have two new attributes here. "Extrusion Value Column" - value to determine the height of the extruded polygon and "Unit" to determine the height of the extruded polygon with the values: "Meter", "Kilometer", "Foot", "Mile".

Conclusions

Map region supports 5 different layer types: Points, Lines, Polygons, Heat maps and Extruded Polygons. All layers have the same sections and attributes such as "Zoom Levels" or "Tooltip". The "Appearance" section, which depends on the type of layer, allows us to define the appearance of our objects. It gives us many possibilities and our maps can be even more user-friendly.

All layers representing trees, streets and buildings: