1 Reply Latest reply: Feb 28, 2013 1:37 PM by Marcelo Vasquez RSS

    Config Google Maps TYPE (ROAD and SATELLITE) in Oracle MapViewer 11.1.1.6

    Marcelo Vasquez
      Hi everybody

      I have two Map Tile Layer config with Google Maps, this Map Tile working fine when I set the follow properties:

      MAP1: GOOGLE_MAP
      - "map_type_values" = "MVGoogleTileLayer.ROAD"
      - "map_type_names" = "Road"

      MAP2: GOOGLE_SATELLITE_MAP
      - "map_type_values" = "MVGoogleTileLayer.TYPE_SATELLITE"
      - "map_type_names" = "Satellite"

      In ADF page I'm using DVT:MAP component:
      <dvt:map id="map" startingX="-8700.0" mapServerConfigId="mapConfigXXX" baseMapName="XXX.GOOGLE_MAP" mapZoom="3"
      inlineStyle="width:1000px; height:500px;" startingY="-1840.0" unit="METERS"
      satelliteBaseMapName="XXX.GOOGLE_SATELLITE_MAP">

      When render the page we can see the Google Map Road (default) and show in map 2 button (Road & Satellite), but if I clic on "Satellite" Button, dont show the SATELLITE map.

      product version:
      JDeveloper 11.1.2.2.0
      MapViewer 11.1.1.6.0 deployed on Weblogic

      Any can help me?

      Regards, Marcelo
        • 1. Re: Config Google Maps TYPE (ROAD and SATELLITE) in Oracle MapViewer 11.1.1.6
          Marcelo Vasquez
          Hi everybody

          I find one solution for my problem:

          Remember, Google Maps is a Map Tile Layer in Oracle Mapviewer

          I use Javascript for find my MapViewer object in javascript and later I manipulate this object, add toolbar with options ROAD and SATELLITE:

          var map;
          var mapview;
          function setupMapView()
          {
          map = AdfPage.PAGE.findComponentByAbsoluteId('pt1:r1:0:map');
          console.log(map);
          mapview = map.getMVMapView();
          console.log(mapview);
          toolbar = new MVToolBar("toolbarMapType");
          toolbar.setPosition(0.8,0.05);
          mapview.addToolBar(toolbar);

          var bt1 = new MVToolButton("bt1",MVToolButton.COMMAND,
          "/xxxx/imagenes/iconos/road.png","/xxxx/imagenes/iconos/road_gris.png");
          var bt2 = new MVToolButton("bt2",MVToolButton.COMMAND,
          "/xxxx/imagenes/iconos/satellite.png","/xxxx/imagenes/iconos/satellite_gris.png");
          bt1.setToolTip("Road Map");
          bt2.setToolTip("Satellite Map");
          bt1.attachEventListener(MVEvent.BUTTON_UP, function(){showMapType(MVGoogleTileLayer.TYPE_ROAD);})
          bt2.attachEventListener(MVEvent.BUTTON_UP, function(){showMapType(MVGoogleTileLayer.TYPE_SATELLITE);})

          var group = new MVButtonGroup() ;
          group.add(bt1) ;
          group.add(bt2) ;
          toolbar.addButtonGroup(group) ;

          }

          function showMapType (type) {
          console.log(type);
          var maps = mapview.getMapTileLayers();
          var google = maps[0];
          console.log(mapview);
          google.setMapType(type);
          }

          Edited by: Marcelo Vasquez on Feb 28, 2013 11:35 AM