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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jul 4 07:00:42 PDT 2014


Author: hwbllmnn
Date: 2014-07-04 07:00:42 -0700 (Fri, 04 Jul 2014)
New Revision: 8991

Modified:
   trunk/mapbender/http/plugins/mb_digitize_widget.php
Log:
better defaults for point symbols


Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-07-04 13:26:23 UTC (rev 8990)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-07-04 14:00:42 UTC (rev 8991)
@@ -110,8 +110,8 @@
         '<tr><td>Flächenfarbe:</td><td><input type="color" name="fill" value="#ff0000"></input></td></tr>' +
         '<tr><td>Flächendeckkraft:</td><td><div class="opacity-slider" data-name="fill-opacity"></div></td></tr></table>' +
         '<table class="digitize-style-predefined"><tr><td>Symbol:</td><td><input type="text" name="marker-symbol" value=""></input></td></tr>' +
-        '<tr><td>Symbol size:</td><td><select name="marker-size" value="medium"><option value="large">large</option><option value="medium">medium</option><option value="small">small</option></select></td></tr>' +
-        '<tr><td>Symbol color:</td><td><input type="color" name="marker-color" value="#ff0000"></input></td></tr>' +
+        '<tr><td>Symbol size:</td><td><select name="marker-size" value="medium"><option value="large">large</option><option value="medium" selected="selected">medium</option><option value="small">small</option></select></td></tr>' +
+        '<tr><td>Symbol color:</td><td><input type="color" name="marker-color" value="#ffffff"></input></td></tr>' +
         '<tr><td>Linienfarbe</td><td><input type="color" name="stroke" value="#000000"></input></td></tr>' +
         '<tr><td>Liniendeckkraft:</td><td><div class="opacity-slider" data-name="stroke-opacity"></div></td></tr>' +
         '<tr><td>Liniendicke:</td><td><input type="text" name="stroke-width" value="1"></input></td></tr>' +
@@ -396,6 +396,13 @@
                 editStyleDialog.find('.digitize-style-predefined,form').css('display', 'none');
             }
 
+            $('input[value="predefined"]').bind('click', function() {
+                if($(this).val() == 'predefined') {
+                    var cls = $('.digitize-style-predefined .selected-icon i').attr('class');
+                    $('.digitize-style-predefined input[name="marker-symbol"]').val(cls).change();
+                }
+            });
+
             var preview = editStyleDialog.find('.digitize-preview');
             preview.html('');
             preview = preview.get(0);
@@ -439,8 +446,10 @@
                 feature.properties[$(this).attr('name')] = $(this).val();
 
                 if($(this).attr('name') === 'marker-symbol' && editStyleDialog.find('input[name="marker-type"]').val() == 'predefined') {
-                    var m = $(this).val().match(/^icon-(.+)-24$/)[1];
-                    feature.properties['marker-symbol'] = m;
+                    var m = $(this).val().match(/^icon-(.+)-24$/);
+                    if(m) {
+                        feature.properties['marker-symbol'] = m[1];
+                    }
                 }
 
                 kml.render();
@@ -468,6 +477,7 @@
             editStyleDialog.find('input[name="fill"]').spectrum();
             editStyleDialog.find('input[name="stroke"]').spectrum();
             editStyleDialog.find('input[name="marker-color"]').spectrum();
+            editStyleDialog.find('input[name="marker-symbol"]').change();
             if(menu)
                 menu.menu('destroy').remove();
         };



More information about the Mapbender_commits mailing list