Page 1 of 2 12 LastLast
Results 1 to 15 of 27

Thread: Google Maps On Your Detail Page

  1. #1
    Join Date
    Jul 2003
    Posts
    128

    Thumbs up Google Maps On Your Detail Page

    <embeded> Google Map </embeded> on your detail page.

    Geocoder takes the address input and

    Code:
    <script src="http://maps.google.com/maps?file=api&v=2&key=abcdefg"
          type="text/javascript"></script>
    Code:
    <script type="text/javascript">
    
        //<![CDATA[
    
       var geocoder;
       var map;
    
       var address = "<%$street%> <%$city%> <%$province%> <%$postal%>";
    
    
       function load()
       {
          map = new GMap2(document.getElementById("map"));
          map.addControl(new GSmallMapControl());
          map.addControl(new GMapTypeControl());
          geocoder = new GClientGeocoder();
          geocoder.getLocations(address, addToMap);
       }
    
    
       function addToMap(response)
       {
          place = response.Placemark[0];
          point = new GLatLng(place.Point.coordinates[1],
                              place.Point.coordinates[0]);
    
          map.setCenter(point, 13);
          marker = new GMarker(point);
          map.addOverlay(marker);
       }
    
    
        //]]>
        </script>
    Code:
    <body onload="load()" onunload="GUnload()">
    Code:
    <div id="map" style="width: 370px; height: 270px"></div>
    Sample Ad: Calgary Business Directory : Carmen's Meat & Deli (phone: (403) 946-0223)

    WANT A YAHOO DIRECTIONS FORM ON YOUR SITE??
    http://www.nicecoder.com/community/b...html#post22561
    Last edited by gspinney; 03-29-2007 at 01:35 PM. Reason: ADDED YAHOO LINK

  2. #2

    Default

    Thanks !

  3. #3
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    Good job, only works in the USA though
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  4. #4
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Link points to a crappy parking page now, it should be deleted.

  5. #5
    Join Date
    Jul 2003
    Posts
    128

    Exclamation

    Quote Originally Posted by Bruceper View Post
    Link points to a crappy parking page now, it should be deleted.
    The site was down for a while, now it's back up.. so your crappy parking page has been removed.


    Calgary Business Directory : Krispy Kreme Doughnuts (phone: 403-590-6570)
    Last edited by gspinney; 08-10-2008 at 08:20 PM.

  6. #6
    Join Date
    Jul 2006
    Posts
    73

    Default

    Can you help clarify a few things for me? In your first post, you have three separate codes. Do these go in three separate files? If not, then why are they separated, instead of just being on longer code?

    Thanks,

    Greg



    EDIT: Never mind, figured it out. Created the custom fields, and just pasted the above code as one long continuous code, and all is well!
    Last edited by enginerunup; 06-24-2007 at 04:33 PM.
    Version 5.4.0
    Paid Single Domain
    Auto Directory
    Airline Forum, Pictures and Videos

  7. #7
    Join Date
    Jul 2006
    Posts
    73

    Default

    Does anyone know of a way to show more than one Google map on a single page. I was looking into creating a map on the rows page, similiar to the thumbnail mod, but I can only get one map to show up.
    Version 5.4.0
    Paid Single Domain
    Auto Directory
    Airline Forum, Pictures and Videos

  8. #8
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    you can have more than 1 map, but it means duplicating the code, it would slow down the page a lot, i dont think it would be worth doing because of that.

    copy all the code the same as 1 map, but change :

    map = new GMap2(document.getElementById("map"));
    to

    map = new GMap2(document.getElementById("map2"));

    and then change the div tag to <div id=map2>

    thats just for curiosity... really dont recommend it!
    Last edited by inspireme; 06-25-2007 at 07:08 PM.
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  9. #9
    Join Date
    Jul 2006
    Posts
    73

    Default

    That's good to know. I was wanting to have a map on the links that show when you click a category. So it would be in rows.html, where the code is only written once, so trying to figure out how to get a mini map to show up next to each link, just like we have with the website thumbnail next to each link. Any ideas?
    Version 5.4.0
    Paid Single Domain
    Auto Directory
    Airline Forum, Pictures and Videos

  10. #10
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    I have a couple of questions about his addon....

    1. Does the code above still work???
    2. Do you just take all the code, put it together, and then place it in the details.php page where you want the map show?
    3. I'm assuming that the custom fields created are just text fields and instead of using %province%, I can use %state%??
    4. What happens if some of my links wont have any information in the custom fields, is there a way to show just a default Google Map of a specific location I choose, or will an error be shown on the page?

    Thanks in advance!

  11. #11
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    Does anyone know the answers to my questions above?

  12. #12
    Join Date
    Jul 2003
    Posts
    128

    Default

    Quote Originally Posted by FSGDAG View Post
    I have a couple of questions about his addon....

    1. Does the code above still work???
    2. Do you just take all the code, put it together, and then place it in the details.php page where you want the map show?
    3. I'm assuming that the custom fields created are just text fields and instead of using %province%, I can use %state%??
    4. What happens if some of my links wont have any information in the custom fields, is there a way to show just a default Google Map of a specific location I choose, or will an error be shown on the page?

    Thanks in advance!
    I placed it into my detail_link.html not the php.

    As far as working... last time I look at my website it was.

    Calgary Business Directory : Corporate Registry Services & Trade Mark Agents (phone: (403) 234-0844)

    of using %province%, I can use %state%?? Of course you can. My website is geared for Canada, so I use province.

    as long as %state% = Texas or whatever in order to bring the map up.

    %address%, %state%, %zip%
    405 Bowen Road, Texas, 76012

    405 bowen rd texas 76012 - Google Maps
    Last edited by gspinney; 07-15-2007 at 04:33 AM.

  13. #13
    Join Date
    Jul 2003
    Posts
    128

    Default

    Calgary Business is done... not sure if it's for good or not.

    But if you want to see the code in action... visit www.YakimaBusiness.com a mirror to my site and uses the google maps on the listing pages.

  14. #14
    Join Date
    May 2007
    Location
    NJ, United States
    Posts
    1,651

    Default

    gspinney...

    I know this is slightly off topic, but I noticed on YakimaBusiness.com you have weather info in your right block... Can you tell me how you did that??? I started a thread on it a little ways back here :

    http://nicecoder.com/community/showthread.php?t=5039

  15. #15
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    It's local weather for Yakima, not like you wanted to do it per users location.

    He is using one of the scripts from http://support.hamweather.com/dload.php

Similar Threads

  1. Google Maps
    By AnnaBella in forum Blocks and Modification
    Replies: 19
    Last Post: 05-17-2007, 05:36 AM
  2. Google maps prob
    By alfo in forum v5.x
    Replies: 8
    Last Post: 09-20-2006, 08:08 AM
  3. Detail Page
    By hdraye in forum v5.x
    Replies: 3
    Last Post: 07-19-2006, 06:12 AM
  4. top 5 in detail page
    By landuyt in forum v5.x
    Replies: 11
    Last Post: 06-03-2005, 02:53 AM

Posting Permissions

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