Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: HELP!! - Google Maps API

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2003
    Posts
    1,524

    HELP!! - Google Maps API

    I'd like to add Google Maps directions to a website. I'd like the destination address to be prepopulated and for the map to be focuses on the destination address on page load.

    Basically, I want to user to be able to enter their home address and press a button for the map to be updated and for directions to be listed to the address that I specify.

    Is this possible?
    Last edited by Jeff; 10-04-2008 at 02:06 PM.

  2. #2
    AMDave's Avatar
    AMDave is offline Seeker of the exit clause Moderator
    Site Admin
    Join Date
    Jun 2004
    Location
    Deep in a while loop
    Posts
    9,659
    straight for the jugular

    this tutorial provides examples:
    http://econym.org.uk/gmap/basic4.htm

    You should also check out the advanced tutorial link on that page which appears to be doing exactly what you want.

    Also for assistance you will benefit from reading the following references:

    directions API reference
    http://code.google.com/apis/maps/doc...tml#Directions

    class GDirections
    http://code.google.com/apis/maps/doc...ml#GDirections

    maps API reference
    http://code.google.com/apis/maps/doc...ion/index.html
    Last edited by AMDave; 10-02-2008 at 09:45 AM.
    . . . . . ___
    . . . . . . .\___/\______
    . . . . . . . \__AMD___\\__
    ---------------------------------------------

  3. #3
    Join Date
    Jul 2003
    Posts
    1,524
    Dave, I'm actually looking for something similiar to this.

    http://code.google.com/apis/maps/doc...-advanced.html

    Of course they don't provide the API code they used to accomplish this. And it requires both a starting and ending address.

  4. #4
    Join Date
    Jul 2003
    Posts
    1,524
    I found exactly what I need.

    http://map.pittwebsite.com/add_drivi...ur_website.htm

    These guys are charging 255 bucks though

  5. #5
    Join Date
    Jul 2003
    Posts
    1,524
    Would someone please take a look at these two sites:

    http://premier.amdusers.com/Untitled-1.html
    http://premier.amdusers.com/Untitled-2.html

    Untitled 1 refuses to load the graphical map - even though I copied the code from Untitled-2.html. Untitled-2.html works fine.

    I've spent probably 3 hours looking at this, and I just can't figure it out. I just don't know why it won't work

  6. #6
    AMDave's Avatar
    AMDave is offline Seeker of the exit clause Moderator
    Site Admin
    Join Date
    Jun 2004
    Location
    Deep in a while loop
    Posts
    9,659
    I have had a look at this and I'm not sure why it is not working properly.
    I see some significant differences in the page properties, like the script is not being loaded or executed properly.
    Just wondering if something from the other google include might be interfering with it, since it works fine in the other page.
    You can try either taking bits out of the page you have to diagnose the problem, or build your page around the working instance bit-by-bit until you hit the issue, then you will know what it is that needs to be resolved.
    . . . . . ___
    . . . . . . .\___/\______
    . . . . . . . \__AMD___\\__
    ---------------------------------------------

  7. #7
    Join Date
    Jul 2003
    Posts
    1,524
    It is weird. The script does work -- sort of. If you type in an address and click the button, it does return the written directions.

  8. #8
    AMDave's Avatar
    AMDave is offline Seeker of the exit clause Moderator
    Site Admin
    Join Date
    Jun 2004
    Location
    Deep in a while loop
    Posts
    9,659
    Yeah, but the map call is not working.
    I cannot see the "media" in the FF page properties like the other page.
    . . . . . ___
    . . . . . . .\___/\______
    . . . . . . . \__AMD___\\__
    ---------------------------------------------

  9. #9
    Join Date
    Mar 2007
    Location
    sydney australia
    Posts
    584
    these a second style tag about about half way though source
    <style type="text/css">
    @import url(http://www.google.com/cse/api/overlay.css);
    </style>
    shouldn't that be included in first style or excluded ?
    <style type="text/css">
    .p1 { position: relative; left: 550px; top: 23px; z-index: 3; }
    body { margin:0px;padding:0px;
    background-color: #ffffff;
    background-image: url(images/bg_gradient.jpg);
    background-repeat: repeat-x;
    background-position: top center;
    }
    .tbl1
    {
    background: url('images/MAINCONTENT.jpg');
    background-repeat: no-repeat;
    }
    .style1 {font-family: Arial, Helvetica, sans-serif}
    .style3 { font-family: Arial, Helvetica, sans-serif;
    color: #00465e;
    }
    </style>

  10. #10
    Join Date
    Jul 2003
    Posts
    1,524
    As it turns out, there were two onload function calls.

    Thanks everyone!

Page 1 of 2 12 LastLast

Posting Permissions

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