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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:52:59+00:00 2026-05-24T10:52:59+00:00

this has been baking my noodle for months, I’ll be honest, I am a

  • 0

this has been baking my noodle for months, I’ll be honest, I am a designer not a programmer so this type of scripting is a bit harder than the average jquery/javascript that I’m used too.

I can’t find any basic documentation on how to implement it, apart from this but it’s not massively intuitive – http://jquery-ui-map.googlecode.com/svn/trunk/demos/jquery-mobile-example.html

I’ve tried making a JSfiddle, but I can’t even get it to work (now working thanks to Tsar)

I’ve built a jQuery mobile app and I’m desperate to get the geo-location functionality working with fusion table markers (from my fusion table) and to be allowed to click on the fusion table markers to reveal a info window. This info window will be constructed in fusion tables.

I need the geo-location to center the map on the devices current location – if the geo-location is not available or denied by device user, then the map needs to be centered on these co-ordinates 52.450939, -1.721002.

What would be the next level is to have the the jQuery mobile UI pop-up window but this is not critical, just the standard bubble on the map is fine.

A updated JSFiddle… http://jsfiddle.net/twGHC/30/

My fusion table number is: 1260763

Default location is: (only if Geo location is not available) 52.450939, -1.721002

Zoom level: 13

Any advice would be awesome, please feel free to JSfiddle it. Thanks in advance.

  • 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-24T10:52:59+00:00Added an answer on May 24, 2026 at 10:52 am

    Here’s a working solution, which detects user’s location, drops a marker on it and plots the map with your Fusion Markers. As per Google Maps v3 API documentation:

    $(function() {
      var position = new google.maps.LatLng(52.450939, -1.721002);
    
      getCurrentPosition = function(callback) {
        // Try W3C Geolocation (Preferred)
        if(navigator.geolocation) {
          navigator.geolocation.getCurrentPosition(
            function(pos) {
              position = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude);
                callback(position);
              }, callback(position));         
        } // Try Google Gears Geolocation
        else if (google.gears) {
          var geo = google.gears.factory.create('beta.geolocation');
          geo.getCurrentPosition(
            function(pos) {
              position = new google.maps.LatLng(pos.latitude,pos.longitude);
              callback(position);
            }, callback(position));          
        } // Browser doesn't support Geolocation
        else {
          // Drop the user off in Coventry =)
          callback(position);
        }
      };
         // call the above function
      getCurrentPosition(InitMap);
    });
    
    function InitMap(pos) {
      map = new google.maps.Map(document.getElementById('map_canvas'), {
        center: pos,
        zoom: 14,
        mapTypeId: 'roadmap'
      });
    
      var marker = new google.maps.Marker({
        position: pos, 
        animation: google.maps.Animation.DROP,
        map: map, 
        title: "You are here, mate!"
      });   
    
    var layer = new google.maps.FusionTablesLayer({
      query: {
        select: 'Geocodable address',
        from: '1260763'
        },
      });
    
      layer.setMap(map);
    };
    

    When user denies tracking of his location, exception is caught in getCurrentPosition, however, 2nd optional parameter in this function is an exception handler, so what I did is simply passed in callback(position) so that default location sets on the map. If you don’t want to do it, move out the map initializer code from InitMap into separate function and call it instead, when exceptions are caught, to display a blank map.

    See it in action here: http://jsfiddle.net/twGHC/36/

    P.S. In case your next question is “how to add a balloon pop-up on marker click”, here’s what you need to do.

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

Sidebar

Related Questions

Okay, so this has been baking my noodle for a little while now. I
This has been driving me nuts. I hope it's not been asked before but
this has been an ongoing problem with me, ive been trying to make a
This has been a massive headache. We use Ning as a our platform for
This has been frustrating me for a while now. I started developing a site
This has been a rather problematic issue on numerous occasions. We have alot of
This has been driving me crazy for the past few minutes I have a
This has been one of the biggest obstacles in teaching new people ColdFusion. When
This has been driving me nuts. I keep getting the following exception System.InvalidOperationException: The
This has been bothering me lately- when I use some code like below to

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.