diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-08-23 16:07:16 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-08-23 16:07:16 +0200 |
commit | 69db5f3a8390f7d93f2e0327d0e922d98dc120f5 (patch) | |
tree | 506fa0597f104fd2e24dd58fdb5dc33a926ef1c1 /xsl | |
parent | 654cc991e8afcf2f94ca8f66a2674cf3886e86df (diff) | |
download | mutti-web-69db5f3a8390f7d93f2e0327d0e922d98dc120f5.tar.gz mutti-web-69db5f3a8390f7d93f2e0327d0e922d98dc120f5.tar.bz2 mutti-web-69db5f3a8390f7d93f2e0327d0e922d98dc120f5.zip |
contact: Add a googlemap
Diffstat (limited to 'xsl')
-rw-r--r-- | xsl/common.xsl | 1 | ||||
-rw-r--r-- | xsl/googlemaps.xsl | 63 |
2 files changed, 64 insertions, 0 deletions
diff --git a/xsl/common.xsl b/xsl/common.xsl index 7541576..cba6291 100644 --- a/xsl/common.xsl +++ b/xsl/common.xsl @@ -7,6 +7,7 @@ <xsl:include href="navi.xsl" /> <xsl:include href="svg.xsl" /> + <xsl:include href="googlemaps.xsl" /> <xsl:include href="link.xsl" /> <xsl:strip-space elements="*"/> diff --git a/xsl/googlemaps.xsl b/xsl/googlemaps.xsl new file mode 100644 index 0000000..dd77743 --- /dev/null +++ b/xsl/googlemaps.xsl @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:s="https://beratung-franzke.de/web-tpl"> + + <xsl:template match="s:googlemap" mode="html"> + <xsl:call-template name="googlemap"> + <xsl:with-param name="location" select="@location" /> + <xsl:with-param name="width"> + <xsl:choose> + <xsl:when test="@width"> + <xsl:value-of select="@width" /> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="'640'" /> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + <xsl:with-param name="height"> + <xsl:choose> + <xsl:when test="@height"> + <xsl:value-of select="@height" /> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="'480'" /> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:call-template> + </xsl:template> + + <xsl:template name="googlemap"> + <xsl:param name="location" /> + <xsl:param name="width" select="'640'" /> + <xsl:param name="height" select="'480'" /> + + <xsl:variable name="base_uri" select="'http://maps.google.de/maps?f=q&hl=de&source=s_q&'" /> + <xsl:variable name="map_base_uri" select="concat($base_uri, 'source=s_q&output=embed&q=')" /> + <xsl:variable name="link_base_uri" select="concat($base_uri, 'source=embed&output=embed&q=')" /> + + <xsl:element name="iframe"> + <xsl:attribute name="src"> + <xsl:value-of select="concat($map_base_uri, $location)" /> + </xsl:attribute> + <xsl:attribute name="width"><xsl:value-of select="$width" /></xsl:attribute> + <xsl:attribute name="height"><xsl:value-of select="$height" /></xsl:attribute> + <xsl:attribute name="frameborder">0</xsl:attribute> + <xsl:attribute name="marginheight">0</xsl:attribute> + <xsl:attribute name="marginwidth">0</xsl:attribute> + <xsl:attribute name="scrolling">no</xsl:attribute> + </xsl:element> + + <!-- + <br /> + <small> + <a href="{concat($link_base_uri, $location)}" style="color:#0000FF; text-align:left"> + Größere Kartenansicht + </a> + </small> + --> + </xsl:template> +</xsl:stylesheet> |