Hello,
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
color.
Im using Mapviewer 11.1.1.7 and the testcase is based on a mvdemo map.
If you use the print function you should see the problem:
<html>
<head>
<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;}
}
</style>
<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));
mapview.setZoomLevel(4);
mapview.display();
//adds custom foi with label
var xmlDef = '<svg width="1in" height="1in">'+
'<g class="marker" '+
'style="width:40;height:40;font-family:sans-serif;font-size:20pt;stroke:0xff0000;fill:0x00ff00;stroke-width:1.5">'+
'<circle r="20"/>'+
'</g>'+
'</svg>';
//var markerStyle = new MVXMLStyle("my_vector_icon_", xmlDef);
var markerGreen = new MVStyleMarker("my_vector_icon_", "vector");
markerGreen.setStrokeColor("ff0000");
markerGreen.setFillColor("00ff00");
markerGreen.setVectorShape("c:30");
var markerRed = new MVStyleMarker("my_vector_icon_", "vector");
markerRed.setStrokeColor("0000FF");
markerRed.setFillColor("ff0000");
markerRed.setVectorShape("c:30");
var markerBlue = new MVStyleMarker("my_vector_icon_", "vector");
markerBlue.setStrokeColor("ff0000");
markerBlue.setFillColor("0000FF");
markerBlue.setVectorShape("c:30");
mpoint_green = MVSdoGeometry.createPoint(-112.30, 34.73,8307);
var v_result_green = new MVFOI("10", mpoint_green, markerGreen, null, 60, 60);
v_result_green.setHTMLElement('Phoenix',10,10);
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);
v_result_blue.setHTMLElement('Dallas',10,10);
mapview.addFOI(v_result_red);
mapview.addFOI(v_result_blue);
mapview.addFOI(v_result_green);
}
function mapPrint()
{
var a=document.getElementById("printmap");
mapview.print(a);
}
</script>
</head>
<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>
</body>
</html>