One similar discussion on this forum was focusing on centering map based on static values. I am, however, trying to use either SQL or value(s) of page items to center a map. All of this is happening on apex.oracle.com.
Specific form renders SITE_ID (primary key) as well as LATITUDE and LONGITUDE (numeric) values. I added a MAP region on the same page, which should center on a location for *that* record.
If I use static values for Initial Position and Zoom, the map works, but it requires to log out and log back in before it "kicks in".
Help text for static values says that supported substitutions are "Application, Page Items and System Variables." I tried referencing page items P31_LONGITUDE and P31_LATITUDE (also, versions :P31_LONGITUDE and &P31_LONGITUDE., etc.), only to get a variety of error messages: "not numeric value" or "Initial position coordinates are invalid." Although LAT and LONG are number columns, and items on page are set as "Number Field," I tried using to_number (P31_LONGITUDE) and all other variations, to no avail.
Next, I tried with SQL statement and corresponding geometry data type:
This works, but ONLY the first time the page is loaded. If I drill down to a different record, or use icon link to branch to another site, the map stays locked in the original location, no matter what. I can get it to move either manually or by logging out and logging back in.
Any suggestions?