Changeset 3260
- Timestamp:
- 06/04/08 18:54:14 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/bos-trunk-sat/projects/bos/web/image-tree.lisp
r3138 r3260 256 256 (format nil "~2,'0X~{~2,'0X~}" opacity (reverse color))) 257 257 258 (defmethod kml-link ((href string) )258 (defmethod kml-link ((href string) &key (http-query "lang=[language]")) 259 259 (with-element "Link" 260 260 (with-element "href" (text href)) 261 261 (with-element "viewRefreshMode" (text "onRegion")) 262 (with-element "httpQuery" (text "lang=[language]")))) 262 (when http-query 263 (with-element "httpQuery" (text http-query))))) 263 264 264 265 ;; (defmethod kml-link ((href puri:uri)) … … 267 268 ;; (kml-link string))) 268 269 269 (defun kml-network-link (href &key rect lod name )270 (defun kml-network-link (href &key rect lod name (http-query "lang=[language]")) 270 271 (with-element "NetworkLink" 271 272 (when name (with-element "name" (text name))) 272 273 (when rect (kml-region rect lod)) 273 (kml-link href )))274 (kml-link href :http-query http-query))) 274 275 275 276 (defun kml-lat-lon-box (rect &optional (element "LatLonBox")) … … 630 631 :rect (make-rectangle2 (list (geo-x child) (geo-y child) 631 632 (geo-width child) (geo-height child))) 632 :lod `(:min ,(lod-min child) :max ,(lod-max child)))))))) 633 :lod `(:min ,(lod-min child) :max ,(lod-max child)) 634 :http-query nil)))))) 633 635 634 636 (defclass image-tree-kml-latest-handler (page-handler) branches/bos-trunk-sat/projects/bos/web/kml-handlers.lisp
r3258 r3260 64 64 65 65 (defclass kml-root-handler (object-handler) 66 ( ))66 ((timestamp :accessor timestamp :initform (get-universal-time)))) 67 67 68 (defun write-root-kml ( &optionalsponsor)68 (defun write-root-kml (handler sponsor) 69 69 (let ((*print-case* :downcase) 70 70 (contract (when sponsor (first (sponsor-contracts sponsor))))) 71 (hunchentoot:handle-if-modified-since (timestamp handler)) 71 72 ;; only the first contract of SPONSOR will be shown 72 73 (with-xml-response (:content-type #+nil "text/xml" "application/vnd.google-earth.kml+xml; charset=utf-8" 73 74 :root-element "kml") 75 (setf (hunchentoot:header-out :last-modified) 76 (hunchentoot:rfc-1123-date (timestamp handler))) 74 77 (with-query-params ((lang "en")) 75 78 (with-element "Document" … … 97 100 :rect (make-rectangle2 (geo-location image-tree)) 98 101 :lod `(:min ,(lod-min image-tree) :max ,(lod-max image-tree)) 99 :name "old-image-tree")) 102 :name "old-image-tree" 103 :http-query nil)) 100 104 (dolist (sat-layer (class-instances 'sat-layer)) 101 105 (kml-network-link (format nil "http://~a/sat-root-kml?name=~A" (website-host) (name sat-layer)) 102 106 :rect (geo-box-rectangle *m2-geo-box*) 103 107 :lod '(:min 0 :max -1) 104 :name (princ-to-string (name sat-layer)))) 108 :name (princ-to-string (name sat-layer)) 109 :http-query nil)) 105 110 (let ((href (if (not contract) 106 111 (format nil "http://~a/contract-tree-kml" (website-host)) … … 112 117 (kml-network-link href 113 118 :rect (geo-box-rectangle (geo-box *contract-tree*)) 114 :lod `(:min ,(network-link-lod-min *contract-tree*) 115 :max ,(network-link-lod-max *contract-tree*)) 119 :lod (node-lod *contract-tree*) 116 120 :name "contracts")) 117 121 (kml-network-link (format nil "http://~a/poi-kml-all" (website-host)) … … 153 157 154 158 (defmethod handle-object ((handler kml-root-handler) (object sponsor)) 155 (write-root-kml object))159 (write-root-kml handler object)) 156 160 157 161 (defmethod handle-object ((handler kml-root-handler) (object contract)) … … 159 163 160 164 (defmethod handle-object ((handler kml-root-handler) (object null)) 161 (write-root-kml ))165 (write-root-kml handler nil)) 162 166 branches/bos-trunk-sat/projects/bos/web/sat-tree.lisp
r3257 r3260 224 224 (website-host) (name layer) (append path (list i))) 225 225 :rect (geo-box-rectangle (geo-box child)) 226 :lod (node-lod child)))))))))))))) 226 :lod (node-lod child) 227 :http-query nil))))))))))))) 227 228 228 229 (defclass sat-root-kml-handler (page-handler) … … 246 247 (website-host) (name layer) (node-path node)) 247 248 :rect (geo-box-rectangle (geo-box node)) 248 :lod (node-lod node))))))))) 249 249 :lod (node-lod node) 250 :http-query nil)))))))) 251
