With JDeveloper 11g we have standard support for Databound Geographic Maps. This means we don't need anymore to be GIS (Geographic Information System) specialists to enable Location-Based functionality in our enterprise applications. It sounds cool? Yes, but also it works :). It took for me 10 minutes (or little bit more) to develop sample application for this blog post.
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: