| 174 | | (pushnew 'hunchentoot:dispatch-easy-handlers hunchentoot:*dispatch-table*) |
|---|
| | 174 | ;; (pushnew 'hunchentoot:dispatch-easy-handlers hunchentoot:*dispatch-table*) |
|---|
| | 175 | |
|---|
| | 176 | |
|---|
| | 177 | (defmethod handle-object ((handler image-tree-kml-handler) (obj image-tree-node)) |
|---|
| | 178 | (hunchentoot:handle-if-modified-since (blob-timestamp obj)) |
|---|
| | 179 | (with-xml-response (:content-type "text/xml; charset=utf-8" #+nil"application/vnd.google-earth.kml+xml" |
|---|
| | 180 | :root-element "kml") |
|---|
| | 181 | (setf (hunchentoot:header-out :last-modified) |
|---|
| | 182 | (hunchentoot:rfc-1123-date (blob-timestamp obj))) |
|---|
| | 183 | (let ((lod `(:min ,(lod-min obj) :max ,(lod-max obj))) |
|---|
| | 184 | (rect (make-rectangle2 (list (geo-x obj) (geo-y obj) (geo-width obj) (geo-height obj))))) |
|---|
| | 185 | (with-element "Document" |
|---|
| | 186 | (kml-region rect lod) |
|---|
| | 187 | (kml-overlay (format nil "http://~a/image/~d" (website-host) (store-object-id obj)) |
|---|
| | 188 | rect |
|---|
| | 189 | :draw-order (depth obj) |
|---|
| | 190 | ;; :absolute 0 |
|---|
| | 191 | ) |
|---|
| | 192 | (dolist (child (children obj)) |
|---|
| | 193 | (kml-network-link (format nil "http://~a/image-tree-kml/~d" (website-host) (store-object-id child)) |
|---|
| | 194 | :rect (make-rectangle2 (list (geo-x child) (geo-y child) |
|---|
| | 195 | (geo-width child) (geo-height child))) |
|---|
| | 196 | :lod `(:min ,(lod-min child) :max ,(lod-max child)))))))) |
|---|
| 177 | | ((name :parameter-type 'keyword)) |
|---|
| 178 | | (print name) |
|---|
| 179 | | (assert (find-sat-layer name)) |
|---|
| 180 | | ) |
|---|
| 181 | | |
|---|
| | 199 | ((name :parameter-type 'keyword)) |
|---|
| | 200 | (assert (find-sat-layer name)) |
|---|
| | 201 | (with-xml-response (:content-type "text/xml; charset=utf-8" #+nil"application/vnd.google-earth.kml+xml" |
|---|
| | 202 | :root-element "kml") |
|---|
| | 203 | (with-element "Document" |
|---|
| | 204 | (loop for sat-node in (sat-layer-top-level-nodes (find-sat-layer name)) |
|---|
| | 205 | for sat-image = (image sat-node) |
|---|
| | 206 | do (kml-overlay (format nil "http://~a/image/~d" (website-host) (store-object-id sat-image)) |
|---|
| | 207 | (geo-box-rectangle (image-geo-box sat-image)) |
|---|
| | 208 | :draw-order 0 |
|---|
| | 209 | ;; :absolute 0 |
|---|
| | 210 | ))))) |
|---|
| | 211 | |
|---|