1 Reply Latest reply: Aug 20, 2014 6:16 AM by 1016577 RSS

    Simple HTML5 Attempt - "OM is not defined"


      Hi all,


      I'm attempting an HTML5 visualisation, just a very simple plotting of points against a map. I looked at the SampleApp v406 examples and wanted to try doing it on a different VM (BigDataLite). My code in the Static Text section looks like the below. I have cut out quite a bit of it for practical reasons. Just to clarify, I have remembered to define all of the variables used, such as baseURL etc:


      <script src="/mapviewer/jslib/v2/jquery/jquery-1.7.2.js"></script>

      <script src='/mapviewer/jslib/v2/oraclemapsv2.js'></script>

      <script src="/mapviewer/js/common.js"></script>

      <script src="/mapviewer/jslib/v2/jquery/colorpicker/js/colorpicker.js"></script>

      <script src="/mapviewer/jslib/v2/jquery/colorpicker/js/eye.js"></script>

      <script src="/mapviewer/jslib/v2/jquery/colorpicker/js/layout.js"></script>

      <script src="/mapviewer/jslib/v2/jquery/colorpicker/js/utils.js"></script>

      <link rel='stylesheet' type='text/css' href='/mapviewer/jslib/v2/jquery/v2/jquery/colorpicker/css/colorpicker.css'/>



      var map;



      function plotPoints(data) {

        map = new OM.Map(document.getElementById('map'), {mapviewerURL: baseURL});

        // More code to plot the points



      function renderHeatMap(repData) {

           // Code to call various functions including plotPoints




      <table border=0>

      <tr><td valign=top>

      <b>Shopper Positions</b>

      <DIV id=map style="width:800px;height=500px;padding:10px;border:1px solid grey;" ></DIV>

      </td><td valign=top>


      The issue I'm having is when I view the code in Firebug, it returns an error saying that "OM is not defined". I can only guess this means that I haven't imported something, or the js imports I've done are different versions to the ones used in SampleApp v406. I can't find any information on how to do a simple visualisation in HTML5 from scratch, it's always building from the SampleApp v406 content, so I don't really know what I need to import anyway, I just lifted it from the SampleApp.


      Anyone know why OM is not defined?

        • 1. Re: Simple HTML5 Attempt - "OM is not defined"

          Hi everyone,


          I managed to solve the issue. It turns out that the Oracle Maps API won't work properly if you're trying to test it within an analysis. By embedding it into a dashboard and viewing the dashboard, it suddenly worked. It must be something to do with the way the API is integrated. I can confirm this by attempting to open the Sample App v406 HTML5 examples (which we know work) as independent analyses and it produces the same error.