MapViewer - addJDBCTheme

Is there anything peculiar about the SQL string passed into addJDBCTheme in the MapViewer bean? Whatever SQL I try, the new theme does not get rendered. It seems to create the theme OK (it gets assigned a theme number) but it seems to always contain no data.
Does anyone have an example of addJDBCTheme that works?
Thanks

We installed the mapvier.ear file in the $ORA_HOME/j2ee/geomarca/applications directory. We deployed the mapviewer.ear which caused the new installation of the mapviewer files.
In the properties of the mapviewer application within the AS we added 3 library-files with their complete path: sdovis.jar, sdoutl.jar y outapi.jar (we did not add chartviewer.jar, because the manual does not indicate that, however the chartbuilder.jar file is in the directory).
We checked the existence of JDK 1.4.2 and because we deployed the mapviewer.ear file all the jars in the lib directory are from the same mapviewer.ear. We are working however with the "old" version of AS (10 g, november 2004)
After deploying the mapviewer.ear we encountered even more problems:
- using the basema^p statement generates an error when executing a maprequest
- leaving the basemap statement out of the request the same NoClassDef error appears which we had originally
- function map.setBaseMapName("geomarca") does not work;
- function map.addMarkerStyle("mkcircle", 3, "blue","red",null,null,null,"5");
The strange thing is that other functionality does work!!
Shoud we install AS all over again, perhaps the new version, or could we solve all this in an easier way?

Similar Messages

  • ORA 00600 Error when using Mapviewer addJDBCTheme

    Hello
    I am receiveing the 600 error via my OC4J window when using mapviewers addJDBCTheme with the passTthrough boolean set to false (the query is rewitten by mapviewer to limit it to the results to the map view). If I perfrom the same query with passThrough set to true, no problems. I have a feeling this may relate to the index on my table. OC4J output for error below.
    Any ideas appriciated.
    Chris
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.lbs.mapserver.oms] request.getRemoteUser = null
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.lbs.mapserver.oms] request= <?xml version="1.0" standalone="yes"?>
    <map_request
    datasource="atrium2"
    srid="81989"
    width="500"
    height="500"
    bgcolor="#ffffff"
    antialiase="true"
    format="PNG_URL">
    <center size="800.0">
    <geoFeature>
    <geometricProperty typeName="center">
    <Point>
    <coordinates>278872.6,187144.0</coordinates>
    </Point>
    </geometricProperty>
    </geoFeature>
    </center>
    <themes>
    <theme name="BUIDLING" user_clickable="false" />
    <theme name="BLOCKS" user_clickable="false">
    <jdbc_query
    label_column="mbl_title"
    spatial_column="spat_data"
    label_style="TEXTBLACK"
    render_style="TEST3"
    jdbc_srid="81989"
    datasource="atrium2"
    asis="false">select spat_data, mbl_bka_id, mbl_title from WPE_SPATIAL_BLOCKS_VIEW_10G c
    </jdbc_query>
    </theme>
    </themes>
    </map_request>
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.JSDOGeometry] exception while getting srid from a geometry node: For input string: ""
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.lbs.mapserver.core.MapperPool] getMapper(atrium2) begins...
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.lbs.mapserver.core.MapperPool] getMapper() succeeded.
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.SRS] got srs object for :81989
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.lbs.mapserver.core.RealWorker] adding additional themes...
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.lbs.mapserver.core.RealWorker] adding a predefined theme BUIDLING
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.DBMapMaker] adding predefined theme [name=BUIDLING]
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.lbs.mapserver.core.RealWorker] adding a JDBC Theme:
    ThemeDescriptor=
    name=BLOCKS
    type=2
    minScale=Infinity
    maxScale=-Infinity
    srid=81989
    host=null
    sid=null
    port=null
    user=null
    mode=null
    query=select spat_data, mbl_bka_id, mbl_title from WPE_SPATIAL_BLOCKS_VIEW_10G c
    spatialColumn=spat_data
    renderStyleName=TEST3
    labelColumn=mbl_title
    labelStyleName=TEXTBLACK
    renderStyleDef=null
    labelStyleDef=null
    localThem=null
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.SRS] *** isGeodetic=false, unit=METER
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.sdovis.DBMapMaker] LoadThemeData running thread: Thread-67
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.theme.pgtp] [ BUIDLING ]: 278472.6,186744.0,279272.6,187544.0
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.theme.pgtp] [ BUIDLING ]: SELECT ROWID, GEOLOC, 'PRISM_ADM:BROWN_LINE', null, 'null', -1 FROM SPAT_BUILDING WHERE MDSYS.SDO_FILTER(GEOLOC, MDSYS.SDO_GEOMETRY(2003, 81989, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(?, ?, ?, ?)), 'querytype=WINDOW') = 'TRUE'
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.sdovis.DBMapMaker] LoadThemeData running thread: Thread-68
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.sdovis.theme.DGTP] [Master scale] 153.60000000000002 [Theme scale factor] 1.0
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.theme.DGTP] [DynGeomTheme] rewritten query: SELECT * FROM ( select spat_data, mbl_bka_id, mbl_title from WPE_SPATIAL_BLOCKS_VIEW_10G c ) WHERE MDSYS.SDO_FILTER(spat_data, MDSYS.SDO_GEOMETRY(2003, 81989, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(278472.6,186744.0,279272.6,187544.0)), 'querytype=WINDOW') = 'TRUE'
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.sdovis.theme.pgtp] [ BUIDLING ] sql exec time: 15ms, total time loading 209 features: 125ms.
    Tue Aug 09 10:58:53 BST 2005 WARN [oracle.sdovis.theme.DGTP] java.sql.SQLException: ORA-00600: internal error code, arguments: [kdsgrp1], [], [], [], [], [], [], []
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:242)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:554)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1478)
         at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:969)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2387)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2660)
         at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:777)
         at oracle.sdovis.theme.DynGeomThemeProducer.prepareData(DynGeomThemeProducer.java:241)
         at oracle.sdovis.Theme.prepareData(Theme.java:174)
         at oracle.sdovis.DBMapMaker$LoadThemeData.run(DBMapMaker.java:1740)
    Tue Aug 09 10:58:53 BST 2005 ERROR [oracle.sdovis.DBMapMaker] Message:null
    Description: Nested exception is:
    java.sql.SQLException: ORA-00600: internal error code, arguments: [kdsgrp1], [], [], [], [], [], [], []
    java.sql.SQLException: ORA-00600: internal error code, arguments: [kdsgrp1], [], [], [], [], [], [], []
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:242)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:554)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1478)
         at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:969)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2387)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2660)
         at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:777)
         at oracle.sdovis.theme.DynGeomThemeProducer.prepareData(DynGeomThemeProducer.java:241)
         at oracle.sdovis.Theme.prepareData(Theme.java:174)
         at oracle.sdovis.DBMapMaker$LoadThemeData.run(DBMapMaker.java:1740)
    Tue Aug 09 10:58:53 BST 2005 INFO [oracle.sdovis.DBMapMaker] **** time spent on loading features: 15250ms.
    Tue Aug 09 10:58:53 BST 2005 FINEST [oracle.sdovis.RE] xfm: 0.625 0.0 0.0 -0.625 -174045.375 117215.0
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.sdovis.VectorRenderer] time to render theme BUIDLING with 209 styled features: 15ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.sdovis.VectorRenderer] time to render theme BLOCKS with 0 styled features: 0ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.sdovis.VectorRenderer] time to label theme BLOCKS with 0 styled features: 0ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.sdovis.VectorRenderer] time to label theme BUIDLING with 209 styled features: 0ms
    Tue Aug 09 10:58:53 BST 2005 INFO [oracle.sdovis.DBMapMaker] **** time spent on rendering: 15ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.lbs.mapserver.core.MapperPool] freeMapper() begins...
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] preparation time: 16ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] querying/rendering time: 15265ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] packing time: 31ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] --------------- total time: 15312ms

    Chris,
    Can you run this rewritten query
    SELECT * FROM ( select spat_data, mbl_bka_id, mbl_title from WPE_SPATIAL_BLOCKS_VIEW_10G c ) WHERE MDSYS.SDO_FILTER(spat_data, MDSYS.SDO_GEOMETRY(2003, 81989, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(278472.6,186744.0,279272.6,187544.0)), 'querytype=WINDOW') = 'TRUE'
    in sql*plus without any errors?
    The asumptions is there is a spatial index on spat_data and all the geometries are valid.
    Also there will be a trace file on the db server. That'll give more details on what the likely cause is.
    Jayant

  • How to display mapviewer labels in two lines instead of one?

    Hi,
    I have been using the addJDBCTheme to display the map along with the labels as follows:
    mapviewer.addJDBCTheme("aaa","a", "SELECT geom, col1 || ':' || col2 label_value from table_name","GEOM","","styleName","label_value","T.ROAD NAME" ,false);
    So the label is displayed as col1Value:col2Value.
    Now I need to display the label as follows:
    col1Value
    col2Value
    I tried using this
    mapviewer.addJDBCTheme("aaa","a", "SELECT geom, col1 || chr(10) || col2 label_value from table_name","GEOM","","styleName","label_value","T.ROAD NAME" ,false);
    But it doesnt work. This displays col1Valuecol2Value
    So I tried using this:
    mapviewer.addJDBCTheme("aaa","a", "SELECT geom, col1 label_value from table_name UNION ALL SELECT geom, col2 label_value from table_name","GEOM","","styleName","label_value","T.ROAD NAME" ,false);
    This actually works. Meaning it displays the label in two lines. But the two lines are almost attached together, there is no space between them at all. It is sometimes very difficult to read.
    Would really appreciate any suggestions to resolve this issue.
    Is there any other solution to display a label in two lines? I tried changing the label style to set the line-height. But that does'nt work either.
    Lakshmi

    Multiline label aren't supported as yet.
    JayantDoes MapViewer 10.1.3 (the latest version for present) support it?

  • Rendering location and text

    Hi
    I am rendering village locations using marker style and text style. I am using mapviewer11ea.Following is the xml format of this.
    <?xml version="1.0" standalone="yes"?>
    <styling_rules>
    <rule column="MSLINK">
    <features style="M.MAJOR_VILLAGES"> </features>
    <label column="NAME" style="T.MAJOR_VILLAGES"> 1 </label>
    </rule>
    </styling_rules>
    Now it renders village location and village name without any problem. For identifying feature [getting informtion of selected village] I need to hilite this location and place marker where the mouse has clicked. For placing marker i am using mapviewer.addPointFeature(...) and for hiliting the selected village I am using mapViewer.addJDBCTheme(...) methods. But in the both the cases the text[village name] will go off [ text will disappear].
    Please give me suggession to solve this
    Thnaks,
    Sujnan

    Hi,
    Thanks for replay.
    Here is my addPointFeature and addJDBCTheme methods
    Point2D pt = mapViewer.getUserPoint(intScreenX, intScreenY);
    mapViewer.addPointFeature(pt.getX(), pt.getY(), 81993, M.CYAN PIN, null, null, null);
    where intScreenX, intScreenY are screen coordinates.
    and addJDBCTheme method is
    mapViewer.addJDBCTheme("MapDataSource", "Hilite", strQuery, "geom", "81993", "M.HILITE_POINT" , null, null, false);
    Xml style definition for M.HILITE_POINT is
    <?xml version="1.0" standalone="yes"?>
    <svg height="1in" width="1in">
    <desc/>
    <g class="marker" style="stroke:#FFCC00;fill:#FFFF33;width:8;height:8;font-family:Dialog;font-size:12;font-fill:#FF0000;text-offset-x:10;text-offset-y:10">
    <circle cx="0" cy="0" r="8.0"/>
    </g>
    </svg>
    Thanks,
    Sujnan

  • JDBC Network Theme

    hello.
    for a simple example we can use the JdbcTheme as this :
    mapViewer.addJDBCTheme("mvdemo","STATES_TH","select geom,state from states","geom",
    "8307","C.COUNTIES","STATE","T.STATE NAME",false);
    but if I have a network JDBC THEME (for example shortest path) in this case the parameters change (start node_id and end node_id) and also the result, How can I do that in this case,
    Please help me .
    Thank you for All in Advence

    You can use the API method addShortestPath that applies to network data. Note, that this and other API methods for networks (such as addLinksWithinCost) load the network area for each request and are not optimized. For an application where you want to process network analysis and show the results, the suggested approach is to use the Network java API (which has methods to load data on demand) to produce the analysis results with geometries, and then with MapViewer API you can build a JDBC theme with these geometries to show the results.

  • MapViewer metadata problem - accessing spatial data in a different schema.

    I have a MapViewer application that uses data from three different schemas.
    1. Dynamic Themes come from schema A.
    2. Static Themes come from schema B.
    3. A newly added static theme in B whose data comes from schema C.
    The mapviewer datasource points to schema B where the static themes, data and metadata are defined while the dynamic themes have their own datasource specified as part of addJDBCTheme(...).
    To get the newly added map to work I've had to add a view in schema B that points to C instead of referencing directly the table and I've had to add the metadata twice, once for schema B and once for schema C.
    If I put the metadata in just one of the two schemas I get the following errors.
    08/11/21 13:58:57 ERROR [oracle.sdovis.ThemeTable] cannot find entry in ALL_SDO_GEOM_METADATA table for theme: AMBITOS_REST
    08/11/21 13:58:57 ERROR [oracle.sdovis.ThemeTable] java.sql.SQLException: Invalid column index
    OR
    08/11/21 13:53:39 ERROR [oracle.sdovis.theme.pgtp] java.sql.SQLException: ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA view
    It's not a big deal but I'd like to know if anyone else has has similar problems.
    Saludos,
    Lew.
    Edited by: Lew2 on Nov 21, 2008 6:42 AM

    Hi Lew,
    if you are using a recent version (10.1.3.1 or later) there is no need to use a view and to create the metadata in both schemas.
    You need to grant selection on tables between the schemas.
    You can try the following. Assume you have the MVDEMO schema (from MapViewer kit) and SCOTT schema.
    1) grant select on MVDEMO Counties table to SCOTT
    SQL> grant select on counties to scott;
    2) Now you are ready to create a predefined theme in schema SCOTT using the MVDEMO Counties table.
    - Open MapBuilder and loads the SCOTT schema.
    - On the Data navigator (bottom left tree), go to Geometry tables and you should see the MVDEMO node and the COUNTIES node inside it.
    - Start a wizard to create a geometry theme based on this Counties table.
    - At the end you should see that the base table name is MVDEMO.COUNTIES. Therefore MapViewer will use the metadata in MVDEMO schema and there is no need to replicate it in SCOTT schema.
    Joao

  • OracleAS MapViewer Bean

    Hello,
    I'm using the OracleAS MapViewer Bean in my JSP application. As said in the use guide, this Bean is used for all maps created during the current session. But for me, it's a problem because when I close a first map (with addPointFeature, addWMSMapTheme and addJDBCTheme functions) and want to create a second one (with the same functions but with another data), information of the firsts is always there.
    Does anyone know how to put the scope of the Bean to page and not still to session?
    (As in the tag
    <jsp:usebean
    id="BeanName"
    class="com.XXX.class"
    scope="page">
    </jsp:usebean>
    Thanks in advance.

    The API has methods (such as deleteAllThemes, removeAllPointFeatures) to clean your current request. You can use these methods before creating the second map.

  • Using MapViewer in JSP

    Hi,
    Are there any example where we can use the methods sendXMLRequest() and getXMLResponse of the MapViewer class from a jsp page ?
    The response I got for the server using these methods are "Message:[oms] empty or null xml map request string."
    thanks

    Respect sir i m sending a code given below.sir i want to identify the map location,but my code give the some error,i could't understand what i do.becoz error are shown array out of bound index..please help me.
    Code..
    <%@ page contentType="text/html;charset=UTF-8" %>
    <%@ page session="true" %>
    <%@ page import="java.util.Enumeration" %>
    <%@ page import="java.awt.geom.Point2D" %>
    <%@ page import="java.awt.Dimension" %>
    <%@ page import="oracle.lbs.mapclient.MapViewer" %>
    <html>
    <head>
    <!-- flooble Color Picker header start -->
    <script language="Javascript">
    // Color Picker Script from Flooble.com
    // For more information, visit
    // You may use and distribute this code freely, as long as
    // you keep this copyright notice and the link to flooble.com
    // if you chose to remove them, you must link to the page
    // listed above from every web page where you use the color
    // picker code.
    var perline = 9;
    var divSet = false;
    var curId;
    var colorLevels = Array('0', '3', '6', '9', 'C', 'F');
    var colorArray = Array();
    var ie = false;
    var nocolor = 'none';
         if (document.all) { ie = true; nocolor = ''; }
         function getObj(id) {
              if (ie) { return document.all[id]; }
              else {     return document.getElementById(id);     }
    function addColor(r, g, b) {
         var red = colorLevels[r];
         var green = colorLevels[g];
         var blue = colorLevels;
         addColorValue(red, green, blue);
    function addColorValue(r, g, b) {
         colorArray[colorArray.length] = '#' + r + r + g + g + b + b;
    function setColor(color) {
         var link = getObj(curId);
         var field = getObj(curId + 'field');
         var picker = getObj('colorpicker');
         field.value = color;
         if (color == '') {
              link.style.background = nocolor;
              link.style.color = nocolor;
              color = nocolor;
         } else {
              link.style.background = color;
              link.style.color = color;
         picker.style.display = 'none';
         eval(getObj(curId + 'field').title);
    function setDiv() {    
         if (!document.createElement) { return; }
    var elemDiv = document.createElement('div');
    if (typeof(elemDiv.innerHTML) != 'string') { return; }
    genColors();
    elemDiv.id = 'colorpicker';
         elemDiv.style.position = 'absolute';
    elemDiv.style.display = 'none';
    elemDiv.style.border = '#000000 1px solid';
    elemDiv.style.background = '#FFFFFF';
    elemDiv.innerHTML = '<span style="font-family:Verdana; font-size:11px;">Pick a color: '
         + '(No color)<br>'
         + getColorTable()
         + '</span>';
    document.body.appendChild(elemDiv);
    divSet = true;
    function pickColor(id) {
         if (!divSet) { setDiv(); }
         var picker = getObj('colorpicker');      
              if (id == curId && picker.style.display == 'block') {
                   picker.style.display = 'none';
                   return;
         curId = id;
         var thelink = getObj(id);
         picker.style.top = getAbsoluteOffsetTop(thelink) + 20;
         picker.style.left = getAbsoluteOffsetLeft(thelink);
         picker.style.display = 'block';
    function genColors() {
    addColorValue('0','0','0');
    addColorValue('3','3','3');
    addColorValue('6','6','6');
    addColorValue('8','8','8');
    addColorValue('9','9','9');
    addColorValue('A','A','A');
    addColorValue('C','C','C');
    addColorValue('E','E','E');
    addColorValue('F','F','F');
    for (a = 1; a < colorLevels.length; a++)
                   addColor(0,0,a);
    for (a = 1; a < colorLevels.length - 1; a++)
                   addColor(a,a,5);
    for (a = 1; a < colorLevels.length; a++)
                   addColor(0,a,0);
    for (a = 1; a < colorLevels.length - 1; a++)
                   addColor(a,5,a);
    for (a = 1; a < colorLevels.length; a++)
                   addColor(a,0,0);
    for (a = 1; a < colorLevels.length - 1; a++)
                   addColor(5,a,a);
    for (a = 1; a < colorLevels.length; a++)
                   addColor(a,a,0);
    for (a = 1; a < colorLevels.length - 1; a++)
                   addColor(5,5,a);
    for (a = 1; a < colorLevels.length; a++)
                   addColor(0,a,a);
    for (a = 1; a < colorLevels.length - 1; a++)
                   addColor(a,5,5);
    for (a = 1; a < colorLevels.length; a++)
                   addColor(a,0,a);               
    for (a = 1; a < colorLevels.length - 1; a++)
                   addColor(5,a,5);
         return colorArray;
    function getColorTable() {
    var colors = colorArray;
         var tableCode = '';
    tableCode += '<table border="0" cellspacing="1" cellpadding="1">';
    for (i = 0; i < colors.length; i++) {
    if (i % perline == 0) { tableCode += '<tr>'; }
    tableCode += '<td bgcolor="#000000"><a style="outline: 1px solid #000000; color: '
         + colors[i] + '; background: ' + colors[i] + ';font-size: 10px;" title="'
         + colors[i] + '" href="javascript:setColor(\'' + colors[i] + '\');">   </a></td>';
    if (i % perline == perline - 1) { tableCode += '</tr>'; }
    if (i % perline != 0) { tableCode += '</tr>'; }
    tableCode += '</table>';
         return tableCode;
    function relateColor(id, color) {
         var link = getObj(id);
         if (color == '') {
              link.style.background = nocolor;
              link.style.color = nocolor;
              color = nocolor;
         } else {
              link.style.background = color;
              link.style.color = color;
         eval(getObj(id + 'field').title);
    function getAbsoluteOffsetTop(obj) {
         var top = obj.offsetTop;
         var parent = obj.offsetParent;
         while (parent != document.body) {
              top += parent.offsetTop;
              parent = parent.offsetParent;
         return top;
    function getAbsoluteOffsetLeft(obj) {
         var left = obj.offsetLeft;
         var parent = obj.offsetParent;
         while (parent != document.body) {
              left += parent.offsetLeft;
              parent = parent.offsetParent;
         return left;
    function areaClicked(event, info)
    alert(info);
    </script>
         <!--
    These two DIV objects are required for the Toolbar and Info-Tip
    to work properly. Copy them as-is to your own HTML's head section.
    -->
    <style>
    #tbar_rect
    border : 1px solid red;
    height : 0px;
    left : 0px;
    position : absolute;
    top : 0px;
    visibility : hidden;
    width : 0px;
    #infotip_window
    position: absolute;
    width: 150px;
    border: 1px solid grey;
    padding: 2px;
    background-color: #DFDFDF;
    visibility: hidden;
    z-index: 100;
    </style>
         <!-- flooble Color Picker header end -->
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>
    CEA DIGITAL MAP OF INDIA
    </title>
    </head>
    <body bgcolor="#D8D1C7">
    <span style="width:100%">
         <form name=map action="try.jsp" method="get">
    <table cellpadding="0" cellspacing="0" border="0" width="100%" summary="">
    <tr><td>
    <table cellpadding="0" cellspacing="2" border="0" width="100%" summary="">
    <tr><td valign="top"></td></tr>
    <FONT color="#449922" size="+1"><b>CEA MAP</b></FONT> </td></tr>
    </table>
    </td>
    </tr>
    <tr><td valign="top">
    <table cellpadding="0" cellspacing="0" border="0" summary="">
    <tr><td align="center"><img src="/mapviewer/myicons/t.gif" border="0" /></td></tr>
    </table> </td>
    </tr>
    </table>
    <hr>
    </span>
    <!-------------------------------------------------------------------------
    Process the incoming map request
    -------------------------------------------------------------------------->
    <%
    String v1=request.getParameter("q1");
    // out.print(v1);
         String v = request.getParameter("q");
    String dataSrc = request.getParameter("datasrc-select");
         String[][] CEA = null;
    String mvURL = request.getParameter("mvurl");
    if(mvURL==null || mvURL.length()==0)
    mvURL = "http://"+ request.getServerName()+":"+request.getServerPort()+
    request.getContextPath()+"/omserver";
    // out.print(v);
         boolean newSession = false;
    // retrieve mapviewer client handle from session
    MapViewer mv = (MapViewer) session.getAttribute("gvis_mvhandle");
    if(mv==null)
    // create a new mapviewer client handle
    mv = new MapViewer(mvURL);
    mv.setImageFormat(MapViewer.FORMAT_PNG_URL);
    mv.setMapTitle(" ");
    session.setAttribute("gvis_mvhandle", mv); // keep client handle in session
    newSession = true;
    // enable only user selected themes
    String[] checkedThemes = request.getParameterValues("_mthemev_");
    if(checkedThemes!=null && checkedThemes.length>0)
    mv.enableThemes(checkedThemes);
    String action = request.getParameter("action");
    if(action==null) action = "recenter";
    String[] dataSrcList = null;
    String mapW_ = request.getParameter("map_width"), mapH_=request.getParameter("map_height");
    int mapW = 800, mapH = 500;
    try{
    mapW = Integer.parseInt(mapW_);
    mapH = Integer.parseInt(mapH_);
    }catch(Exception e){}
    mv.setDeviceSize(new Dimension(mapW, mapH));
    String aa_ = request.getParameter("map_aa");
    boolean aa = false;
    if(aa_!=null && "on".equalsIgnoreCase(aa_))
    aa = true;
    mv.setAntiAliasing(aa);
    String query1=null, stroke1="#000000", fill1=null, tr1=null, labelc1=null, asis1,
    query2=null, stroke2="#000000", fill2=null, tr2=null, labelc2=null, asis2,
    query3=null, stroke3="#000000", fill3=null, tr3=null, labelc3=null, asis3,
                   query4=null, stroke4="#000000", fill4=null, tr4=null, labelc4=null, asis4,
                   query5=null, stroke5="#000000", fill5=null, tr5=null, labelc5=null, asis5;
    //<!---------------------------------------- Query1 ------------------------------------------------------>
    //String v1=request.getParameter("v");
    //session.putValue("v1",v);
    query1 = "select geom from ";
              query1+=v;
              //query1+=",";
              // query1+="lineflow where line.fnode_=lineflow.lineid";
              //query1+=;
              //query1+=;
              //query1+=.;
              //query1+=;
              //query1+=;
              //query1+=lineflow.;
              //query1+=".";
              //query1+=lineid;
              // out.print(query1);
              // out.print(query1);
    stroke1 = request.getParameter("stroke_1");
    fill1 = request.getParameter("fill_1");
    if(stroke1==null && fill1==null)
    stroke1 = "green"; //default to black stroke
    fill2 = "green";
    tr1 = request.getParameter("tr_1");
    String l = request.getParameter("lc_1");
              // out.print(l);
              labelc1=l;
    int opacity1 = (tr1!=null && tr1.equals("on"))? 128 : -1;
    String style1 = "gvis_"+("NONE".equals(stroke1)?"" : stroke1) + "_"+
    ("NONE".equals(fill1)?"" : fill1) +
    ((opacity1>0)?"128" : "");
    asis1 = request.getParameter("asis_1");
    //<!---------------------------------------- Query2 ------------------------------------------------------>
    query2 ="select GEOM from ";
              query2+="place";
              //query2+=" where ";
              //query2+="FNODE_='"+s+"'";
              //out.print(query2);
              // query2 = request.getParameter("query_2");
    stroke2 = request.getParameter("stroke_2");
    fill2 = request.getParameter("fill_2");
    if(stroke2==null && fill2==null)
    stroke2 = "#000000";
              fill2 = "red";
    tr2 = request.getParameter("tr_2");
              String c = request.getParameter("lc_2");
              // out.print(c);
              labelc2=c;
    //labelc2 = request.getParameter("lc");
              // out.print(labelc2);
    int opacity2 = (tr2!=null && tr2.equals("on"))? 128 : -1;
    String style2 = "gvis_"+("NONE".equals(stroke2)?"" : stroke2) + "_"+
    ("NONE".equals(fill2)?"" : fill2) +
    ((opacity2>0)?"128" : "");
    asis2 = request.getParameter("asis_2");
    //<!---------------------------------------- Query3 ------------------------------------------------------>
         query3 ="select geom from ";
              query3+="bound";
    //query3 = request.getParameter("query_3");
    stroke3 = request.getParameter("stroke_3");
    fill3 = request.getParameter("fill_3");
    if(stroke3==null && fill3==null)
    stroke3 = "white";
              fill2 = "white";
    tr3 = request.getParameter("tr_3");
    labelc3 = request.getParameter("lc_3");
    int opacity3 = (tr3!=null && tr3.equals("on"))? 128 : -1;
    String style3 = "gvis_"+("NONE".equals(stroke3)?"" : stroke3) + "_"+
    ("NONE".equals(fill3)?"" : fill3) +
    ((opacity3>0)?"128" : "");
    asis3 = request.getParameter("asis_3");
    //<!---------------------------------------- Query4 ------------------------------------------------------>
    String s = request.getParameter("t");
    query4 ="select GEOM from ";
              query4+="Line";
              query4+=" where ";
              query4+="FNODE_='"+s+"'";
         //     out.print(s);
              //out.print(query4);
              // query4 = request.getParameter("query_4");
    stroke4 = request.getParameter("stroke_4");
    fill4 = request.getParameter("fill_4");
    if(stroke4==null && fill4==null)
    stroke4 = "red";
              fill4 = "red";
    tr4 = request.getParameter("tr_4");
    labelc4 = request.getParameter("lc_4");
    int opacity4 = (tr4!=null && tr4.equals("on"))? 128 : -1;
    String style4 = "gvis_"+("NONE".equals(stroke4)?"" : stroke4) + "_"+
    ("NONE".equals(fill4)?"" : fill4) +
    ((opacity4>0)?"128" : "");
    asis4 = request.getParameter("asis_4");
         //<!------------------Query5----------------------------------------------->
         query5 ="select * from ";
              query5+="place";
    //query3 = request.getParameter("query_3");
    stroke5 = request.getParameter("stroke_5");
    fill5 = request.getParameter("fill_5");
    if(stroke5==null && fill5==null)
    stroke5 = "#000000";
              fill5 = "red";
    tr5 = request.getParameter("tr_5");
    labelc5 = request.getParameter("lc_5");
              //out.print(labelc5);
    int opacity5 = (tr5!=null && tr5.equals("on"))? 128 : -1;
    String style5 = "gvis_"+("NONE".equals(stroke5)?"" : stroke5) + "_"+
    ("NONE".equals(fill5)?"" : fill5) +
    ((opacity3>0)?"128" : "");
    asis5 = request.getParameter("asis_5");
    //<!-----------------------------close----------------------------------------->
    dataSrcList = mv.getDataSources();
    // start processing the actual request
    if(!newSession && request.getParameter("userClick.x")!=null) // user clicked on map
    int x = Integer.parseInt(request.getParameter("userClick.x"));
    int y = Integer.parseInt(request.getParameter("userClick.y"));
    if(action.equals("recenter"))
    mv.pan(x,y);
    else if(action.equals("zoomin"))
    mv.zoomIn(x,y, 1.5);
    else if(action.equals("zoomout"))
    mv.zoomOut(x,y, 1.5);
              else if(action.equals("point"))
                   // mv.isClickable("theme1");
                   // mv.addPointFeature(double x,double y,null,style5,"_gvis_style_text",double[] 0);
                   // mv.getUserPoint(x,y);
    //out.println(x);
              //out.println(y);
                   else if(action.equals("id"))
    String[] columns = new String[]{"AREA","CITY","id",
                                                      "a.GEOM.sdo_point.x X",
    "a.GEOM.sdo_point.y Y",
                                                      "ANGLE"
    //out.print(columns)
    //find out the nearest office from where user clicked on the map
    CEA = mv.identify(dataSrc,
    "Place a", //which table
    columns, //which columns to identify
    "GEOM", //which geometry column
    0, //srid of the geometry column
    x,y //mouse click position on screen
    Point2D Loc = null;
    if(CEA!=null)
    String X = CEA[1][10];
    String Y = CEA[1][10];
    Loc = new Point2D.Double(Double.parseDouble(X), Double.parseDouble(Y));
              out.print(Loc);
    //mark where user clicked upon on the map with a PIN marker
    Point2D p2 = mv.getUserPoint(x,y);
    mv.addPointFeature(p2.getX(), p2.getY(), 0,
    "M.CAPTIAL", //a Pin marker style
    null, null, null);
    //add a leader line from where user clicked to the nearest office
    if(CEA!=null)
    mv.addLinearFeature(new double[]{p2.getX(), p2.getY(), Loc.getX(), Loc.getY()},0, "NEAREST_LINE_STY", null, null, false);
    /* For identifying action: use a previously generated map as backdrop
    to avoid re-rendering all the base themes.
    if(mv.getBackgroundImageURL()==null)
    mv.setBackgroundImageURL(mv.getGeneratedMapImageURL());
    String[] enabledThemes = mv.getEnabledThemes();
    mv.setAllThemesEnabled(false); //temporarily disable all themes
    mv.run(); // re-issue map request to draw the pin marker and leader line
    //simply re-enable all themes
    mv.enableThemes(enabledThemes);
    mv.removeAllPointFeatures(); // clean up the PIN marker
    mv.removeAllLinearFeatures(); // clean up the leader line as well
    else if(!newSession) // user submitted new queries
    if(mvURL!=null && mvURL.length()>0 &&
    !mv.getServiceURL().equals(mvURL))
    mv.setServiceURL(mvURL);
    if(dataSrc!=null && dataSrc.length()>0)
    mv.setDataSourceName(dataSrc);
    if(query1!=null && query1.length()>9 && !mv.styleExists(style1))
    mv.addColorStyle(style1, stroke1, fill1, opacity1, opacity1);
    if(query2!=null && query2.length()>9 && !mv.styleExists(style2))
    mv.addColorStyle(style2, stroke2, fill2, opacity2, opacity2);
    if(query3!=null && query3.length()>9 && !mv.styleExists(style3))
    mv.addColorStyle(style3, stroke3, fill3, opacity3, opacity3);
    if(query4!=null && query4.length()>9 && !mv.styleExists(style4))
    mv.addColorStyle(style4, stroke4, fill4, opacity4, opacity4);
    if(query5!=null && query5.length()>9 && !mv.styleExists(style5))
    mv.addColorStyle(style5, stroke5, fill5, opacity5, opacity5);
    //add a temporary text style for labeling
    mv.addTextStyleWithHalo("_gvis_style_text_", "PLAIN", "Serif", "12", "PLAIN", "#0000ff", 2.0);
    //mv.deleteAllThemes();
    if(query1!=null && query1.length()>9)
    String query1_ = query1;
    if(labelc1!=null && labelc1.length()>0)
    int idx1 = query1.toUpperCase().indexOf("FROM");
    int idx2 = query1.toUpperCase().indexOf(labelc1.toUpperCase());
    if(idx2>0 && idx2 < idx1){} // already in the user query
    else
    query1_ = query1.substring(0, idx1) + ", "+labelc1+" "+
    query1.substring(idx1, query1.length());
    } else
    labelc1 = null;
                   mv.addJDBCTheme(dataSrc, "theme1", query1_, null, null,
    style1, labelc1, "_gvis_style_text_", true);
    if(query2!=null && query2.length()>9)
    String query2_ = query2;
    if(labelc2!=null && labelc2.length()>0)
    int idx1 = query2.toUpperCase().indexOf("FROM");
    int idx2 = query2.toUpperCase().indexOf(labelc2.toUpperCase());
    if(idx2>0 && idx2 < idx1){} // already in the user query
    else
    query2_ = query2.substring(0, idx1) + ", "+labelc2+" "+
    query2.substring(idx1, query2.length());
    } else
    labelc2 = null;
    mv.addJDBCTheme(dataSrc, "theme2", query2_, null, null,
    style2, labelc2 , "_gvis_style_text_", true);
    if(query3!=null && query3.length()>9)
    String query3_ = query3;
    if(labelc2!=null && labelc2.length()>0)
    int idx1 = query3.toUpperCase().indexOf("FROM");
    int idx2 = query3.toUpperCase().indexOf(labelc3.toUpperCase());
    if(idx2>0 && idx2 < idx1){} // already in the user query
    else
    query3_ = query3.substring(0, idx1) + ", "+labelc3+" "+
    query3.substring(idx1, query3.length());
    } else
    labelc3 = null;
    mv.addJDBCTheme(dataSrc, "theme3", query3, null, null,
    style3, labelc3, "_gvis_style_text_", true);
    //<!------------------------------- NewTheme------------------------------------------------------------------>
    if(query4!=null && query4.length()>9)
    String query4_ = query4;
    if(labelc4!=null && labelc4.length()>0)
    int idx1 = query4.toUpperCase().indexOf("FROM");
    int idx2 = query4.toUpperCase().indexOf(labelc4.toUpperCase());
    if(idx2>0 && idx2 < idx1){} // already in the user query
    else
    query4_ = query4.substring(0, idx1) + ", "+labelc4+" "+
    query4.substring(idx1, query4.length());
    } else
    labelc4 =null ;
    mv.addJDBCTheme(dataSrc, "theme4", query4, null, null,
    style4, labelc4, "_gvis_style_text_", true);
    if(query5!=null && query5.length()>9)
    String query5_ = query5;
    if(labelc5!=null && labelc5.length()>0)
    int idx1 = query5.toUpperCase().indexOf("FROM");
    int idx2 = query5.toUpperCase().indexOf(labelc5.toUpperCase());
    if(idx2>0 && idx2 < idx1){} // already in the user query
    else
    query5_ = query5.substring(0, idx1) + ", "+labelc5+" "+
    query5.substring(idx1, query5.length());
    } else
    labelc5 =null ;
    mv.addJDBCTheme(dataSrc, "theme5", query5, null, null,
    style5, labelc5, "_gvis_style_text_", true);
    //<!--------------------------close New Theme---------------------------------->
              if(dataSrc!=null)
    try{
    mv.setFullExtent();
    mv.run();
    }catch(Exception e){out.println(e.getMessage()); }
    } //user submitted queries
    String url = mv.getGeneratedMapImageURL();
    %>
    <p><p>
    <!----------------------------------------------------------------------
    Generate the result web page with map image and controls
    ----------------------------------------------------------------------->
    <form action="try.jsp" name="Main" method="get">
    <%
    if(url!=null)
    int w = (int)mv.getDeviceSize().getWidth(), h = (int)mv.getDeviceSize().getHeight();
    %><div align="center">
    <TABLE border="0" width="<%=w%>" cellpadding=0 cellspacing=0 bgcolor="yellow">
    <TR>
    <TD width="<%=w%>" bgcolor="white">
    <input type="image" border color="yellow" bgcolor="white" border="1" SRC="<%=url%>" name="userClick" width="<%=w%>" height="<%=h%>" >
    </TD>
                   </TR>
    <tr>
    <td> Click on the map to:
    <input type="radio" name="action" value="zoomin" <%= action.equals("zoomin")?"checked":""%> ><B><img src="/mapviewer/myicons/zoomin.gif" alt="zoom in"></B>
    <input type="radio" name="action" value="recenter" <%= action.equals("recenter")?"checked":""%> ><B><img src="/mapviewer/myicons/pan.gif" alt="re-center"></B>
    <input type="radio" name="action" value="zoomout" <%= action.equals("zoomout")?"checked":""%> ><B><img src="/mapviewer/myicons/zoomout.gif" alt="zoom out"></B>
                        <input type="radio" name="action" value="point" <%= action.equals("point")?"checked":""%>
                        ><B>Point
                        </B>
                        <input type="radio" name="action" value="id" <%= action.equals("id")?"checked":""%>
                        ><B>Identy
                        </B>
    </td>
    </tr>
    <tr><td height="15"> </td></tr>
    </TABLE>
    <% }
    %>
    <table border="0" cellpadding="2" cellspacing="1">
    <tr> <td>
    <input type="hidden" name="datasrc-select" value="mvd">
         <!--<img src="/mapviewer/myicons/dbconnect.gif"><FONT COLOR="#ff0000"> Datasource: </FONT>
    <SELECT single size="1" name="datasrc-select">
    <%
    if(dataSrcList!=null)
    for (int i = 0; i < dataSrcList.length; i++)
    String selected = (dataSrcList.equals(dataSrc))? "selected " :"";
    %> <OPTION <%=selected%> value="<%=dataSrcList[i]%>"> <%=dataSrcList[i]%> </OPTION>
    <% }
    %>
    </SELECT>-->
                   <input type="hidden" name=q value="<%=v%>">  
                   <input type="hidden" name="lc_1" value="REAL">
                   <input type="hidden" name="lc_4" value="FNODE_">
    <!--map width: <input type="hidden" size="4" name="map_width" value="<%=(int)mv.getDeviceSize().getWidth()%>" >  
    height: <input type="hidden" size="4" name="map_height" value="<%=(int)mv.getDeviceSize().getHeight()%>" >--->
    <INPUT TYPE="checkbox" NAME="map_aa" <%=(mv.getAntiAliasing())?"CHECKED":""%> >AA
    </td>
    <td>ENTER THE LINE ID:
         <Input type="text" name="t"></td>
    <td> <INPUT type=submit value=loadMap> </td>
    </tr>
    </tr>
    <tr bgcolor="#ffffcc">
    <td>Line:
    <a href="javascript:pickColor('pick1097113087'); id="pick1097113087"
    style="border: 1px solid #000000; font-family:Verdana; font-size:10px;
    text-decoration: none;">   </a>
    <input id="pick1097113087field" size="7"
    type="hidden" title="color" name="stroke_1" value="<%=stroke1%>">
    <script language="javascript">relateColor('pick1097113087', getObj('pick1097113087field').value);</script>
    </td>
    <td>Fill:
    <a href="javascript:pickColor('pick1097113085'); id="pick1097113085"
    style="border: 1px solid #000000; font-family:Verdana; font-size:10px;
    text-decoration: none;">   </a>
    <input id="pick1097113085field" size="7"
    type="hidden" title="color" name="fill_1" value="<%=fill1%>">
    <script language="javascript">relateColor('pick1097113085', getObj('pick1097113085field').value);</script>
    </td>
    </tr>
         <tr >
    <td >
    </td>
    </tr>
         <tr><td><input type="hidden" name="lc_5" value=CITY></td>
    </table></div>
    </form>
         <% // display identified feature attributes if present
    if(CEA!=null && CEA.length>0)
    out.print(" <TABLE border=\"1\">\n");
    for(int i=0; i<CEA.length; i++)
    if(i==0) out.print("<TR BGCOLOR=\"#FFFF00\">");
    else out.print("<TR>\n");
    String[] row = CEA[i];
    for(int k=0; k<row.length; k++)
    out.print("<TD>"+row[k]+"</TD>");
    out.print("</TR>\n");
    out.print("</TABLE>");
    %>
    </form>
    <p>
    <P>
    <HR size="1">
    <P>
    </body>
    </html>

  • GetLiveFeatureAttrs() in MapViewer returns data for wrong coordinates

    Hi forum
    I am trying to build a small Java application to fetch and display data from MapViewer. I have a set of predefined themes and want to add a query theme, from which I can fetch further information through live features. From reading the docs, to my best understanding, the procedure to do so is this:
    1. Define a query theme with attributes and make it "clickable", and use the "raw" image format. GEOLOC is the sdo_geometry column, the rest are for the live features.
      String sqlQuery = "SELECT gravstedsnavn, nummer, areal, geoloc FROM gravsteder3 s where s.dblink in (" + retline + ")";
      mv.addJDBCTheme("bssys", "QUERY_DATA",  sqlQuery, "geoloc", "8307", null, null, null, true);
      String[] boundingThemes = { "QUERY_DATA" };
      mv.setClickable(true, "QUERY_DATA");
      mv.setImageFormat(MapViewer.FORMAT_RAW_COMPRESSED);
      mv.setBoundingThemes(boundingThemes, 0.05, true);2. I use a JPanel to render the map image, for which I want a tooltip to show the live feature given the mouse coordinate, when the mouse moves around the JPanel (mapDisplay being the JPanel):
    private void mapDisplay_mouseMoved(MouseEvent e) {
      Insets is = ((JPanel)e.getComponent()).getInsets();
      int x = e.getX() - is.left, y = e.getY() - is.top;
      mapImage = mi.getMapUrl("5", x, y, mapURL);
    }getMapUrl does the following to display the live features in a tooltiptext on the JPanel:
        String[][] test = null;
        try  {
          test = mv.getLiveFeatureAttrs(x,y,0);
        } catch (NullPointerException ex)  {
          System.out.println("No information available");
        if ((test.length == 0) || (test == null)) {
          jp.setToolTipText(null);
        } else {
          String gravstedsnavn = "";
          String gravstedsnr = "";
          String areal = "";
          if (test != null) {
            for (int i = 0; i < test.length; i++) {
              for (int j = 0; j < test.length; j++) {
    if (j == 0) {
    gravstedsnavn = test[i][j];
    if (j == 1) {
    gravstedsnr = test[i][j];
    if (j == 2) {
    areal = test[i][j];
    jp.setToolTipText("<html>Gravstedsnavn: " + gravstedsnavn + "<br>Nummer: " + gravstedsnr + "<br>Areal: " + areal +"</html>");
    This code works - the only problem is, that the attributes returned from the getLiveFeatureAttrs() function returns values from a completely different coordinate from the map than expected. I believe, that its my mouseMoved event, which causes the problem - but I havent figured out the way to pass the right mouse coordinates to getLiveFeatureAttrs().
    Does someone have a working live features example, and can anyone eventually see, what the problem with my code is?
    Thanks in advance.

    Hello Joao
    I have setup a public MapViewer server and modified your code slightly, so it can run against my server. The code should return a single rectangular polygon, and if you try moving your mouse around in the JFrame, the live features are available where they shouldn't be, ie outside the marked rectangle, so something is still not working right... Could you do me the favor to try to compile and run this code? My testsite testbooking.brandsoft.dk should be publicly viewable. Could it have something to do with the value of the SRID?
    package oracle.forms.fbean;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.Insets;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseMotionListener;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    import oracle.lbs.mapclient.MapViewer;
    public class livefeature extends JFrame
      static Image img = null;  //global image buffer
      static Insets is = null;  //insets inside a frame.
      final static int mapWidth = 640;
      final static int mapHeight = 480;
      MapViewer mv = null;
      private class myMouseListener implements MouseMotionListener
        public void mouseDragged(MouseEvent e) {
          public void mouseMoved(MouseEvent e) {
                int x = e.getX() - is.left;
                int y = e.getY() - is.top;
               String[][] test = mv.getLiveFeatureAttrs(x,y,0);
               if ((test.length == 0) || (test == null)) {
                 System.out.println("No livefeatures found");
               } else {
                 String gravstedsnavn = "";
                 String gravstedsnr = "";
                 String areal = "";
                 if (test != null) {
                   for (int i = 0; i < test.length; i++) {
                     for (int j = 0; j < test.length; j++) {
    if (j == 0) {
    gravstedsnavn = test[i][j];
    if (j == 1) {
    gravstedsnr = test[i][j];
    if (j == 2) {
    areal = test[i][j];
    System.out.println("<html>Gravstedsnavn: " + gravstedsnavn + "<br>Nummer: " + gravstedsnr + "<br>Areal: " + areal +"</html>");
    public livefeature()
    setTitle("MapViewer: Live Feature");
    setVisible(true);
    is = getInsets();
    System.out.println("Insets: " + is);
    setSize(mapWidth+is.left+is.right, mapHeight+is.top+is.bottom);
    this.addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(WindowEvent e) { System.exit(0); }
    this.addMouseMotionListener(new myMouseListener());
    public void paint(Graphics g)
    if(img==null)
    drawGeometries(g);
    //draws the image to the screen
    if(img!=null)
    g.drawImage(img, is.left, is.top,
    img.getWidth(null), img.getHeight(null), null);
    public void drawGeometries(Graphics g)
    mv = new MapViewer("http://testbooking.brandsoft.dk/mapviewer/omserver");
    mv.setDeviceSize(new Dimension(mapWidth,mapHeight));
    mv.setAntiAliasing(true);
    mv.setDataSourceName("bssys");
    String sqlQuery = "SELECT s.gravgaardsnavn, s.gravnr, s.areal, s.geoloc FROM gravsteder3 s where s.dblink in (30200020)";
    mv.addJDBCTheme("bssys", "QUERY_DATA", sqlQuery, "geoloc", "0", "BSSYS:ROED_MARKERING", null, "BSSYS:SORT_TEKST", true);
    String[] boundingThemes = { "QUERY_DATA" };
    mv.addJDBCTheme("bssys", "QUERY_DATA_1", sqlQuery, "geoloc", "0", "BSSYS:ROED_MARKERING", null, "BSSYS:SORT_TEKST", true);
    mv.setClickable(true, "QUERY_DATA_1");
    mv.setImageFormat(MapViewer.FORMAT_RAW_COMPRESSED);
    mv.setBoundingThemes(boundingThemes, 0.05, true);
    try
    mv.run();
    img = mv.getGeneratedMapImage();
    repaint();
    } catch(Exception e)
    System.out.println("Error while rendering theme.");
    e.printStackTrace();
    public static void main(String[] args)
    new livefeature();

  • Polygons in MapViewer using JavaAPI

    How do I display polygons in MapViewer using the JavaAPI?

    Hi Randy,
    assuming you have a table with a geometry column and valid polygons:
    1) the table must be registered on user_sdo_geom_metadata
    2) a spatial index must be created on the geometry column
    3) with MapViewer API you can add a dynamic theme using the addJDBCTheme method, and then call the method run to generate your map image.
    Take a look on MapViewer documentation for more information and examples.
    Joao

  • MapViewer Dynamic Theme help

    I am using MapViewer 10g to create a JSP map, using JSP Tags as in the TagMap example. All works well, however, in building the page in question, beside creating and printing the map, I also use a within_distance query to print out a list of values. Now, on the map, I would like to be able to draw or add a dynamic theme which would be a semi-transparent raster circle, with a varying radius (dependent on the within_distance size) at the center of the map (X,Y). Any help would be greatly appreciated.

    there is a bug in the addJDBCTheme tag where the asis attribute is ignored; normally if you set asis="true" then it should work (no spatial filter will be applied to your dynamic theme since it has no spatial index anyway). But somehow the asis attribute is ignored by the taglib.
    The work around is to use the client api itself, as show below:
    <%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ordim/mvtaglib.tld" prefix="mapviewer"%>
    <P>Testing a point</P>
    <P>
    <mapviewer:init datasource="mvdemo"
    url="http://localhost:8888/mapviewer/omserver"
    id="mvhandle" />
    <mapviewer:importBaseMap name="demo_map" />
    <%
    mvhandle.addJDBCTheme("mvdemo", "centerPoint",
    "SELECT mdsys.sdo_geometry(2001, null, mdsys.sdo_point_type(-83, 39, null), null, null) geom FROM dual",
    "geom", null, "M.CIRCLE", null, null, true); %>
    <mapviewer:setParam centerX="-83" centerY="39" size="2" />
    <mapviewer:run />
    showing the map: <p>
    <img src = "<mapviewer:getMapURL />" align=left />
    </P>

  • Bounding Theme With Mapviewer Bean

    Hello
    I using the MapViewer Bean to render a map in Oracle Forms. I can successfully show the map and use addJDBCTheme to add a dynamic theme. I am now trying to zoom in/out on the map so the image returned shows all items in the dynamic theme. Does anyone no how to do this using the bean?
    TIS Chris

    Hi Joao
    Thanks for the reply.
    Although I have read about this procedure in some MapViewer documentation I am unable to get to it through the MapViewer java class - I am writing a bean that utilises this class and this method does not appear to to be in this class. Do you know of any other way a can access it?
    Thanks
    Chris

  • MapViewer problem with addWMSMapTheme

    I have 2 problems using this Java API function:
    - parameter isBackgroundTheme does not seem to be used
    WMS themes are always rendered before other JDBC themes added with addJDBCTheme. In other words, WMS themes are always below other themes.
    - parameter transparent doesn't function
    Value "true" does not generate a transparent WMS layer.
    This is my call:
    mv.addWMSMapTheme(strThemeName, "http://devcgpc12:8889/mapviewer/wms", "false", "1.1.1", strLayerNames, "SDO:90112", "image/png", "true", "0xffffff", "application/vnd.ogc.se_inimage", vsp);

    When I change to format to ïmage/png8" it works. The generated png of the WMS theme is transparent in that case.
    But the MapViewer documentation says:
    D.2.1.15 TRANSPARENT Parameter
    TRANSPARENT=TRUE (for a transparent image) is supported for PNG images, that is,
    with FORMAT=image/png, or FORMAT=image/png8 for indexed (8-bit) PNG format.
    MapViewer does not support transparent GIF (GIF89) images.

  • Thematics with mapviewer java api

    I'm looking for a way to dynamically set the upper and lower bounds for an advanced equal color scheme style. This style will be applied to an addJDBCTheme with a sql statement defined based on user input. Any ideas? Thanks!

    You can find documentation at:
    http://otn.oracle.com/products/mapviewer/index.html
    and
    http://otn.oracle.com/software/products/mapviewer/index.html
    On the second you will find the lastest version, with the Oracle Application Server MapViewer 9.0.4 Preview Version (Users guide).
    Remember that to create the advanced style, you have to issue a XML request. You can do this on MapViewer page after your instalation. After that you can use the API to add a JDBC theme with this style.

  • Is possible to represent data from a view in MapViewer?

    I have tried to represent data from a view instead a table with the Java-Beans API but I couldn't beacause it doesn't represent any geometry referenced by the view. I think it should be implemented because is very common to use views. Are there any way to represent them in MapViewer?
    Thanks.

    Like a table, you also need to register the view in spatial metadata (user_sdo_geom_metadata). Did you register the view and its spatial column there?

Maybe you are looking for

  • My power just went out for a few seconds- is there any way to restore the document I was working on?

    My power just went out for a few seconds. Is there any way to restore my document? I had already had 2 hrs worth of work for an interview tomorrow and do not have time to start from scratch?

  • Pacman 3 in 32-bit chroot = no go

    Trying to use pacman 3 under my 32-bit chroot doesn't work at all, the problem is pretty obvious since it complains about no free space. Which isn't so weird after all, mount shows _no_ mount points at all, no wonder pacman can't decide if there is a

  • Final Toughts on Lightroom

    While many people are apparently dedicated devotees of Lightroom, I've decided it is not for me. My primary issue is the inability of the program to make adjustments to more than one or two pics using the adjustment brush, graduated filter, etc. ACR

  • Error popup on startup

    I upgraded to FF6 in the last 2 or 3 weeks. Within the last week when I start FF I get the popup: "load: TypeError: Components.classes['@checkpoint.com/XPCOMTrustCheckerMozilla/TrustCheckerMozilla;1'] is undefined" When I close the popup erything con

  • Can not filter by Aperture Metadata (e.g., Landscape / Portrait Orientation)

    On Aperture 3.1.3 (OS X 10.6.8) I've lost the ability to filter images in the browser using Aperture metadata.  Specifically, I used to be able to filter images by Aperture Orientation metadata that includes "Portrait" or "Landscape".  The filters do