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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:21:14+00:00 2026-06-17T08:21:14+00:00

I am using Drupal 7 – Location, GMap module. I have a view that

  • 0

I am using Drupal 7 – Location, GMap module. I have a view that renders the result in a gmap. Everything works fine here and I get all the markers. Now I need a Find My location button which shows the users current location and adds a marker to the existing map.
Google Map Api V3 always works on a newly created map and I couldn’t find a function which returns an existing map in the current page.

Gmap module provides a JS function – Drupal.gmap.getMap(‘ur-map-id’) which is supposed to return a pointer to the map whose id is given. But this did not work.

Could someone please guide me as to how I should go about this? Can I get it work with Google Maps API? I need to retain the original map with all its markers.

  • 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-17T08:21:15+00:00Added an answer on June 17, 2026 at 8:21 am

    I am having this issue as well, you can put this jquery code in for it to actually centre around your current location – but no marker is added. Just add it anywhere in your theme,

    jQuery(document).ready(function() {
    
    jQuery(function($) {
    $.extend({
    initialize: function () {
    var m = Drupal.gmap.getMap('auto1map');
    if (m.map && m.markersready) {
    $.setCoords();
    }
    else {
    m.bind('markersready', function(data) {
    $.setCoords();
    });
    }
    },
    setCoords: function () {
    navigator.geolocation.getCurrentPosition(function (position) {
    var gmap = Drupal.gmap.getMap('auto1map').map;
    var lat = position.coords.latitude;
    var lng = position.coords.longitude;
    gmap.setCenter(new google.maps.LatLng(lat, lng));
    gmap.setZoom(13);
    });
    }
    });
    $.initialize();
    });
    
    });
    

    Now you can centre your map around your location and now I need to figure out a way to place a marker down at this location.

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

Sidebar

Related Questions

I'm using Drupal 6. I have a custom view that needs to be filtered
I'm using Drupal 6 with the Views module. I have a view with an
I am using drupal 7 with apachesolr module. I have an external file field
I'm using Drupal and I notice that if I have my CSS files aggregated
I'm using drupal, with a chat module that creates divs for each chat. Because
I'm using Drupal . I have a module which loads a form onto a
I'm using Drupal and I have a list of items (View with many nodes)
I am using Drupal 7 with TinyMCE via the Wysywig module. I have enabled
I'm using Drupal 6 and have a view with a field having the taxonomy
I've been using Drupal for a long time, and know that it's robust and

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.