[Mapbender-commits] r2148 - branches/2.4.5/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Feb 27 07:51:25 EST 2008
Author: astrid_emde
Date: 2008-02-27 07:51:25 -0500 (Wed, 27 Feb 2008)
New Revision: 2148
Added:
branches/2.4.5/http/javascripts/mod_exportMapImage.php
Log:
http://www.mapbender.org/ExportMapimage
new module to export mapimage
Added: branches/2.4.5/http/javascripts/mod_exportMapImage.php
===================================================================
--- branches/2.4.5/http/javascripts/mod_exportMapImage.php (rev 0)
+++ branches/2.4.5/http/javascripts/mod_exportMapImage.php 2008-02-27 12:51:25 UTC (rev 2148)
@@ -0,0 +1,150 @@
+<?php
+# $Id$
+# http://www.mapbender.org/ExportMapimage
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+session_start();
+include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>Export Mapimage</title>
+</head>
+<style type="text/css">
+<!--
+
+input{
+ width:50px;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+div{
+ font-family : Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
+.imageformat{
+ width:50px;
+ font-family : Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ font-weight: bold;
+}
+
+-->
+</style>
+<?php
+
+
+
+echo "<script type='text/javascript'>";
+echo "var target = '".$_REQUEST["target"]."';";
+
+echo "</script>";
+?>
+<script type="text/javascript">
+
+
+
+function exportMapimage(){
+
+ choosen = ""
+ len = document.form1.imageformat.length
+
+ for (i = 0; i <len; i++) {
+ if (document.form1.imageformat[i].checked) {
+ choosen = document.form1.imageformat[i].value
+ }
+ }
+
+ if (choosen == "") {
+ alert("Keine Wahl getroffen, per DEFAULT wird die Karte als PNG exportiert");
+ choosen = document.form1.imageformat[0].value
+ }
+ else {
+ //alert(choosen)
+ }
+
+// Static for testing
+// window.open("../php/mod_exportMapImage_server.php?target="+target+"&imagetype="+choosen+"","exportMapImage","width=180, height=200, resizable=yes ")
+//
+
+ var idx = window.opener.getMapObjIndexByName(target);
+
+
+ var wms_string = "";
+
+ for(var ii=0; ii<window.opener.mb_mapObj[idx].wms.length; ii++){
+
+
+ if (window.opener.mb_mapObj[idx].mapURL[ii] == false || typeof(window.opener.mb_mapObj[idx].mapURL[ii]) == 'undefined' || window.opener.mb_mapObj[idx].mapURL[ii] == 'undefined'){
+
+ //alert('Keine WMSe vorhanden.');
+ } else{
+
+ if (ii==0){
+ wms_string = window.opener.mb_mapObj[idx].mapURL[ii];
+ } else {
+ wms_string += "___"+window.opener.mb_mapObj[idx].mapURL[ii];
+ }
+ }
+ }
+ wms_string = encodeURIComponent(wms_string);
+ window.open("../php/mod_exportMapImage_server.php?target="+target+"&imagetype="+choosen+"&wms_urls="+wms_string+"","exportMapImage","width=180, height=200, resizable=yes ")
+}
+
+
+</script>
+<body>
+<form name='form1' method='POST' action='' target="_blank" onSubmit="return FormCheck()>
+<table border='0'>
+<div>Please select a format for the exported image!</div><br>
+<tr>
+ <td>
+ <span class="imageformat"><input type="radio" name="imageformat" value="png">PNG</span><br>
+ </td>
+</tr>
+<tr>
+ <td>
+ <span class="imageformat"><input type="radio" name="imageformat" value="jpeg">JPEG / JPG</span><br>
+ </td>
+</tr>
+<!--
+<tr>
+ <td>
+ <span class="imageformat"><input type="radio" name="imageformat" value="geotiff">GeoTIFF</span><br><br>
+ </td>
+</tr>
+-->
+<tr>
+ <td align="center">
+ <input type='button' name='print' value="OK" onclick='exportMapimage()'>
+ </td>
+</tr>
+
+</table>
+
+</form>
+</body>
+</html>
Property changes on: branches/2.4.5/http/javascripts/mod_exportMapImage.php
___________________________________________________________________
Name: svn:keywords
+ HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
More information about the Mapbender_commits
mailing list