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

  • J4v3rt
    Logo for coaching business
    J4v3rt
    Hello,

    Logo for my life-coaching company.
    Any help is greatly appreciated.
    Honest and constructive critique is also very important for me.

    Why butterflies?
    ...
    Today, 06:01 PM
  • Mr.Mag00
    Missing fonts...
    Mr.Mag00
    I'm running Windows 8.1 on a high-end computer. Suddenly the drop-down list of fonts in Illustrator CC has changed! Many or all of the fonts I need, are missing, and there are lots of other fonts in...
    Today, 05:17 PM
  • Mr.Mag00
    Reply to Gaussian blur changing with image size!
    Mr.Mag00
    There are holes in my knowledge. I am quite disorganized. I'm severely dyslexic... so when I run into a roadblock, I just do whatever I can to get around it... even if it means using something like...
    Today, 04:49 PM
  • BOXED
    Would appreciate some feedback on logo
    BOXED
    Starting a new project website for print designers!

    I want to share the latest news on design trends, tips, tutorials, free print design templates. I want to focus purely on the print design...
    Today, 03:41 PM
  • alansmms
    Finding good music theme for website developing even if have to buy rights….
    alansmms
    I’m trying to get hold of good music theme/themes for my site. But I having a hard time finding music that fit even paid stuff. Hope someone here can help with leads to place that have it.
    ...
    Today, 03:10 PM

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