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 4006438
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:30:54+00:00 2026-05-20T08:30:54+00:00

I cant find the way to create overlays on the static google map through

  • 0

I cant find the way to create overlays on the static google map through database. I can acheive the a single marker(location) easily. below is the code:

int mapID = Convert.ToInt16(hdnMapID.Value);
SqlDataReader dr = Maps.GetMapPointsByMapIDUserID(mapID, userID);

   string latitude = "53.615143";
   string longitude = "-1.711380";
    string center = "" + latitude + "," + longitude + "";
    string zoom = "20";
    string size = "512x512";
    string maptype = "roadmap";

    while (dr.Read())
    {


            map2.ImageUrl = "http://maps.google.com/maps/api/staticmap?center=" + center + "&zoom=" + zoom + " &size=" + size + "&maptype=" + maptype + "&markers=color:blue|label:S|" + dr["lat"] + ", " + dr["lng"] + "&sensor=true";
        }



        cnt++;
    }
    dr.Dispose();

In the above url, its easy to pass marker value (color:blue|label:S|”+ dr[“lat”] + “,” + dr[“lng”] +) for a single location, but in my project I have got multiple locations and I cant find a way to create different urls for multiple locations for instance if there are two locations there will be 2 markers in the above url, how can I create programatically google static url depending on the numbers of markers(overlays) present in the map.

Any tutorial or help will be highly appreciated

  • 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. Editorial Team
    Editorial Team
    2026-05-20T08:30:54+00:00Added an answer on May 20, 2026 at 8:30 am

    Edition of the post #1 by M’vy

    Ok. I think I got the point. So I edit the answer to use the code snippet.
    The following code has to be used for ONE mapId

    int mapID = Convert.ToInt16(hdnMapID.Value); 
    /* I suppose this executes the following SQL query : 
     * SELECT lat, lng FROM Table WHERE mapID = :mapID;
     */
    SqlDataReader dr = Maps.GetMapPointsByMapIDUserID(mapID, userID);
    
    string latitude = "53.615143";
    string longitude = "-1.711380";
    string center = "" + latitude + "," + longitude + "";
    string zoom = "20";
    string size = "512x512";
    string maptype = "roadmap";
    
    /* This is the basic link, with no markers */
    string URLStart = "http://maps.google.com/maps/api/staticmap?center=" +
    center + "&zoom=" + zoom + " &size=" + size + "&maptype=" + maptype + "&sensor=true";
    
    string markersStr = "";
    
    /* Each record we will read correspond to one point on the map: 
     * NB you don't need the markerID 
     * We add each point long and lat to the string */
    while (dr.Read()) {
        markersStr += "&markers=color:blue|label:S|" + dr["lat"] + ", " + dr["lng"] + ;
    }
    
    map2.ImageUrl = URLStart + markersStr;
    dr.Dispose();
    
    //Then display the map with the URL that has all the point for mapId
    

    The markerId is of no use. You can easily compute the value by using
    SELECT COUNT(*) FROM Table WHERE mapID = 581;


    First Post

    Hello Muhammad,

    You can find your answer in the Google Map Static API here

    For multiple markers, you just have to repeat the markers parameter in the URL.
    You can choose a different color, name etc. Just append a new &markers=<blah blah>

    M’vy

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

Sidebar

Related Questions

i can't find a way to do multiple row tabs with ASP.net ajax tab
I can't find a way to read resource values in a controller
For some reason I can't find a way to get the equivalents of sqlite's
Well, it seems simple enough, but I can't find a way to add a
I can't seem to find any way to add a horizontal separator in a
I've done some research and I can't really find a preferred way to do
I can't for the life of me find a way to make this work.
I can't seem to find an easy to use, .net native way to get
I am trying my hardest to find the simplest way to create a basic
I can't find a way to set the default hydrator in Doctrine. It should

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.