This discussion is archived
4 Replies Latest reply: Aug 16, 2013 6:40 AM by jsharma RSS

elocation map not displaying

DannyC. Newbie
Currently Being Moderated

Hi,

 

I am using map viewer 11_1_1_7_1_B130516

 

I added a elocation background map with the map viewer admin console leaving all the default values.  (Did the same for google, bing and nokia.  Added some keys when necessary).

 

Here is how I set the mapviewer in my code

 

I got a combo box with all the available background maps and upon value changed here is what I do.

 

// If we already have a viewer set up then destroy the map and start all over again.  This occurs upon changing the background map selection.

if (this.mapControl) {

  this.mapControl.destroyMap();

  this.mapControl = null;

  $('map').replaceWith('<div id="map" class="viewer map-overrides"></div>');

}

var tileLayer;

this.mapElement = document.getElementById('map');

this.mapControl = new OM.Map(this.mapElement, {

  mapViewerURL: $settings.mapViewerUrl.get(),

  universe: new OM.universe.Universe({

    srid: 3785,

    bounds: new OM.geometry.Rectangle(-16000000, 1500000, -5300000, 9800000, 3785),

    numberOfZoomLevels: 19

  })

});

tileLayer = new OM.layer.TileLayer(this.currentBackgroundLayer.Name, {    // currentBackgroundLayer is my elocation background map.

  dataSource: this.currentBackgroundLayer.Schema,

  tileLayer: this.currentBackgroundLayer.Name

});

this.mapControl.addLayer(tileLayer);

this.mapControl.init();

 

What's happening is weird, I see the loading icon in the middle of the map viewer but it never disappear.  Its working for all other background maps (Google, Bing, Nokia).

If I add the tileLayer after the init() (not sure its a good thing to do) then, I am able to see the elocation map but only by zooming in or out.  And again this works fine with all other background maps (Google, Bing, Nokia).

 

I also have a problem with the mapControl.hideOverviewMap() function.  In the first scenario, no mather where I use it (before or after init), when I zoom or pan I got these two errors in the console:  "Cannot call method 'setMapCenterAndZoomLevel' of null" and "Cannot call method 'getMapWindowBoundingBox' of null"

 

If I add the tileLayer after the init() and then call mapControl.hideOverviewMap() function.  Everything seems to work fine.

 

Thanks in advance for any help!

  • 1. Re: elocation map not displaying
    jsharma Pro
    Currently Being Moderated

    I'm assuming you've downloaded and setup the quickstart kit with the mvdemo sample app and content, specially the storm sample data set.

    i.e. http://download.oracle.com/otn/other/mapviewer/11g_ps6_1/mapviewer_11p6_1_qs.zip

    http://download.oracle.com/otn/other/mapviewer/11g_ps6/mvdemo_naturalearth.zip

    and

    http://download.oracle.com/otn/other/mapviewer/11g_ps6/mvdemo_stormdata.zip

    The demos and tutorials have some examples of using various tile layers.

    Some notes on those examples that hopefully are relevant to your use case:

    1) When using a known background tile layer (like bing, nokia, or one defined using the mapviewer admin console and whose definition is stored in the user_sdo_cached_maps for a data source) you do not need a Universe definition. It's already defined in the tile layer. So the

    universe: new OM.universe.Universe({

        srid: 3785,

        bounds: new OM.geometry.Rectangle(-16000000, 1500000, -5300000, 9800000, 3785),

        numberOfZoomLevels: 19

      })

    part is unnecessary.

    2) The Storm demo has an example of switching background tile layers based on a user selection from a drop-down list. It's similar to your approach but uses the built-in functions for the elocation nokia and bing tile layers instead of ones defined in the database via the admin console.

     

    The overview map issue is likely that the doc/examples on the usage may be buggy (incorrect). I'll check on that and respond tomorrow.

  • 2. Re: elocation map not displaying
    DannyC. Newbie
    Currently Being Moderated

    Yes I have downloaded those package and used these quite a lot.

     

    1) What if I want the oracle map to be reprojected in the 3857 SRID. (Sorry, I was doing some test with the deprecated 3785 SRID)

    2) The problem is that we cannot (well we don't want to) use the built-in functions because the customer want to be able to configure these background maps.  I already tried the built in functions they worked well, this probably means that I am not doing something wrong.  Is it possible to get a confirmation wether or not using the maps (nokia, bing, google) added by the mapviewer admin console is working properly?  If not then we might have to add some configuration to our app so the customer can enter its keys to those maps.  If yes, I will have to dig deeper to see what am I doing wrong.

     

    Thanks for your quick answer.

  • 3. Re: elocation map not displaying
    DannyC. Newbie
    Currently Being Moderated

    Sorry I made a mistake when writing the last post.  I meant wether or not using the map (elocation) added by the mapviewer admin console is working properly because the others do work properly.

  • 4. Re: elocation map not displaying
    jsharma Pro
    Currently Being Moderated

    The map tiles aren't and won't be reprojected.

    You don't need the Universe definition for either option (database based or API based).

    Admin console (database) based definition of elocation works fine. Test it in the view map tiles tab of the admin console.

     

    Anyway in your case omit the Universe definition and the app should work fine.

     

    If you're using 3857 you need a db 11.2.0.3 or later. And update the srid definition in the tile layer config for the bing/nokia/google map to be 3857 instead of 3785.

     

    If you're using 3785 and your themes (spatial data displayed on the background map such as customer locations) are in a different SRID (e.g. 4326 or 8307) then you need the tfm_chain to ensure the spherical definition is assumed and the datum shift is ignored.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points