Before I will start to describe implemented application, let's remember little bit how it was in JDeveloper 10g. You can check my older blog post - JavaScript in ADF Faces - Oracle Maps. It was easy as well, but it wasn't so elegant as it is now. In JDeveloper 11g you don't need to care about JavaScript or Oracle Maps API, it's because you don't need to develop - just use provided components. And most important, there is no need to deploy developed application on the same OC4J, where Oracle MapViewer is deployed.
You can download developed application - OraMapsSimple11.zip and run it directly from JDeveloper 11g TP3. Base map in this sample is retrieved from open Oracle service - http://elocation.oracle.com/mapviewer, so in order to run application you need to have Internet connection. In this sample I'm using Customers point theme, data for this theme is retrieved from MVDEMO datasource. You can download this datasource from Oracle MapViewer page on OTN.
When I was developing sample application, I discovered that MDSYS.SDO_GEOMETRY object type is not supported yet by map component in current JDeveloper 11g Technology Preview. But no matter of this I wanted to use point theme from my database, so I applied workaround. Workaround is to add two read-only attributes for X and Y coordinates:
As you can notice, I'm accessing information from spatial column directly - using LOCATION.SDO_POINT.X and LOCATION.SDO_POINT.Y definition.
I have generated map area in View layer using steps described in section 25.6 Creating Databound Geographic Maps from Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework 11g Release 1. To add point theme to the map, it's needed only to provide required values and click Ok:
If you will not be lazy to run developed sample application, you will notice how cool are Oracle Maps in JDeveloper 11g. To run this application, you need to open it in JDeveloper 11g TP3 and select Run for main.jspx page, you will get similar view:
All functionality available in this screen, comes with standard component in JDeveloper 11g, you don't need to develop it, you can just use it:


13 comments:
How do I highlight a particular region in the map?
Hi,
You can use selection tool that comes with Oracle Maps.
Or you can use Color theme to display different regions on the map.
Regards,
Andrejus
What if I want the base maps to be served from my internal server in JDeveloper (I am new to JDeveloper).
How do I get the internal Jdeveloper server to serve the maps?
Hi,
You can just deploy Oracle MapViewer on the internal JDeveloper server.
Regards,
Andrejus
I have been trying to deploy the mapviewer.ear to the internal server. I added entries to the server.xml and default-web-site.xml files (and the ones in the template directory) and it still won't deploy. I am new to JDeveloper, I must be missing something obvious. If you have specific steps on how to deploy this ear, it would be a great help. Thanks.
Hi,
You can deploy it to JDeveloper internal OC4J. To do this you need to start OC4J from command line. At first set memory configuration with set command:
set OC4J_JVM_ARGS=-mx512M -ms256M -Xrs -XX:MaxPermSize=128M
Now you can start OC4J
JDEV_HOME/bin/oc4j -start
When OC4J will be running, deploy MapViewer EAR with admin_client.jar utility. This utility is described in this doc.
Regards,
Andrejus
Hi,
I have noticed, Oracle changed Base Maps in their http://elocation.oracle.com/mapviewer public map service. In order to run developed sample application, change Base Map name:
1. In JDeveloper 11g select dvt:map component
2. In Property Inspector tab press Edit Component Definition... icon
3. In opened Create Geographical Map wizard select ELOCATION_MERCATOR for Data Source and WORLD_MAP for Base Map
4. Press OK and change dvt:map component Id to "map".
Regards,
Andrej
Andrejus, I get the following errormessage:
DVT-26016: Unable to connect to mapviewer at http://elocation.oracle.com/mapviewer
Any idea how to solve this?
Hi,
I have tested, for me this sample works perfectly. May be there was no internet connection?
Regards,
Andrej
Is possible to use programatically a dvt:map component to send a command to mapviewer server (for example Zoom-In) ?
Hi,
I guess yes, but need to check in docs. Will follow up.
Regards,
Andrejus
Is possible to use programatically a dvt:map component to send a command to mapviewer server (for example Zoom-In) ?
Where to find information about that?
Post a Comment