Google Groups Home
Help | Sign in
having some problems with Markers
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Zaid  
View profile
 More options Jul 19 2005, 3:47 pm
From: "Zaid" <zaidk...@gmail.com>
Date: Tue, 19 Jul 2005 12:47:45 -0700
Local: Tues, Jul 19 2005 3:47 pm
Subject: having some problems with Markers
Hi, I have just started using google maps API. I am having some
problems with markers. Can anyone tell me what I am doing wrong? I get
nothing but a blank screen. Here is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <script src="http://maps.google.com/maps?file=api&v=1&key=MY_KEY"
type="text/javascript"></script>
  </head>
  <body>
    <div id="map" style="width: 500px; height: 400px"></div>
    <script type="text/javascript">
    //<![CDATA[

var markers = new Array(  );
var infoHtmls = new Array(  );
var addresses = new Array(  );
//]]>
//<![CDATA[
    var map = new GMap(document.getElementById("SF Map"));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.centerAndZoom(new GPoint(-122.468864,37.710581 ), 6);

    var panel = document.getElementById('SF-City');
    panel.innerHTML += '<dl class="me-resturaunts">;

markers[2] = new GMarker( new GPoint(-122.411582, 37.785992));
infoHtmls[2] = '<h3><a href="http://www.marrakechsf.com/">Marrakech
Resturaunt</a></h3><address>419 O'Farrell Street, San Francisco, CA
94102</address>';
GEvent.addListener( markers[2], 'click', makePopupCaller( 2 ) );
map.addOverlay( markers[2] );
var link = '<a href="javascript:popup( ' + 2 + ' )">';
var html = '<dt>' + link + 'Marrakech Resturaunt' +
'</a></dt>';addresses[2] = '419 OFarrell Street' + ', ' + 'San
Francisco' + ', ' + 'CA' + ' ' + '94102';
panel.innerHTML += html + '<dd>(415) 776-6717</dd>';

     //]]>
    </script>
  </body>

</html>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
braz  
View profile
 More options Jul 19 2005, 4:00 pm
From: "braz" <frank...@braztransfers.com>
Date: Tue, 19 Jul 2005 13:00:24 -0700
Local: Tues, Jul 19 2005 4:00 pm
Subject: Re: having some problems with Markers
Hey. I just had the same problem. Just copy the code below and fill in
my information with yours. also from looking at the code you should be
able to figure out what it is you need to copy and paste just to add
another marker. this is the simplest way i've found for now. hope it
helps.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <script src="YOUR GOOGLE KEY" type="text/javascript"></script>
  </head>
  <body>
    <div id="map" style="width: 1000px; height: 800px"></div>
    <script type="text/javascript">
    //<![CDATA[

var map = new GMap(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.centerAndZoom(new GPoint(-71.100173, 42.381288), 4);
    map.addControl(new GMapTypeControl());

  // var marker = new GMarker(point);
    var marker = new GMarker(new GPoint(-71.100173, 42.381288));
    map.addOverlay(marker);
    var html = "<b>NAME</b><br>NUMBER<br>ADDRESS<br>ZIP";
    GEvent.addListener(marker, "click", function() {
      marker.openInfoWindowHtml(html);
    });

 // var marker = new GMarker(point);
    var marker2 = new GMarker(new GPoint(-71.038404, 42.369901));
    map.addOverlay(marker2);
    var html2 = "<b>NAME</b><br>NUMBER<br>ADDRESS<br>ZIP";
    GEvent.addListener(marker2, "click", function() {
      marker2.openInfoWindowHtml(html2);
    });

//]]>
    </script>
  </body>
</html>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
maps.huge.info  
View profile
 More options Jul 19 2005, 5:38 pm
From: "maps.huge.info" <cor...@gmail.com>
Date: Tue, 19 Jul 2005 14:38:51 -0700
Local: Tues, Jul 19 2005 5:38 pm
Subject: Re: having some problems with Markers
Zaid,

I think you've got your ID wrong in the new GMap statement:

var map = new GMap(document.getElementById("SF Map"));

But the ID of your div is map.

<div id="map" style="width: 500px; height: 400px">

The map wants to get the characteristics of your div area, which I
don't believe is in your code. I suggest changing the "SF Map" to plain
"map" and trying again.

-John

http://maps.huge.info


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zaid  
View profile
 More options Jul 20 2005, 4:06 am
From: "Zaid" <zaidk...@gmail.com>
Date: Wed, 20 Jul 2005 01:06:27 -0700
Local: Wed, Jul 20 2005 4:06 am
Subject: Re: having some problems with Markers
Hey guys, thanks. Both your inputs were very useful. I got it to work.

Thanks,
Zaid


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
quiksilv  
View profile
 More options Jul 20 2005, 8:21 am
From: "quiksilv" <nickt...@gmail.com>
Date: Wed, 20 Jul 2005 12:21:09 -0000
Local: Wed, Jul 20 2005 8:21 am
Subject: Re: having some problems with Markers
great - this really helped me out :D


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google