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

Advertisement Advertisement Module
Collapse

Latest Topics Latest Topics Module
Collapse

  • NostalgiaSeeker
    Reply to Why do people devalue graphic designers?
    NostalgiaSeeker
    Yeah I understand what you guys are saying. :3 I know I'm more than just someone who thinks they can call themselves a designer just because they make pretty work. I actually get minor headaches when...
    Today, 07:23 PM
  • NostalgiaSeeker
    Reply to Critique for my business card
    NostalgiaSeeker
    Thanks for the advice. What if I take the logo on the back, center the words and add white space to both sides? Like add white space on the top right corner since I'm printing them in matte so they...
    Today, 07:17 PM
  • B
    Reply to Critique for my business card
    B
    It's a nice logo, but placing it on the same card three separate times seems like two too many times.
    Today, 07:09 PM
  • tifdesignart
    Macbook Air 11" or Macbook Air 13"?
    tifdesignart
    Hi guys!

    I have an iMac at home as my primary computer but I'm going to take a few design courses in the next few months. So the courses I'll be taking are going to be design related: web...
    Today, 04:39 PM
  • B
    Reply to How do you collect design inspiration?
    B
    I gave up on that years ago. Every now and again I'll come across something that's so interesting that I want to keep it -- not really for inspiration, but mostly just because I like it.

    ...
    Today, 04:12 PM

Powered by mediabistro.com
Mediabistro Creative Sites Mediabistro Creative Sites 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 © 2015 Mediabistro Inc.
                      Working...
                      X