Using Display Map item with latitude and longitude

Oracle APEX Display Map item allows displaying a map with a point given as a GeoJSON object.

What happens if we have only two columns Lat and Long ?

We have just to transform them as a json object through a custom function as below:

create or replace function TO_GEOJSON
(lg in VARCHAR2,
lat in VARCHAR2)
return VARCHAR2
is
begin
return '{"coordinates":['||lat||','||lg ||'],"type": "point" }';
end;

In source properties of the map item, we choose :

  • Type: Expression
  • PL/SQL expression: to_geojson(:PXX_LONGITUDE, :PXX_LATITUDE)

About the author

GPM Factory