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

  • DesignerJordan
    do I need a bleed if...
    DesignerJordan
    Hi guys!! I have a product header card project im working on and both sides are 4in x 4in so im doing them both together on an 8.5 x 11 sheet. I think I heard or read somewhere that you dont need a bleed...
    Today, 01:01 AM
  • creare
    image logo small company computer repair informal group
    creare
    image / logo for a small computer repair company also domicile , image to put near their name , but it is an informal Group. ...
    Yesterday, 10:38 PM
  • edz
    Reply to Hello all!
    edz
    Ahhh.... I was wondering why my replies weren't appearing... I replied twice on my thread lol - oops.... off to read the rules
    Yesterday, 08:44 PM
  • edz
    Reply to Flyer looking for improvements
    edz
    Firsly, thanks taking the time to look at my post, let alone the constructive critique



    In reply to your points:
    1) These are actually 3 different brides... maybe I...
    Yesterday, 08:37 PM
  • LGWV
    New to the graphic design scene
    LGWV
    Hey all, i'm a high school student hoping to get involved with graphic design so i started researching it and felt overwhelmed. Is there a general place i should start? and is there any advice you guys...
    Yesterday, 08:11 PM
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