Copied to clipboard

Flag this post as spam?

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


  • Phillip Ng 148 posts 250 karma points
    Mar 09, 2011 @ 08:28
    Phillip Ng
    0

    Can't seem to get Locator Package to display results

    Would anyone be able to assist? Here's step-by-step

    1. Installed Locator package.
    2. Generated new Google Maps API key and added info to Locator data type
    3. Created a results.aspx page with locator data type and "results" template with the follow macro call
      <umbraco:Macro XPath="$currentPage" LocationAlias="results" UseAddress="0" AddressAliases="" ResultsXslt="LocatorResults.xslt" AddressExtra="" UnitInKm="0" MultipleResultsCaption="" Alias="Locator" runat="server"></umbraco:Macro>
    4. Set up my form element on another page with the "get" and "action" properties to point to the results.aspx
    5. Added the Google Maps API generated script tags to my master page.
    6. Googled the address in my results content page
    7. Went to my form, typed in zip code, was redirected to results.aspx, but informed "No results found".
    8. When visualizing the XSLT of the results.aspx page, the output is the correct coordinates of the location.

    Any ideas? What am I missing? Probably something wrong with my XPath path from the umbraco:Macro? I appreciate any help or suggestions in advance.

  • Daniel Bardi 924 posts 2556 karma points
    Mar 09, 2011 @ 08:45
    Daniel Bardi
    0

    The out is only the longitude and latitude... you need to setup a google script in the page and pass in the values to a GLatLang object.

  • Phillip Ng 148 posts 250 karma points
    Mar 09, 2011 @ 21:49
    Phillip Ng
    0

    Isn't the Google script handled in the xslt?

    <xsl:when test="count(/root//node [string-length(./data [@alias = 'distance']) &gt; 0 and number(./data [@alias = 'distance']) &lt; $radius]) = 0">
            <p>No Results found</p>
          </xsl:when>

          <xsl:otherwise>
            <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key={Locator:GetGoogleMapsKey()}"
                        type="text/javascript"></script>

    ...

    If I evaluate the <xsl:when> to "!= 0", the Google map is drawn, but with the pin at the address from the previous page, which is leading me to think there's something wrong with my xml. I can't find a "distance" attribute in my umbraco.config, but it should be there right?

  • Phillip Ng 148 posts 250 karma points
    Mar 15, 2011 @ 23:20
    Phillip Ng
    0

    Okay, figured it out, needed to go to the codeplex page and download the xslt for the new schema.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies