[bknr-cvs] ksprotte changed trunk/projects/bos/web/kml-

BKNR Commits bknr at bknr.net
Fri Sep 5 13:14:20 UTC 2008


Revision: 3807
Author: ksprotte
URL: http://bknr.net/trac/changeset/3807

added a look-at key to kml-network-link that seems to work more reliably
U   trunk/projects/bos/web/kml-handlers.lisp
U   trunk/projects/bos/web/kml-utils.lisp

Modified: trunk/projects/bos/web/kml-handlers.lisp
===================================================================
--- trunk/projects/bos/web/kml-handlers.lisp	2008-09-05 13:00:13 UTC (rev 3806)
+++ trunk/projects/bos/web/kml-handlers.lisp	2008-09-05 13:14:20 UTC (rev 3807)
@@ -246,7 +246,15 @@
                             :hide-children nil)
           (kml-network-link (format nil "http://~a/country-stats?lang=~A" (website-host) lang)
                             :name (dictionary-entry "Country-Stats" lang)
-                            :hide-children nil))))))
+                            :hide-children nil
+                            :look-at (lambda ()
+                                       (with-element "LookAt"
+                                         (with-element "longitude" (text "8.297592139883164"))
+                                         (with-element "latitude" (text "49.89989439494514"))
+                                         (with-element "altitude" (text "0"))
+                                         (with-element "range" (text "5400715.913126094"))
+                                         (with-element "tilt" (text "0"))
+                                         (with-element "heading" (text "0"))))))))))
 
 (defmethod handle-object ((handler kml-root-dynamic-handler) (object sponsor))
   (write-root-kml handler object))
@@ -273,14 +281,7 @@
                                       :root-element "kml")
       (with-query-params ((lang "en"))
         (with-element "Document"
-          (with-element "name" (text "Country-Stats"))
-          (with-element "LookAt"
-            (with-element "longitude" (text "8.297592139883164"))
-            (with-element "latitude" (text "49.89989439494514"))
-            (with-element "altitude" (text "0"))
-            (with-element "range" (text "5400715.913126094"))
-            (with-element "tilt" (text "0"))
-            (with-element "heading" (text "0")))
+          (with-element "name" (text "Country-Stats"))          
           (with-element "Style"
             (attribute "id" "countryStatsStyle")
             (with-element "IconStyle"

Modified: trunk/projects/bos/web/kml-utils.lisp
===================================================================
--- trunk/projects/bos/web/kml-utils.lisp	2008-09-05 13:00:13 UTC (rev 3806)
+++ trunk/projects/bos/web/kml-utils.lisp	2008-09-05 13:14:20 UTC (rev 3807)
@@ -276,11 +276,13 @@
       (with-element "bgColor" (text "00ffffff")))))
 
 (defun kml-network-link (href &key rect lod name
-                         fly-to-view hide-children)
+                         fly-to-view hide-children
+                         look-at)
   ;; http-query could be added to &key args
   (with-element "NetworkLink"
     (when name (with-element "name" (text name)))
     (when rect (kml-region rect lod))
+    (when look-at (funcall look-at))
     (when hide-children
       (kml-hide-children-style))
     (when fly-to-view (with-element "flyToView" (text "1")))




More information about the Bknr-cvs mailing list