JSP Example Several Tags for MapViewer

MapViewer JSP Tag Library 5-11 The following example uses two setParam tags. The first setParam tag sets the background color, width, height, and title for the map. The second setParam tag sets the center point and vertical span for the map. mv:setParam bgcolor=ff0000 width=800 height=600 title=My Map mv:setParam centerX=-122.35 centerY=37.85 size=1.5

5.3 JSP Example Several Tags for MapViewer

This section presents an example of using JSP code to perform several MapViewer operations. Example 5–1 initializes a MapViewer bean, sets up map request parameters, issues a request, and displays the resulting map image. It also obtains the associated MapViewer bean and places it in a scripting variable myHandle, which is then accessed directly in the statement: Displaying map: B =myHandle.getMapTitle B basemap Base map whose predefined themes are to be rendered by MapViewer. The definition of a base map is stored in the user’s USER_SDO_MAPS view, as described in Section 2.9.1 . Use this parameter if you will always need a background map on which to plot your own themes and geometry features. No bgcolor The background color in the resulting map image. The default is water-blue RGB value A6CAF0. It must be specified as a hexadecimal value. No bgimage The background image GIF or JPEG format only in the resulting map image. The image is retrieved at run time when a map request is being processed, and it is rendered before any other map features, except that any bgcolor value is rendered before the background image. No centerX X ordinate of the map center in the data coordinate space No centerY Y ordinate of the map center in the data coordinate space No height The height in device units of the resulting map image No imagescaling When its value is TRUE the default, MapViewer attempts to scale the images to fit the current querying window and the generated map image size. When its value is FALSE, and if an image theme is included directly or indirectly such as through a base map, the images from the image theme are displayed in their original resolution. This parameter has no effect when no image theme is involved in a map request. No size Vertical span of the map in the data coordinate space No title The map title to be displayed on the top of the resulting map image No width The width in device units of the resulting map image No Table 5–10 Cont. setParam Tag Parameters Parameter Name Description Required 5-12 Oracle Fusion Middleware Users Guide for Oracle MapViewer Example 5–1 MapViewer Operations Using JSP Tags page contentType=texthtml page session=true page import=oracle.lbs.mapclient.MapViewer taglib uri=http:xmlns.oracle.comspatialmvtaglib prefix=mv HTML BODY Initializing client MapViewer bean. Save the bean in the session using key mvHandle....P mv:init url=http:my_corp.com:8888mapvieweromserver datasource=mvdemo id=mvHandle Setting MapViewer parameters...P mv:setParam title=Hello World bgcolor=ffffff width=500 height=375 antialiasing=true Adding themes from a base map...P mv:importBaseMap name=density_map Setting initial map center and size...P mv:setParam centerX=-122.0 centerY=37.8 size=1.5 Issuing a map request... P mv:run Place the MapViewer bean in a Java variable. MapViewer myHandle = MapViewer session.getAttributemvHandle; Displaying map: B =myHandle.getMapTitle B IMG SRC=mv:getMapURL ALIGN=top BODY HTML 6 MapViewer PLSQL API 6-1 6 MapViewer PLSQL API This chapter describes the PLSQL application programming interface API to MapViewer. This API consists of the PLSQL package SDO_MVCLIENT, which is intended for Oracle Database users who want to access MapViewer services from inside an Oracle database. This package exposes most capabilities of MapViewer, and it handles all communication with the actual MapViewer server running on a middle tier on behalf of a user making map requests.

6.1 Installing the SDO_MVCLIENT Package