8-24 Oracle Fusion Middleware Users Guide for Oracle MapViewer
8.3.1.3 Dynamic JDBC Query Theme-Based FOI Layers
When the client requests FOI data using a dynamic JDBC theme-based FOI request, it must specify the complete definition of the JDBC theme. The theme definition must
specify the rendering style and the SQL query that is to be used to query FOI data, including all geometry and non-geometry attributes.
Example 8–8 shows some JavaScript client code to create an FOI layer that displays a
buffer around each customer location.
Example 8–8 Theme for Dynamic JDBC Query
var theme = themestheme name=JDBC_THEME + jdbc_query asis=true spatial_column=location
jdbc_srid=8307 render_style=C.RED datasource=mvdemo +
select sdo_geom.sdo_bufferA.location,1,0.005,+ \unit=mile arc_tolerance=0.005\ location +
from customers A + jdbc_querythemethemes ;
buffertheme = new MVThemeBasedFOIbuffertheme,theme;
8.3.2 User-Defined FOI Requests
A user-defined FOI is a feature defined on the client side. Unlike the theme-based FOI layer, which is rendered as a collection of features, the user-defined FOI is requested
and rendered on an individual basis.
All attributes of the user-defined FOI, including the geometry representation and rendering style, must be provided by the application. The JavaScript map client sends
the request, with the geometry representation and rendering style information, to the FOI server. The FOI server renders the FOI image and returns it to the client. The
rendering style must be predefined in the USER_SDO_STYLES view.
8.4 Oracle Maps JavaScript API
The Oracle Maps JavaScript client is a browser-based map visualization engine that works on top of the map tile server and the FOI server. It implements the following
functions:
■
Fetching map tiles from the map tile server and displaying them as a map tile layer in the Web browser.
■
Sending FOI requests to the FOI server, and overlaying user-defined features and Oracle Spatial query-based features on top of the map tile layer.
■
Controlling user interaction, such as dragging for map navigation, clicking FOIs, drawing rectangles, and redlining.
Drawing a rectangle refers to the application user creating a rectangle by clicking and holding the mouse button at one corner of the rectangle, dragging the mouse
to the diagonally opposite corner, and releasing the mouse button.
Redlining
refers to the application user creating a polygon or polyline by clicking the mouse button and then moving the mouse and clicking multiple times, with
each click extending the redline by a straight line. Redline drawings are often rendered in red, although you can specify a line style that uses any color.
To access these functions, use the JavaScript API, which consists of several JavaScript classes, including the following:
Oracle Maps 8-25
■
The MVMapView class is the main entry point of the API. It implements most of the map control interfaces.
■
The MVMapTileLayer class formerly called the MVBaseMap class defines a map tile layer that displays map tiles rendered by the map tile server.
■
The MVThemeBasedFOI class defines and controls the theme based FOI layers.
■
The FOI class defines and controls user-defined FOIs.
■
The MVSdoGeometry class defines a geometry object. The geometry can be in any geometry type that is supported by Oracle Spatial.
■
The MVRedLineTool class defines and controls the redline utility.
■
The MVRectangleTool class defines and controls the rectangle tool.
■
The MVOverviewMap class defines and controls the overview map that displays the miniature overview of the main map as a small rectangle which is itself inside
a rectangle tool.
■
The MVMapDecoration class defines and controls map decorations. MVMapView is the main entry class for all map operations inside the Web browser.
MVMapView and the other classes provide all essential interfaces for adding logic to your Web mapping applications. These logical operations can include the following:
■
Create a map client instance and associate it with the map container DIV object created in the Web page.
■
Configure map parameters such as map center and map zoom level.
■
Create and manipulate map tile layers.
■
Create and manipulate theme-based FOI layers.
■
Create and manipulate user-defined individual FOIs.
■
Display an information window on the map.
■
Create fixed map decorations, such as a map title, custom copyright notes, and control buttons.
■
Access built-in utilities such as the navigation bar, scale bar, rectangle tool, redline tool, and overview map.
■
Use event listeners to customize the event handling. You can add event listeners to the MVMapView, MVThemeBasedFOI, and MVFOI classes using the appropriate
API methods.
For detailed information about all classes in the Oracle Maps JavaScript API, see the Javadoc-style reference documentation, which is included with MapViewer and is
available at the following location:
http:host:portmapviewerfsmcapidoc
8.5 Developing Oracle Maps Applications