3 Replies Latest reply: Aug 19, 2013 1:14 PM by jsharma RSS

    printng FOIs with labels do not hidde not visible labels when using print function




      when I use the print function the HTMLElement labels on a FOI object

      that are not in the visible scope are not hidden. I provided an example

      where the 'Dallas' FOI is not in the visible area and when you print it

      the circle is invisible but the label 'Dallas' is on the print out.


      The second problem is that all lables on the printout have the same



      Im using Mapviewer and the testcase is based on a mvdemo map.

      If you use the print function you should see the problem:




      <META http-equiv="Content-Type" content="text/html; charset=UTF-8">


      <style type="text/css">

      @media screen


      .noscreen {display: none;}


      @media print


      .noprint{display: none;}




      <script language="Javascript" src="/mapviewer/fsmc/jslib/oraclemaps.js"></script>

      <script language=javascript>

      var mapview;

      var baseURL = "http://"+document.location.host+"/mapviewer";


      function showMap()


      mapview = new MVMapView(document.getElementById("map"), baseURL);

      mapview.addMapTileLayer(new MVMapTileLayer("mvdemo.demo_map"));

      mapview.setCenter(MVSdoGeometry.createPoint(-122.45, 37.6706,8307));



      //adds custom foi with label

      var xmlDef = '<svg width="1in" height="1in">'+

      '<g class="marker" '+


      '<circle r="20"/>'+



      //var markerStyle = new MVXMLStyle("my_vector_icon_", xmlDef);

      var markerGreen = new MVStyleMarker("my_vector_icon_", "vector");





      var markerRed = new MVStyleMarker("my_vector_icon_", "vector");





      var markerBlue = new MVStyleMarker("my_vector_icon_", "vector");






      mpoint_green = MVSdoGeometry.createPoint(-112.30, 34.73,8307);

      var v_result_green = new MVFOI("10", mpoint_green, markerGreen, null, 60, 60);



      mpoint_red = MVSdoGeometry.createPoint(-122.30, 37.50,8307);

      var v_result_red = new MVFOI("11", mpoint_red, markerRed, null, 60, 60);

      v_result_red.setHTMLElement('San Francisco',10,10);



      mpoint_blue = MVSdoGeometry.createPoint(-97.30, 33.50,8307);

      var v_result_blue = new MVFOI("12", mpoint_blue, markerBlue, null, 60, 60);










      function mapPrint()


      var a=document.getElementById("printmap");







      <body onload=javascript:showMap()>

      <div id="map" style="position:absolute;top:50px; left:10px; width:600px; height:450px;border:0px"></div>

      <div id="printmap" class="noscreen"></div>

      <p>Please click <a href="javascript:mapPrint()">here</a> to print map</p>



        • 1. Re: printng FOIs with labels do not hidde not visible labels when using print function

          Try it with the overflow:hidden on the printmap div. i.e.

          <div id="printmap" style="overflow:hidden;" class="noscreen"></div>


          or add an overflow:hidden to the media print style, i.e.

          @media print
          .noprint{display: none;}
          .noscreen {overflow: hidden;}


          As far as I can tell no color was specified for the label text in the example above.

          e.g. v_result_blue.setHTMLElement('Dallas',10,10); does not specify a color so the default font and color will be used.

          However I'll test this (text color qs) out further and let you know

          • 2. Re: printng FOIs with labels do not hidde not visible labels when using print function

            The issue with the symbols all showing up in the same color (e.g. sfo and phoenix both as green circles instead of red and green) is intermittent/inconsistent in my tests. Saw it initially but not again. Will look into it further.


            Meanwhile let me know if the overflow:hidden part works for you.

            • 3. Re: printng FOIs with labels do not hidde not visible labels when using print function

              All marker symbols (SFO, Phoenix) show up in the same color (in print) because the same name is used for all the maker styles. Change the style names and the right colors should be used in printed map.

              i.e. change the lines

              var markerGreen = new MVStyleMarker("my_vector_icon_", "vector");


              var markerRed = new MVStyleMarker("my_vector_icon_", "vector");


              var markerBlue = new MVStyleMarker("my_vector_icon_", "vector");



              var markerGreen = new MVStyleMarker("my_vector_icon_g", "vector");


              var markerRed = new MVStyleMarker("my_vector_icon_r", "vector");

              var markerBlue = new MVStyleMarker("my_vector_icon_b", "vector");


              and it should be fine.