Changeset 3504

Show
Ignore:
Timestamp:
07/18/08 16:28:25 (4 months ago)
Author:
ksprotte
Message:

new style option for kml-network-links: :hide-children t

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/projects/bos/web/kml-handlers.lisp

    r3492 r3504  
    8484            (with-element "tilt" (text "0")) 
    8585            (with-element "heading" (text "1.391362238653075")))           
    86           (dolist (sat-layer (class-instances 'sat-layer)) 
    87             (kml-network-link (format nil "http://~a/sat-root-kml?name=~A" (website-host) (name sat-layer)) 
    88                               :rect (geo-box-rectangle *m2-geo-box*) 
    89                               :lod '(:min 0 :max -1) 
    90                               :name (dictionary-entry (princ-to-string (name sat-layer)) lang))) 
     86          (with-element "Folder" 
     87            (attribute "name" "Sat-Images") 
     88            (attribute "open" "1") 
     89            (with-element "Style" 
     90              (with-element "ListStyle" 
     91                (with-element "listItemType" (text "radioFolder"))))                 
     92            (dolist (sat-layer (class-instances 'sat-layer)) 
     93              (kml-network-link (format nil "http://~a/sat-root-kml?name=~A" (website-host) (name sat-layer)) 
     94                                :rect (geo-box-rectangle *m2-geo-box*) 
     95                                :lod '(:min 0 :max -1) 
     96                                :name (dictionary-entry (princ-to-string (name sat-layer)) lang) 
     97                                :hide-children t))) 
    9198          (let ((href (if (not contract) 
    9299                          (format nil "http://~a/contract-tree-kml?lang=~A" (website-host) lang) 
     
    99106                              :rect (geo-box-rectangle (geo-box *contract-tree*)) 
    100107                              :lod (node-lod *contract-tree*) 
    101                               :name (dictionary-entry "Squaremetre Area" lang))) 
     108                              :name (dictionary-entry "Squaremetre Area" lang) 
     109                              :hide-children t)) 
    102110          (kml-network-link (format nil "http://~a/poi-kml-all?lang=~A" (website-host) lang) 
    103111                            :name (dictionary-entry "POIs" lang) 
    104112                            :rect (make-rectangle :x 0 :y 0 :width +width+ :height +width+) 
    105                             :lod '(:min 0 :max -1)) 
     113                            :lod '(:min 0 :max -1) 
     114                            :hide-children t) 
    106115          (kml-network-link (format nil "http://~a/country-stats?lang=~A" (website-host) lang) 
    107                             :name (dictionary-entry "Country-Stats" lang))))))) 
     116                            :name (dictionary-entry "Country-Stats" lang) 
     117                            :hide-children t)))))) 
    108118 
    109119(defmethod handle-object ((handler kml-root-handler) (object sponsor)) 
  • trunk/projects/bos/web/kml-utils.lisp

    r3493 r3504  
    268268;;     (kml-link string))) 
    269269 
     270 
     271(defun kml-hide-children-style () 
     272  (with-element "Style" 
     273    (with-element "ListStyle" 
     274      (with-element "listItemType" (text "checkHideChildren")) 
     275      (with-element "bgColor" (text "00ffffff"))))) 
     276 
    270277(defun kml-network-link (href &key rect lod name http-query 
    271                          fly-to-view
     278                         fly-to-view hide-children
    272279  (with-element "NetworkLink" 
    273280    (when name (with-element "name" (text name))) 
    274281    (when rect (kml-region rect lod)) 
     282    (when hide-children 
     283      (kml-hide-children-style)) 
    275284    (when fly-to-view (with-element "flyToView" (text "1"))) 
    276285    (kml-link href)))