root/main/trunk/greenstone3/web/interfaces/default/transform/map-tools.xsl @ 32127

Revision 31550, 2.6 KB (checked in by kjdon, 3 years ago)

moved map and panorama templates into their own stylesheets. Note I haven't tested them yet.

Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4    xmlns:java="http://xml.apache.org/xslt/java"
5    xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6    xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
7    extension-element-prefixes="java util"
8    exclude-result-prefixes="java util gsf">
9
10
11  <xsl:template name="mapFeaturesIcon">
12    <td style="padding-left:5px; padding-right:5px;" valign="top">
13      <a href="javascript:focusDocument('{@nodeID}');">
14    <img src="interfaces/default/images/map_marker.png"/>
15      </a>
16    </td>
17  </xsl:template>
18 
19  <xsl:template name="mapFeaturesJSONNodes">
20    <div id="jsonNodes" style="display:none;">
21      <xsl:text>[</xsl:text>
22      <xsl:for-each select="//documentNode">
23    <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
24      <xsl:text>{</xsl:text>
25      <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text>
26      <xsl:value-of select="@nodeID"/>
27      <xsl:text disable-output-escaping="yes">",</xsl:text>
28      <xsl:text disable-output-escaping="yes">"title":"</xsl:text>
29      <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
30      <xsl:text disable-output-escaping="yes">",</xsl:text>
31      <xsl:text disable-output-escaping="yes">"lat":</xsl:text>
32      <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Latitude']"/>
33      <xsl:text>,</xsl:text>
34      <xsl:text disable-output-escaping="yes">"lng":</xsl:text>
35      <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
36      <xsl:text>}</xsl:text>
37      <xsl:if test="not(position() = count(//documentNode))">
38        <xsl:text>,</xsl:text>
39      </xsl:if>
40                </xsl:if>
41      </xsl:for-each>
42      <xsl:text>]</xsl:text>
43    </div>
44   
45    <!-- Although these aren't visible, they are necessary because it forces Greenstone to include this metadata in the page xml -->
46    <gsf:metadata name="Latitude" hidden="true"/>
47    <gsf:metadata name="Longitude" hidden="true"/>
48<!--  these were included in version in query. don't think we need them...
49    <gsf:metadata name="Image" hidden="true"/>
50    <gsf:metadata name="SourceFile" hidden="true"/>
51    <gsf:metadata name="assocfilepath" hidden="true"/>
52    <gsf:metadata name="PhotoType" hidden="true"/>
53    <gsf:metadata name="cv.rotation" hidden="true"/>
54    <gsf:metadata name="Angle" hidden="true"/> -->
55   
56   
57  </xsl:template>
58
59  <xsl:template name="mapFeaturesMap">
60    <div id="map_canvas" class="map_canvas_half"><xsl:text> </xsl:text></div>
61  </xsl:template>
62
63
64</xsl:stylesheet>
65
Note: See TracBrowser for help on using the browser.