Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 153433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:48:00+00:00 2026-05-11T09:48:00+00:00

I added a google map with two markers (i am just testing), the code

  • 0

I added a google map with two markers (i am just testing), the code is:

function load() {      var map = new GMap2(document.getElementById('map'));       var marker = new GMarker(new GLatLng(<%=coordinates%>));     var marker2 = new GMarker(new GLatLng(31.977211,35.951729));     var html='<%=maptitle%><br/>' +          '<%=text%>';     var html2='<img src='simplemap_logo.jpg' width='20' height='20'/> ' +          '<%=maptitle%><br/>' +          '<%=text%>' + 'Alper';     map.setCenter(new GLatLng(<%=coordinates%>), 5);     map.setMapType(G_HYBRID_MAP);     map.addOverlay(marker);     map.addOverlay(marker2);     map.addControl(new GLargeMapControl());     map.addControl(new GScaleControl());     map.addControl(new GMapTypeControl());       marker.openInfoWindowHtml(html);     marker2.openInfoWindowHtml(html2);     } 

The problem is, only one markers text is showing (the white triangle with text inside it) the other is not visible, why? Another thing, i have a table of Maps, its like: mapID, mapCoordinates, mapMarkerTitle, mapMarkerText, i can retrieve this table, but i want a way to be able to pass all its records to my javascript and create a Marker for each Map i have in my table, i know this is two much, but can anyone suggest or help me with the code? as i know nothing about javascript 😀

The HTML OUTPUT is:

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>  <html xmlns='http://www.w3.org/1999/xhtml'> <head><title>     Untitled Page </title>     <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAANgu3GlobW5KtQorgXrnJ_xTHM4EYhrvsce8mdg4KdiCoPfCQKxSOZ_5sjy4O31twg6cxfZqam24TCw'       type='text/javascript'></script>      <script type='text/javascript'>       function load() {      var map = new GMap2(document.getElementById('map'));       var marker = new GMarker(new GLatLng(32.523251,35.816068));     var marker2 = new GMarker(new GLatLng(31.977211,35.951729));     var html='maen<br/>' +          ' maen tamemi';     var html2='<img src='simplemap_logo.jpg' width='20' height='20'/> ' +          'maen<br/>' +          ' maen tamemi' + 'Alper';     map.setCenter(new GLatLng(32.523251,35.816068), 5);     map.setMapType(G_HYBRID_MAP);     map.addOverlay(marker);     map.addOverlay(marker2);     map.addControl(new GLargeMapControl());     map.addControl(new GScaleControl());     map.addControl(new GMapTypeControl());        marker2.openInfoWindowHtml(html2);     marker.openInfoWindowHtml(html);     }      //]]>     </script>      <script type='text/javascript'>        function pageLoad() {       }      </script>  </head> <body onload = 'load()'>     <form name='form1' method='post' action='Xhome.aspx' id='form1'> <div> <input type='hidden' name='__VIEWSTATE' id='__VIEWSTATE' value='/wEPDwUJNDI5NDcxNTY4ZGTjxbb38769ZB2N9Ow9kAzPz2PIqA==' /> </div>      <div id='map' style='width:400px;height:300px' >      </div>     </form> </body> </html> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:48:01+00:00Added an answer on May 11, 2026 at 9:48 am

    In response to the second part of your question:

    i want a way to be able to pass all its records to my javascript and create a Marker for each Map i have in my table

    I have (as an example – written a year or so ago) the following code:

    In the code-behind I have something like this (c# I’m afraid):

    [WebMethod] public LatitudeLogitudeMessage[] GetPoints(string postCodes) {     string[] postCodeArray = postCodes.Split(','.ToCharArray());      LatitudeLogitudeMessage[] pointArray =                     new LatitudeLogitudeMessage[postCodeArray.Length];     int index = 0;     foreach (string postCode in postCodeArray)     {         pointArray[index] = GetPoint(postCode);         index++;     }      return pointArray; } 

    LatitudeLogitudeMessage is a custom class that looks like this:

    public class LatitudeLogitudeMessage {     public decimal? Latitude { get; set; }     public decimal? Longitude { get; set; }     public string Message { get; set; }     public string Details { get; set; }     public string Address { get; set; }      public LatitudeLogitudeMessage(string addressToFind)     {         Address = addressToFind;         Details = addressToFind.Replace(',', ',<br />');     } } 

    The GetPoint method bascially fills in those details.

    In the code infront I then had:

    PageMethods.GetPoints(address, showPoints); 

    Which calls the GetPoints method on the code behind, and passes the result to showPoints:

    function showPoints(latLongs) {   GLog.write('Showing points');   var points = [];   var latLngBounds = new GLatLngBounds();    for (var i = 0; i < latLongs.length; i++)   {     if ('' == latLongs[i].Message)     {       points[i] = new GLatLng(latLongs[i].Latitude, latLongs[i].Longitude);       var marker =              new GMarker(points[i], {title: latLongs[i].Details, clickable: false});       map.addOverlay(marker);       latLngBounds.extend(points[i]);     }     else     {       GLog.write(latLongs[i].Message);     }   }    if (points.length > 1)   {     var bounds = new GBounds(points);     var center = new GLatLng(          (latLngBounds.getSouthWest().lat()             + latLngBounds.getNorthEast().lat()) /2.,          (latLngBounds.getSouthWest().lng()             + latLngBounds.getNorthEast().lng()) /2.);     var newZoom = map.getBoundsZoomLevel(latLngBounds, map.getSize());     map.setCenter(center, newZoom);   }   else   {     map.setCenter(points[0], defaultZoomLevel);   } } 

    So this takes the array of points, and iterates over them creating a marker as it goes, centering on the first item in the list (not clever, but it worked for me).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 102k
  • Answers 102k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer As you say you want r_id and o_id as the… May 11, 2026 at 8:17 pm
  • Editorial Team
    Editorial Team added an answer If you give each control the same z-index, then you… May 11, 2026 at 8:17 pm
  • Editorial Team
    Editorial Team added an answer The type of the main function should be IO t… May 11, 2026 at 8:17 pm

Related Questions

Well I have a site that uses relative paths for all the URLs. I
A very niche problem: I sometimes (30% of the time) get an 'undefined handler'
I'm currently working on a Google Maps project and am implementing a search function.
I know of the following: The venerable getopt(3) The extended getopt_long glibc's argp parser

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.