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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu May 22 05:44:07 PDT 2014


Author: hwbllmnn
Date: 2014-05-22 05:44:07 -0700 (Thu, 22 May 2014)
New Revision: 8902

Modified:
   trunk/mapbender/http/plugins/mb_digitize_widget.php
Log:
only show valid options for geometry type in style dialog


Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-05-22 12:28:31 UTC (rev 8901)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-05-22 12:44:07 UTC (rev 8902)
@@ -237,9 +237,20 @@
             var url = $link.parent().parent().attr('title');
             var feature = kml._kmls[url].data.features[idx];
             var isline = false;
+
+            if(feature.geometry.type.match(/point/i)) {
+                editStyleDialog.find('input[name*="fill"],input[name*="stroke"]').parent().parent().css('display', 'none');
+                editStyleDialog.find('input[name*="marker"]').parent().parent().css('display', 'table-row');
+            }
             if(feature.geometry.type.match(/line/i)) {
-                isline = true;
+                editStyleDialog.find('input[name*="fill"],input[name*="marker"]').parent().parent().css('display', 'none');
+                editStyleDialog.find('input[name*="stroke"]').parent().parent().css('display', 'table-row');
             }
+            if(feature.geometry.type.match(/polygon/i)) {
+                editStyleDialog.find('input[name*="fill"],input[name*="stroke"]').parent().parent().css('display', 'table-row');
+                editStyleDialog.find('input[name*="marker"]').parent().parent().css('display', 'none');
+            }
+
             var preview = editStyleDialog.find('.digitize-preview');
             preview.html('');
             preview = preview.get(0);
@@ -247,7 +258,6 @@
             $.each(feature.properties, function(k, v) {
                 editStyleDialog.find('input[name="' + k + '"]').val(v);
             });
-            editStyleDialog.find('input[name*="fill"]').parent().parent().css('display', isline ? 'none' : 'table-row');
             editStyleDialog.find('input').bind('change', function() {
                 editStyleDialog.find('input').each(function() {
                     if(isline && $(this).attr('name').match(/fill/)) {



More information about the Mapbender_commits mailing list