]> dev.renevier.net Git - syp.git/commitdiff
add links to syp homepage in attribution control
authorarno <arenevier@fdn.fr>
Sun, 19 Jul 2009 21:10:44 +0000 (23:10 +0200)
committerarno <arenevier@fdn.fr>
Wed, 22 Jul 2009 12:00:10 +0000 (14:00 +0200)
js/syp.js
media/syp.css

index c9f637aa78f615f4fed291c6e4daa11305dfa721..3228e62b5a7aeecbf70bb1f94c615b1b8aa13f94 100644 (file)
--- a/js/syp.js
+++ b/js/syp.js
@@ -1,6 +1,21 @@
 /* Copyright (c) 2009 Arnaud Renevier, Inc, published under the modified BSD
  * license. */
 
+OpenLayers.Control.SypAttribution = OpenLayers.Class (OpenLayers.Control.Attribution, {
+    updateAttribution: function() {
+        var attributions = ['propulsed by <a href="http://syp.renevier.net">syp</a>'];
+        if (this.map && this.map.layers) {
+            for(var i=0, len=this.map.layers.length; i<len; i++) {
+                var layer = this.map.layers[i];
+                if (layer.attribution && layer.getVisibility()) {
+                    attributions.push( layer.attribution );
+                }
+            }  
+            this.div.innerHTML = attributions.join(this.separator);
+        }
+    }
+});
+
 var SYP = {
     Settings: {
         MARKER_ICON: "openlayers/img/marker-blue.png",
@@ -20,7 +35,7 @@ var SYP = {
                 new OpenLayers.Control.Navigation(),
                 new OpenLayers.Control.PanZoom(),
                 new OpenLayers.Control.Permalink(),
-                new OpenLayers.Control.Attribution()
+                new OpenLayers.Control.SypAttribution()
             ],
             projection: new OpenLayers.Projection("EPSG:900913"),
             displayProjection: new OpenLayers.Projection("EPSG:4326")
index c980d08540d4ea1ca1e6c0749e494291a4552f5d..1da0e25119cbf3e5af03731194c6f6e04aab2e44 100644 (file)
@@ -10,7 +10,8 @@
 
 .olControlAttribution {
     left: 3px;
-    bottom: 1.5em;
+    bottom: 1.5em!important;
+    width: 50%;
 }
 
 .olPopup p {