Commits

Flo Ledermann committed 27df5a4

add base box to clusters (currently cannot be used for zooming)

Comments (0)

Files changed (2)

openresources/media/js/OpenResourcesRenderer.js

         	while (node.firstChild) {
 			     node.removeChild(node.firstChild);
 			}
+
+            if (style.zoomBox) {
+                var zoombox = document.createElementNS(this.xmlns, "rect");
+		        zoombox.setAttributeNS(null, "width", 32);
+                zoombox.setAttributeNS(null, "height", 22);
+                zoombox.setAttributeNS(null, "x", -3);
+                zoombox.setAttributeNS(null, "y", 16);
+                zoombox.setAttributeNS(null, "style", "fill: white; fill-opacity: 0.6; stroke: black; stroke-width: 1px; stroke-opacity: 0.7; stroke-dasharray: 2,2;"); //  shape-rendering:optimizeSpeed;
+                node.appendChild(zoombox);
+            }
         	
             var icon = document.createElementNS(this.xmlns, "image");
             icon.setAttributeNS(null, "width", 20);
 		                node.appendChild(smask);	            	
 		            }
             	}
-            }
-            
+            }            
             
             if (style.graphicTitle) {
                 node.setAttributeNS(null, "title", style.graphicTitle);

openresources/media/js/map.js

         subicontitles: '${subicontitles}',
         iconBaseURL: MEDIA_URL,
         subiconmask: 'openresources/map_marker/subicon_mask.png',
+        zoomBox: '${zoomBox}',
         
         iconText: '${iconText}',
         
                 }
                 return titles;
             },
+            zoomBox: function(feature) {
+                return feature.cluster ? true : '';
+            },
             iconXOffset: function(f) { return f.cluster ? 2 : 3 },
             iconYOffset: function(f) { return f.cluster ? 1 : 3 },
          }