1 Reply Latest reply: Mar 21, 2013 10:18 AM by jsharma RSS

    Mapviewer multi basemap problem with Bing Layer

    user604047
      We would like to open Bing Layer tile layer over our oracle mapviewer basemap. We are getting following error.
      [MVMapView.addMapTileLayer] MAPVIEWER-05528: Map tile layers have different zoom level definitions. Only the map tile layer added later will be added to the map.
      Our basemap tile layer level definitions are as same as Bing Map. Here is the code which we are using.

      var mainMapDiv = document.getElementById('mainMap');
      this.mainMapObject = new MVMapView(mainMapDiv,__oracleMapsUrlbase);
      var basemap1 = new MVMapTileLayer(__oracleMapsBasemap);
      var basemap2 = new MVBingTileLayerV7();
      basemap2.setKey(ourBingKey) ;
      basemap2.setMapType(MVBingTileLayer.TYPE_AERIAL) ;
      this.mainMapObject.addMapTileLayer(basemap2);
      this.mainMapObject.addMapTileLayer(basemap1);
      basemap1.setVisible (true);
      basemap2.setVisible (true);
      this.mainMapObject.setCenterAndZoomLevel(MVSdoGeometry.createPoint(35.24, 38.95, 8307), 1);
      this.mainMapObject.display();

      I can use them separately, but we get error when we try to add them together. I can prıovide you more information if you like.

      Regards,
        • 1. Re: Mapviewer multi basemap problem with Bing Layer
          jsharma
          The tile layer definitions must match exactly.
          i.e. same SRID (3785 in this case), same number of levels (19 with mapviewer 11.1.1.5) and same tile width/height.
          Also the database (where basemap1 is defined) must have an entry for 3785 and a transformation rule between 3785 and 8307 which ignores the ellipsoid/datum shift.
          (See section 8.7 of the 11.1.1.5 mapviewer user guide and the script csdefinition.sql in the WEB-INF/admin directory).

          The compatible tile layer def in the db and in your javascript code (specific to 11.1.1.5 version of oraclemaps.js) will be:
          in the db

          <map_tile_layer name="MY_BINGMAP" image_format="PNG" http_header_expires="168.0" concurrent_fetching_threads="3">
          <internal_map_source data_source="MY_DATASOURCE" base_map="MY_BINGMAP" bgcolor="#a6caf0"/>
          <tile_storage root_path="c:/mapviewer11_ps4/oc4j/j2ee/home/applications/mapviewer/web/tilecache\MY_DATASOURCE.MY_BINGMAP\"/>
          <coordinate_system srid="3785" minX="-2.0037508E7" minY="-2.0037508E7" maxX="2.0037508E7" maxY="2.0037508E7"/>
          <tile_image width="256" height="256"/>
          <zoom_levels levels="19" min_scale="0.0" max_scale="0.0" min_tile_width="76.43702697753906" min_tile_height="2.0037508E7">
          <zoom_level level="0" name="" description="" scale="0.0" tile_width="2.0037508E7" tile_height="2.0037508E7"/>
          <zoom_level level="1" name="" description="" scale="0.0" tile_width="1.0018754E7" tile_height="1.0018754E7"/>
          <zoom_level level="2" name="" description="" scale="0.0" tile_width="5009377.0" tile_height="5009377.0"/>
          <zoom_level level="3" name="" description="" scale="0.0" tile_width="2504688.5" tile_height="2504688.5"/>
          <zoom_level level="4" name="" description="" scale="0.0" tile_width="1252344.25" tile_height="1252344.25"/>
          <zoom_level level="5" name="" description="" scale="0.0" tile_width="626172.125" tile_height="626172.125"/>
          <zoom_level level="6" name="" description="" scale="0.0" tile_width="313086.0625" tile_height="313086.0625"/>
          <zoom_level level="7" name="" description="" scale="0.0" tile_width="156543.03125" tile_height="156543.03125"/>
          <zoom_level level="8" name="" description="" scale="0.0" tile_width="78271.515625" tile_height="78271.515625"/>
          <zoom_level level="9" name="" description="" scale="0.0" tile_width="39135.7578125" tile_height="39135.7578125"/>
          <zoom_level level="10" name="" description="" scale="0.0" tile_width="19567.87890625" tile_height="19567.87890625"/>
          <zoom_level level="11" name="" description="" scale="0.0" tile_width="9783.939453125" tile_height="9783.939453125"/>
          <zoom_level level="12" name="" description="" scale="0.0" tile_width="4891.9697265625" tile_height="4891.9697265625"/>
          <zoom_level level="13" name="" description="" scale="0.0" tile_width="2445.98486328125" tile_height="2445.98486328125"/>
          <zoom_level level="14" name="" description="" scale="0.0" tile_width="1222.992431640625" tile_height="1222.992431640625"/>
          <zoom_level level="15" name="" description="" scale="0.0" tile_width="611.4962158203125" tile_height="611.4962158203125"/>
          <zoom_level level="16" name="" description="" scale="0.0" tile_width="305.74810791015625" tile_height="305.74810791015625"/>
          <zoom_level level="17" name="" description="" scale="0.0" tile_width="152.87405395507812" tile_height="152.87405395507812"/>
          <zoom_level level="18" name="" description="" scale="0.0" tile_width="76.43702697753906" tile_height="76.43702697753906"/>
          </zoom_levels>
          </map_tile_layer>

          and mapperConfig in js:

          {
          "mapTileLayer":"MY_BINGMAP",
          "format":"PNG",
          "coordSys":
          {
          "srid":3785,
          "type":"PROJECTED",
          "distConvFactor":1.0,
          "minX":-2.0037508E7,"minY":-2.0037508E7,
          "maxX":2.0037508E7,"maxY":2.0037508E7
          },
          "zoomLevels":
          [
          {"zoomLevel":0,"name":"","tileWidth":2.0037508E7,"tileHeight":2.0037508E7,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":1,"name":"","tileWidth":1.0018754E7,"tileHeight":1.0018754E7,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":2,"name":"","tileWidth":5009377.0,"tileHeight":5009377.0,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":3,"name":"","tileWidth":2504688.5,"tileHeight":2504688.5,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":4,"name":"","tileWidth":1252344.25,"tileHeight":1252344.25,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":5,"name":"","tileWidth":626172.125,"tileHeight":626172.125,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":6,"name":"","tileWidth":313086.0625,"tileHeight":313086.0625,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":7,"name":"","tileWidth":156543.03125,"tileHeight":156543.03125,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":8,"name":"","tileWidth":78271.515625,"tileHeight":78271.515625,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":9,"name":"","tileWidth":39135.7578125,"tileHeight":39135.7578125,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":10,"name":"","tileWidth":19567.87890625,"tileHeight":19567.87890625,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":11,"name":"","tileWidth":9783.939453125,"tileHeight":9783.939453125,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":12,"name":"","tileWidth":4891.9697265625,"tileHeight":4891.9697265625,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":13,"name":"","tileWidth":2445.98486328125,"tileHeight":2445.98486328125,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":14,"name":"","tileWidth":1222.992431640625,"tileHeight":1222.992431640625,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":15,"name":"","tileWidth":611.4962158203125,"tileHeight":611.4962158203125,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":16,"name":"","tileWidth":305.74810791015625,"tileHeight":305.74810791015625,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":17,"name":"","tileWidth":152.87405395507812,"tileHeight":152.87405395507812,"tileImageWidth":256,"tileImageHeight":256},
          {"zoomLevel":18,"name":"","tileWidth":76.43702697753906,"tileHeight":76.43702697753906,"tileImageWidth":256,"tileImageHeight":256}
          ]
          };