SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery Store Locator doesn't work when upload to another CMS

    Hello,

    I'm not sure why this "jQuery Store Locator" is not working when I enter a zipcode or address. It was working fine in DW when I tested it. It brings up the nearest location and a Google map. But when I copy and paste the code to another CMS, it wouldn't work when I click on the submit button. I'm using the locations.kml file that was created through Google Maps. Any help would be appreciated from this noob.

    Code:
    <!DOCTYPE html>
    <html>
      <head>
        <title>Library Locations</title>
        <meta charset="UTF-8">
        <link rel="stylesheet" type="text/css" href="http://abclibrary.org/loader.php?type=d&id=887068" /><!--map.css-->
      </head>
    
      <body>
        
        <div id="store-locator-container">
          <div id="page-header">
            <h1>Library Locations</h1>
    
          </div>
          
          <div id="form-container">
            <form id="user-location" method="post" action="#">
                <div id="form-input">
                  <label for="address">Enter Address or Zip Code:</label>
                  <input type="text" id="address" name="address" />
                 </div>
                
                <button id="submit" type="submit">Submit</button>
            </form>
          </div>
    
          <div id="map-container">
            <div id="loc-list">
                <ul id="list"></ul>
            </div>
            <div id="map"></div>
          </div>
        </div>
    
        <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
        <script src="http://abclibrary.org/loader.php?type=d&id=887073"></script><!--handlebars-1.0.0.min-->
        <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
        <script src="http://abclibrary.org/loader.php?type=d&id=887074"></script><!--jquery.storelocator-->
    
          <script>
            $(function() {
              $('#map-container').storeLocator({'dataType': 'kml', 'dataLocation': 'locations.kml'});
            });
          </script>
    
      </body>
    </html>

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,173
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    If I run your code from my desktop, I get two errors. Two files are not found:

    /templates/kml-infowindow-description.html
    /templates/kml-location-list-description.html

    Not sure how it all works, but make sure those files are accessible online.

  3. #3
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    If I run your code from my desktop, I get two errors. Two files are not found:

    /templates/kml-infowindow-description.html
    /templates/kml-location-list-description.html

    Not sure how it all works, but make sure those files are accessible online.
    How would I link the to files on my current script? If open it in DW I get this. They're not JS files. Thank you for your help.

    kml-infowindow:
    Code:
    {{#location}}
    <div class="loc-name">{{name}}</div>
    <div>{{{description}}}</div>
    {{/location}}
    kml-location-list-description:
    Code:
    {{#location}}
    <li data-markerid="{{markerid}}">
    	<div class="list-label">{{marker}}</div>
    	<div class="list-details">
    		<div class="list-content">
    			<div class="loc-name">{{name}}</div>
    			<div>{{{description}}}</div>
    		</div>
    	</div>
    </li>
    {{/location}}

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,173
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    I'd say go back to the docs for that plugin, as the code above is meaningless on its own. A step must have been missed somewhere, as you shouldn't be stuck with a problem like this.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •