Something like:
function getVisibleLayerList(mapElement) {
var layers = mapElement.containerModel.getAllLayers();
var layerConfig = "";
for (var i = 0; i < layers.length; i++) {
var currentLayer = layers[i];
var layerName =
currentLayer.selectSingleNode("wmc:Name").firstChild.nodeValue;
var hiddenStatus = currentLayer.getAttribute("hidden");
if (hiddenStatus == "0") {
if (layerConfig != "") {
layerConfig += ',';
}
layerConfig += layerName;
}
}
return layerConfig;
}
function getMapUrl(mapElement) {
var wmsUrl = wmsBaseUrl;
wmsUrl += "\?";
wmsUrl += "REQUEST=GetMap";
var layerConfig = getVisibleLayerList(mapElement);
wmsUrl += "&FORMAT=image/png";
wmsUrl += "&BBOX=" + mapElement.extent.ul[0] + "," +
mapElement.extent.ul[1] + "," + mapElement.extent.lr[0] + "," +
mapElement.extent.lr[1]
wmsUrl += "&WIDTH=" + Math.round(mapElement.extent.size[0]);
wmsUrl += "&HEIGHT=" + Math.round(mapElement.extent.size[1]);
wmsUrl += "&LAYERS=" + layerConfig;
wmsUrl += "&SRS=" + mapElement.containerModel.getSRS();
wmsUrl += "&PLUMEMODE=" + plumeMode;
wmsUrl += "&TRANSPARENT=false";
if (mapElement.parentModel.objects.mainMapWidget) {
d = mapElement.parentModel.objects.mainMapWidget.d;
}
else if (mapElement.parentModel.objects.tsWidget) {
d = mapElement.parentModel.objects.tsWidget.d;
}
if (d != null) {
// We're in standard mode
wmsUrl += "&UNIQUEID=" + d.getTime() ;
}
if (mapElement.timestampList != null) {
timestamp = mapElement.getCurrentTimestamp();
wmsUrl += "&TIME=" + timestamp ;
}
return wmsUrl;
}
Do a pop-up window or something with the source set to getMapUrl.
Matthew D. Diez
________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Diez, Matthew
Sent: Wednesday, August 01, 2007 11:01 PM
To: Denton; [email protected]
Subject: Re: [Mapbuilder-devel] Printing from MapBuilder
I have written a little custom code to take care of this, it's not
exactly mapbuilder code, and it could probably be reworked to increase
portability.
Let me dig around here, and I'll send something to the list tomorrow, if
anybody wants to start building a generalized widget with it.
Matthew D. Diez
-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Denton
Sent: Tue 7/31/2007 2:28 AM
To: [email protected]
Subject: [Mapbuilder-devel] Printing from MapBuilder
Hi MapBuilder folks,
Please had someone been dealing with the printing of the multiple layers
from mapbuilder ?? Problem is that IE always prints the top context
layer
only, even if I have attached all layers in the mapbuilder
instance.....Of
course this issue cold be solved via mixing of all layers into the one
PNG
file, but are there any other options? Is somehow possible to hack IE to
be
able to print all layers, which are being saved in the Mapbuilder IMG
tag
stack?
Many thanks in advance...
Tomas
--
View this message in context:
http://www.nabble.com/Printing-from-MapBuilder-tf4191354.html#a11919440
Sent from the MapBuilder Devel mailing list archive at Nabble.com.
------------------------------------------------------------------------
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
mapbuilder-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel
IEM CONFIDENTIAL INFORMATION PLEASE READ OUR NOTICE:
http://wwwiem.com/e_mail_confidentiality_notice.html
<http://www.iem.com/e_mail_confidentiality_notice.html>
Effective July 15, 2007 IEM Headquarters will have a new physical and
mailing address:
8550 United Plaza Blvd, Suite 501
Baton Rouge, LA 70809
If you should have any questions, please feel free to contact us at
225.952.8191
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
mapbuilder-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel