Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • suzyb 474 posts 932 karma points
    Dec 23, 2011 @ 20:31
    suzyb
    0

    Linking to the google map

    I want to add a link to google maps itself using the coordinates selected but the value saved by the datatype includes the zoom value.

    How do I remove the zoom so it's just long,lat so I can append it to the URL http://maps.google.co.uk/maps?q=

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 23, 2011 @ 20:39
    Jan Skovgaard
    0

    Hi Suzy

    In XSLT you would need to use the umbraco.library:Split extension where you split the value by each comma. For instance like this

    <xsl:variable name="cords" select="umbraco.library:Split(yourproperty,',')" />

    This creates a piece of XML that looks like this:

    <values>
    <value>51.0020</value>
    <value>9.1029</value>
    <value>13</value>
    </values>

    Now you can fecth the two values by doing something like this...

    <xsl:variable name="lat" select="$cords/values/value[1]" />
    <xsl:variable name="lng" select="$cords/values/value[2]" />

    I hope this example gives you some inspiration on how to fecth the coordinates by splitting the values.

    /Jan

  • suzyb 474 posts 932 karma points
    Dec 23, 2011 @ 21:00
    suzyb
    0

    Thanks for such a quick response, meant I got this working before the holidays :D

    To fetch the values it is $coords/value[1] and $coords/value[2] though.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 23, 2011 @ 21:07
    Jan Skovgaard
    0

    Hi Suzy

    I'm glad I could help - yes you're right, that's the part that always tricks me since <values> is the root element.

    Happy holidays!

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft