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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:19:40+00:00 2026-06-06T17:19:40+00:00

i am using gmaps.js (https://github.com/hpneo/gmaps) I want to add a Marker on the map

  • 0

i am using gmaps.js (https://github.com/hpneo/gmaps)

I want to add a Marker on the map on clicking a location on the map. If a user clicks on a second location the previous marker should move to the new place or be removed and replaced with a new marker.

Now sure if this is supported by the Lib.

http://bakasura.in/startupsradar/add.html

$(document).ready(function () {
    var map = new GMaps({
        div: '#map',
        lat: 13.00487,
        lng: 77.576729,
        zoom: 13
    });

    map.addMarker({
        lat: 13.00487,
        lng: 77.576729,
        title: 'Mink7',
        infoWindow: {
            content: 'HTML Content'
        }
    });
    /*
    GMaps.geolocate({
        success: function (position) {
            map.setCenter(position.coords.latitude, position.coords.longitude);
        },
        error: function (error) {
            alert('Geolocation failed: ' + error.message);
        },
        not_supported: function () {
            alert("Your browser does not support geolocation");
        },
        always: function () {
            //alert("Done!");
        }
    });
    */
});
  • 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-06-06T17:19:41+00:00Added an answer on June 6, 2026 at 5:19 pm

    Personally, I do it using a global variable for the marker (or an array if I need more markers and I want to access them later), so that I can delete it and recreate it somewhere else.

    // instantiate your var map
    // ...
    
    google.maps.event.addListener(map, "click", function(event) {
        if(markermap) {
            markermap.setMap(null);
        }
    
        markermap = new google.maps.Marker({
            position: event.latLng,
            map: myMap,
            title: "myTitle"
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using gmaps.js plugin http://hpneo.github.com/gmaps/ The Sliding Zoom Control and the InfoWindow don't
I'm using GMaps V3 with MarkerClusterer from http://code.google.com/p/gmaps-utility-library-dev/ Markers displayed on the map are
I got a static map link using this wizard http://gmaps-samples.googlecode.com/svn/trunk/simplewizard/makestaticmap.html and the marker is
I've built a map using the GMaps API with custom markers. On my PC
I am using the jquery-ui-map plugin (http://code.google.com/p/jquery-ui-map/). I have successfully created a map using
I am using http://code.google.com/p/jquery-ui-map/ HTML: <div id=map_canvas style=width: 100%; height:400px; latitude=123456 longitude=123456>Loading Map</div> jQuery
We are using GMaps with a KML feed to display locations on a map.
I'm trying to create a growth map similar to http://projects.flowingdata.com/walmart/ . I am using
Im having problem's adding map markers to gmaps using jquery. Here is my code
I'm trying to replicate the following exemple : http://www.leigeber.com/2008/04/map-your-users-using-the-google-maps-api-and-php/ How to integrate this PHP

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.