5 Replies Latest reply on Feb 5, 2014 9:37 AM by drmageza1111

    Mapviewer html5 unable to initialize

    drmageza1111

      Hi

       

      I'm trying to initialize a map using OM.Map , but i get a javascript error:

       

       

      TypeError: OM.$.i18n is undefined

       

      ...d=false;OM.Messages.timeoutCount=0;OM.$.i18n.map.MAPVIEWER_9001="Map tile layer ...

      Oracle mapviewer installed in a different server

       

      Thanks in advance

        • 1. Re: Mapviewer html5 unable to initialize
          User268653

          hi

          can you post your code here to see how i can help.

           

          Thanks

          1 person found this helpful
          • 2. Re: Mapviewer html5 unable to initialize
            drmageza1111

            <script type="text/JavaScript"  src="[SERVER-URL]/mapviewer/jslib/v2/oraclemapsv2_core.js"></script>

             

            <script type="text/javascript">

                       

                        var mapview = null;

                        var serverURL = "/mapviewer";

                        OM.gv.proxyEnabled =false;   // no mvproxy needed

                        OM.gv.setResourcePath(serverURL + "/jslib/v2/images/");

                       

                        function initialize() {               

                            mapview  = new OM.Map(document.getElementById('map'),

                            {

                                mapviewerURL : baseURL,

                                disableOverviewMap: false

                            });

                           

                           

                             // Add a map tile layer as background.

                           

                              mapview.init();     //initialize

                        }

                       

                       

            </script>

             

            <body onload="javascript:initialize();">

                    <div id="map" style="width: 800px; height: 600px;border: 1px solid #999;"></div>

            </body>

            • 3. Re: Mapviewer html5 unable to initialize
              User268653

              hi

               

              1) try to replace oraclemapsv2_core.js with this one : oraclemapsv2.js .

              2) try to replace var serverURL = "/mapviewer" with this one var serverURL = : [SERVER-URL]/mapviewer.

              3) try to replace mapviewerURL : baseURL with this one : serverURL from previous point.

               

               

              thanks

              maher

              • 4. Re: Mapviewer html5 unable to initialize
                drmageza1111

                Hi Thanks for your response

                I tried replacing the oraclemapsv2_core.js with oraclemapsv2.js

                and also 2 & 3

                 

                but then i get the following :

                 

                 

                 

                [WARNING]  Source: Cannot load message files from  [SERVER-URL]/mapviewer/jslib/v2/images/messages/

                 

                "NetworkError: 404 Not Found - [SERVER-URL]/mapviewer/jslib/v2/images/css/decoration.css"

                 

                decoration.css

                 

                "NetworkError: 404 Not Found - [SERVER-URL]/mapviewer/jslib/v2/images/css/info.css"

                 

                info.css

                 

                "NetworkError: 404 Not Found - [SERVER-URL]/mapviewer/jslib/v2/images/images/o_loading.gif"

                 

                o_loading.gif

                 

                "NetworkError: 404 Not Found - [SERVER-URL]/mapviewer/jslib/v2/images/css/info.css"

                 

                info.css

                 

                "NetworkError: 404 Not Found - [SERVER-URL]/mapviewer/jslib/v2/images/css/decoration.css"

                 

                decoration.css

                "NetworkError: 404 Not Found - [SERVER-URL]/mapviewer/jslib/v2/images/images/overviewicon.gif"


                "NetworkError: 404 Not Found - [SERVER-URL]/mapviewer/jslib/v2/images/images/o_loading.gif"

                • 5. Re: Mapviewer html5 unable to initialize
                  drmageza1111

                  Hi everyone

                   

                  Thanks very much for your help

                  I finally figured out what was wrong:

                            -it was looking for those css files in the wrong directory (images directory) which was set as:

                               OM.gv.setResourcePath (baseURL + "/jslib/v2/images");

                  instead of:

                                OM.gv.setResourcePath (baseURL + "/jslib/v2");

                  But this only works if i included the oraclemapsv2.js js file