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

Revision 33216, 3.9 KB (checked in by wy59, 14 months ago)

Dr Bainbridge fixed debugging code not meant to be committed that set an element's attribute as debug=true in maptools.xsl. This attribute had the side-effect of opening up the green(stone)bug on all pages that had a map.

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/{$interface_name}/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']) or metadataList/metadata[@name = 'Coordinate'] or metadataList/metadata[@name = 'GPS.mapOverlay']">
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:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
32          <xsl:text disable-output-escaping="yes">,</xsl:text>
33          <xsl:text disable-output-escaping="yes">"lat":</xsl:text>
34          <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Latitude']"/>
35          <xsl:text>,</xsl:text>
36          <xsl:text disable-output-escaping="yes">"lng":</xsl:text>
37          <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
38      </xsl:if>
39      <!--
40      <xsl:if test="metadataList/metadata[@name = 'Coordinate']">
41        <xsl:text disable-output-escaping="yes">,</xsl:text>
42        <xsl:text disable-output-escaping="yes">"coords":</xsl:text>
43        <xsl:text>[</xsl:text>
44        <xsl:for-each select="metadataList/metadata[@name = 'Coordinate']">
45            <xsl:text disable-output-escaping="yes">"</xsl:text>
46            <xsl:value-of disable-output-escaping="yes" select="current()"/>
47            <xsl:text disable-output-escaping="yes">"</xsl:text>
48            <xsl:text disable-output-escaping="yes">,</xsl:text>
49        </xsl:for-each>
50        <xsl:text>]</xsl:text>
51      </xsl:if>
52      -->
53      <xsl:if test="metadataList/metadata[@name = 'GPS.mapOverlay']">
54        <xsl:text disable-output-escaping="yes">,</xsl:text>
55        <xsl:text disable-output-escaping="yes">"mapoverlay":</xsl:text>
56        <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'GPS.mapOverlay']"/>
57      </xsl:if>
58                           
59      <xsl:text>}</xsl:text>
60      <xsl:if test="not(position() = count(//documentNode))">
61        <xsl:text>,</xsl:text>
62      </xsl:if>
63                </xsl:if>
64      </xsl:for-each>
65      <xsl:text>]</xsl:text>
66    </div>
67   
68    <!-- Although these aren't visible, they are necessary because it forces Greenstone to include this metadata in the page xml -->
69    <gsf:metadata name="Latitude" hidden="true"/>
70    <gsf:metadata name="Longitude" hidden="true"/>
71    <gsf:metadata name="Coordinate" hidden="true"/>
72    <gsf:metadata name="GPS.mapOverlay" hidden="true"/>
73<!--  these were included in version in query. don't think we need them...
74    <gsf:metadata name="Image" hidden="true"/>
75    <gsf:metadata name="SourceFile" hidden="true"/>
76    <gsf:metadata name="assocfilepath" hidden="true"/>
77    <gsf:metadata name="PhotoType" hidden="true"/>
78    <gsf:metadata name="cv.rotation" hidden="true"/>
79    <gsf:metadata name="Angle" hidden="true"/> -->
80   
81   
82  </xsl:template>
83
84  <xsl:template name="mapFeaturesMap">
85    <div id="map_canvas" class="map_canvas_half"><xsl:text> </xsl:text></div>
86  </xsl:template>
87
88
89</xsl:stylesheet>
90
Note: See TracBrowser for help on using the browser.