[Mapbender-commits] r9549 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jul 19 06:05:17 PDT 2016


Author: verenadiewald
Date: 2016-07-19 06:05:17 -0700 (Tue, 19 Jul 2016)
New Revision: 9549

Modified:
   trunk/mapbender/http/plugins/mb_print.php
Log:
bugfix for svg_measures in IE print

Modified: trunk/mapbender/http/plugins/mb_print.php
===================================================================
--- trunk/mapbender/http/plugins/mb_print.php	2016-07-18 12:10:18 UTC (rev 9548)
+++ trunk/mapbender/http/plugins/mb_print.php	2016-07-19 13:05:17 UTC (rev 9549)
@@ -670,9 +670,17 @@
                             }
                         }
                     }
-                    if($jqForm.find('[name="map_svg_measures"]').length){
+                    if($jqForm.find('[name="map_svg_measures"]').length > 0){
                         if($('#measure_canvas svg:first').length){
-                                updateFormField(formData, "map_svg_measures", '<?xml version="1.0" encoding="UTF-8"?>\n' + $($('#measure_canvas').get(0)).html());
+                                var svgStr = $('#measure_canvas').html();
+                                /* TODO start bug fix: multiple attributes xmlns="http://www.w3.org/2000/svg" by root svg at IE 9,10,11*/
+                                var root = svgStr.match(/^<svg[^>]+/g);
+                                if(root[0].match(/xmlns=["']http:\/\/www.w3.org\/2000\/svg["']/g).length > 1){
+                                    var svg1 = root[0].replace(/ xmlns=["']http:\/\/www.w3.org\/2000\/svg["']/g,'');
+                                    updateFormField(formData, "map_svg_measures", svg1 + ' xmlns="http://www.w3.org/2000/svg"' + svgStr.substring(root[0].length));
+                                } else {
+                                    updateFormField(formData, "map_svg_measures", svgStr);
+                                }
                         } else {
                                 updateFormField(formData, "map_svg_measures", '');
                         }



More information about the Mapbender_commits mailing list