2 Replies Latest reply: Sep 3, 2014 4:57 AM by 1016577 RSS

    Predefined VectorLayer not returning data

    1016577

      Hi everyone,

       

      I am completely stumped. I am attempting to render a predefined theme using the Oracle Maps HTML5 API and it is simply not showing up as it is not returning any data. I have a table defined as such which outlines the boundaries for a shop blueprint:

       

      STORE_FLOOR_DATA

      --------------------------------------------

      STOREID NUMBER,

      FLOOR NUMBER,

      FEATURE VARCHAR2(50 BYTE),

      GEOM SDO_GEOMETRY

       

      Sample Data (note that I am using a 0 - 1.0 X/Y coordinate system, 0,0 being the bottom left of the blueprint and 1,1 being the top right. I am using -1 as a SRID:

       

      STOREID      FLOOR      FEATURE      GEOM

      1                  1                TILL 5            SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1,1003,3), SDO_ORDINATE_ARRAY(0.25,0.25,0.5,0.5) )

       

      I have added an entry into USER_SDO_GEOM_METADATA and created a spatial index on GEOM.

       

      I have set up my data source in MapViewer and set the config as so:

       

         <map_data_source name="nosql"

                         jdbc_host="localhost"

                         jdbc_sid="orcl"

                         jdbc_port="1521"

                         jdbc_user="nosqluser"

                         jdbc_password="ZoXpqdRt1hfmn/fISARJxgX2DXOQDn6r"

                         jdbc_mode="thin"

                         number_of_mappers="3"

                         allow_jdbc_theme_based_foi="true"

                         editable="false"

         />

       

      <mds_config>

       

       

      <data_source name="nosql">

        <allow_predefined_themes>true</allow_predefined_themes>

        <allow_dynamic_themes>true</allow_dynamic_themes>

        <allow>

          <theme>STORE_FLOOR_THEME</theme>

        </allow>

      </data_source>

       

       

      <data_source name="nosql">

        <allow_predefined_themes>true</allow_predefined_themes>

        <allow_dynamic_themes>true</allow_dynamic_themes>

      </data_source>

       

       

      </mds_config>  

       

      I have then used mapbuilder to create the STORE_FLOOR_THEME theme, using the below XML:

       

      <?xml version="1.0" standalone="yes"?>

      <styling_rules>

          <hidden_info>

              <field column="STOREID" name="STOREID"/>

              <field column="FLOOR" name="FLOOR"/>

              <field column="FEATURE" name="FEATURE"/>

        </hidden_info>

          <rule>

              <features style="L.STORE_LINE"> </features>

        </rule>

      </styling_rules>

       

      The geometry column is, of course, the GEOM column.

       

      When previewing the theme in mapbuilder, it looks fine, all the rectangles are drawn as expected.

       

      I have written a narrative view, and within that I have used the below bit of code to add the theme to the current map:

       

      var storeplan = new OM.layer.VectorLayer("storeplan",

              {

                  def:

                      {

                      type: OM.layer.VectorLayer.TYPE_PREDEFINED,

                      dataSource: "nosql",

                      theme:"store_floor_theme",

                      URL: baseURL,

                      loadOnDemand: false

                      }

              });

        map1.addLayer(storeplan);

       

      In the analysis criteria I have dragged over the STOREID, FLOOR and FEATURE columns.

       

      My problem is that the theme is not rendered in the view. When I look at firebug at the mapviewer request, I notice the following:

       

      {"type":"FeatureCollection",

      "collectionName":"store_floor_theme",

      "srs":-1,

      "geodetic":false,

      "attr_names":[],

      "attr_types":[],

      "features":[

      ]}

       

      Notice how no data is retrieved in the theme (attr_names, attr_types and features are all empty)? This is why it's not rendering I imagine. I have no filters enabled, and if I add a table view I can see all the rows being returned as expected. For some reason, the theme itself thinks there is no geometry data to draw.

       

      Can anyone explain to me why this is happening? I would be very grateful.

       

      Kind regards,

       

      Richard