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

  • SEARCH
  • Home
  • 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 7011271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:06:21+00:00 2026-05-27T22:06:21+00:00

I am Using Google maps api v3 and want to make markers using loop

  • 0

I am Using Google maps api v3 and want to make markers using loop in JS on also display the data on infowindow from Db.I want to make markers on map as i add row into DB.
The work have i done fot this is bellow but i unable to Compelete my target.

<%  Dim con As New OleDbConnection
        con = New OleDbConnection("Data Source=sml; User ID=sml; Password=sml; provider=OraOLEDB.Oracle")
        con.Open()
        Dim cmd As OleDbCommand = New OleDbCommand("Select STA_NAME, GPS_ONE from GPS", con)

        Dim ds As New DataSet
        Dim I As Long
        Dim da As New OleDbDataAdapter(cmd)
        da.Fill(ds, "GPS")
        For I = 0 To ds.Tables("GPS").Rows.Count - 1
            Dim GPS As String = ds.Tables("GPS").Rows(I).Item("GPS_ONE")
        Next

        %>

And JS code in map function to make marker

var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

var infowindow = new google.maps.InfoWindow();


var GPS='<%=GPS %>'

var Infowindow=GPS

var image = 'ico/Ch.png';
var LatLng = new google.maps.LatLng(GPS);
var marker0 = new google.maps.Marker({
    draggable: true,
    position: LatLng,
    map: map,
    icon:image,
    title:""

});

google.maps.event.addListener(marker0, 'click', function() {
infowindow.setContent(Infowindow);
  infowindow.open(map,marker0);

});

Through this code i am unalbe to make even one marker.I want to create marker on map as i add GPS in DB Column

  • 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-27T22:06:22+00:00Added an answer on May 27, 2026 at 10:06 pm

    google.maps.LatLng requires two arguments. You are using one: GPS. Since you don’t say what the value of GPS looks like, this should get you started.

    replace:

    var GPS='<%=GPS %>'
    

    with:

    var GPS = '<%=GPS %>'.replace(/ /g, '').split(',');
    

    replace:

    var LatLng = new google.maps.LatLng(GPS);
    

    with:

    var LatLng = new google.maps.LatLng(GPS[0], GPS[1]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the Google Maps API v2. I add markers to the map and
I want to draw multiple circles on a map, using the Google Maps API
I'm using the Google Maps API to build a map full of markers, but
Using the google maps API (v3) I can successfully add an array of markers
I'm using the Google Maps API and have added markers. Now I want to
It seems that licensing terms would prevent us from using Google Maps API in
With the Google Maps Flash API, I want to add an event listener which
I am using Google Maps JavaScript API v3. I want to wire up to
I'm developing a map application in Android. I'm using Google maps API to show
I want to remove an individual marker from Google map. I am using version

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.