Announcement Announcement Module
Collapse
No announcement yet.
Google API Maps Page Title Module
Move Remove Collapse
Search Search Module
Collapse

Advertisement Advertisement Module
Collapse

Featured Images Featured Images Module
Collapse

Mediabistro Creative Sites Mediabistro Creative Sites Module
Collapse
Latest Topics Latest Topics Module
Collapse

  • kemingMatters
    Reply to Logo critique
    kemingMatters
    Call me crazy but green is just one of those colours I don't want to see when I'm thinking about a grilled cheese or comfort food. IMHO I think your first iteration attempt was better and just need a...
    Today, 12:45 PM
  • PrintDriver
    Reply to Final Art Disclaimer
    PrintDriver
    The problem today is many clients and designers consider the printer's proof one more opportunity to proof read. The document you are having printed should be FINAL before it is sent to the printer. The...
    Today, 11:30 AM
  • PrintDriver
    Reply to Design Assignment
    PrintDriver
    A lot of people will not download a PDF from an unknown source. Especially with the recent rash of Cryptoware floating around. You'll get more response if you post an image.
    Today, 11:26 AM
  • PrintDriver
    Reply to Trouble Printing Correctly onto Labels, even with my own Template
    PrintDriver
    most printers have a border that cannot be infringed. Unless you have a borderless printer, you need to account for that. Usually the bottom border is wider than the other three too.

    What...
    Today, 11:23 AM
  • kinner
    Reply to Advice for logo
    kinner
    Guys, thanks a lot for your feedback and comments! Really appreciated!
    Sorry I really don't get it how to quote everybody in one reply only, it keeps copying just one post instead of many.
    Today, 11:14 AM
Advertisement Advertisement Module
Collapse

Sponsors Sponsors Module
Collapse

X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Google API Maps

    Okay... so I've been fighting for a while now to get Google maps up on my sites. I want to do it API way, I already have a key and such.
    I can get the map to show up just fine... but when I try to include a marker (the little balloon) to show the specific location of the restaurant (the websites are all dining) it doesn't seem to work.

    Any suggestions?

    Here is my code...
    </script>

    <script type="text/javascript">

    function initialize() {
    if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map_canvas"));
    var myGeographicCoordinates = new GLatLng(52.876207777, -118.08148384)
    map.addOverlay(marker);

    }
    }

    </script>

    (and of course I have the key script above this, and the div line in the body for the map, yes I have the function turned to On in body as well)
    I'd rather be hated for who I am, than loved for who I am not. ~ Kurt Cobain

  • #2
    you need to put map.addOverlay(new GMarker(myGeographicCoordinates)); instead of map.addOverlay(marker);
    portfolio | daily image | reffee

    Comment


    • #3
      Two-Toe I'm getting excited cause now I can see the marker!!
      But it's not showing in the correct place...
      any ideas?

      <script type="text/javascript">

      function initialize() {
      if (GBrowserIsCompatible()) {
      var map = new GMap2(document.getElementById("map_canvas"));
      map.setCenter(new GLatLng(52.876207777, -118.08148384), 13);
      map.addOverlay(new GMarker(52.876207777, -118.08148384));
      }
      }

      </script>

      (sorry but I've been trouble shooting this for more than 9 hours and have just kinda realized it's over my head a bit in my ability to code in JS. So I really really really appreciate the help)
      I'd rather be hated for who I am, than loved for who I am not. ~ Kurt Cobain

      Comment


      • #4
        how about...

        <script type="text/javascript">

        function initialize() {
        if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        var point = new GLatLng(52.876207777, -118.08148384);
        map.setCenter(point, 13);
        map.addOverlay(new GMarker(point));
        }
        }

        </script>
        portfolio | daily image | reffee

        Comment


        • #5
          BRILLIANT!!!
          I love you. (but don't tell Bladez).
          That is awesom truly thank you!

          Now I just have to work on getting it to do the zoom in, zoom out thing. but I think I know how.
          Again thank you!!!
          I'd rather be hated for who I am, than loved for who I am not. ~ Kurt Cobain

          Comment


          • #6
            No problem! They don't call me the jesus of google APIs around here for nothing
            portfolio | daily image | reffee

            Comment


            • #7
              Okay... new question... (do you hate me yet).
              So I have zoom working and dragging etc.
              It works in Firefox and Safari (I am on a Mac)
              But not in crappy IE... any ideas?
              I'd rather be hated for who I am, than loved for who I am not. ~ Kurt Cobain

              Comment


              • #8
                hmm, how are you doing it? which IE version?
                portfolio | daily image | reffee

                Comment


                • #9
                  here's my code...
                  <script type="text/javascript">

                  function initialize() {
                  if (GBrowserIsCompatible()) {
                  var map = new GMap2(document.getElementById("map_canvas"));
                  var point = new GLatLng(52.876207777, -118.08148384);
                  map.setCenter(point, 14);
                  map.addOverlay(new GMarker(point));
                  map.addControl(new GSmallMapControl());

                  GEvent.addListener( map, "click", function(o,p) {
                  if ( o != null ) return;
                  if ( map.getZoomLevel() > 1 )
                  map.centerAndZoom( p, map.getZoomLevel() - 2 );
                  else if ( map.getZoomLevel() == 1 )
                  map.centerAndZoom( p, 0 );
                  });

                  }
                  }

                  </script>

                  Do I need something special for IE? (I run 5.2 on a MAC)
                  I have to test PC elsewhere cause I don't have one on the weekend...
                  I'd rather be hated for who I am, than loved for who I am not. ~ Kurt Cobain

                  Comment


                  • #10
                    ah, i think the google maps api only supports IE 6.0+ so that's probably why.
                    portfolio | daily image | reffee

                    Comment


                    • #11
                      gotcha.
                      okay. i will just do a check on IE at a different location.
                      Thanks.
                      I'd rather be hated for who I am, than loved for who I am not. ~ Kurt Cobain

                      Comment

                      Mediabistro A division of Prometheus Global Media home | site map | advertising/sponsorships | careers | contact us | help courses | browse jobs | freelancers | content | member benefits | reprints & permissions terms of use | privacy policy Copyright © 2014 Mediabistro Inc. call (212) 389-2000 or email us
                      Working...
                      X