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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:58:25+00:00 2026-06-13T07:58:25+00:00

http://rickgutierrez.bol.ucla.edu/map_mobile6.htm I am working on a mobile map using google maps API and JQuery

  • 0

http://rickgutierrez.bol.ucla.edu/map_mobile6.htm

I am working on a mobile map using google maps API and JQuery Mobile v1.2. I stored spatial data (the bikeway polyline layer and the bike rack point layer) in google fusion tables and displayed them on the map. I would like to toggle each layer on/off using the bike and park anchors in the JQuery navbar. I have exeperience toggling layers on/off with checkboxes on desktop maps but prefer the look and size of the navbar toggling for the mobile map.

My ideal functionality would be for the map to load with the bike layer on and the bike portion of the navbar darker to denote that it is selected, just like on other web apps. A user can use the map to find safer biking routes with bike layer then turn on the bike parking layer at their destination to find a place to lock their bike. Each layer can be toggled on and off independently.

I tried pasting the code in here but it was a mess. Please look review my source code at the above link. I am a novice at coding and would appreciate any help. Thanks in advance.

Update: I guess someone commented that if geolocation is denied the map does not work. here is the geolocation code:

// allow iPhone or Android to track movement
        if ( useragent.indexOf('iPhone') !== -1 || useragent.indexOf('Android') !== -1 ) {
            navigator.geolocation.watchPosition( 
                displayLocation, 
                handleError, 
                { 
                    enableHighAccuracy: true, 
                    maximumAge: 30000, 
                    timeout: 27000 
                }
            );          

        // or let other geolocation capable browsers to get their static position
        } else if ( navigator.geolocation ) {
            navigator.geolocation.getCurrentPosition( displayLocation, handleError );
        }

How do I fix that? I am guessing that I need to put some backup coordinates into the else statement?

  • 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-13T07:58:26+00:00Added an answer on June 13, 2026 at 7:58 am

    Add a google.maps.event.addDomListener listening for a click event to the elements that you want to perform the toggle. In the function associated with that listener add your code to toggle the layer.

    I would suggest:

    if (layer.getMap() == null) layer.setMap(map); else layer.setMap(null);
    

    where “map” is a reference to your google.maps.Map object.

    Working example

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

Sidebar

Related Questions

http://rickgutierrez.bol.ucla.edu/map_mobile6.htm The map is set up to load centered on the users current location.
http://tinyns.com/wtf.php I'm using jQuery Typist to display server benchmarks results. I have the results
http://www.dorsetdesigns.co.uk/contact.html try the form it wont send a email to me. i am using
http://jsfiddle.net/motocomdigital/uTV5k/18/ I've updated using toggle instead on click - though still can't get smooth
http://www.radikalgenc.com/bulten/ekim.htm this is a monthly newsletter. but it does not appear fine on mozilla,
_http://www.mscui.net/PatientJourneyDemonstrator/PrimaryCare.htm I want to create/design the similar to above site/url using silverlight. For this
http://tinkerbin.com/pla4NzJ9 I've created a tiny demo, where a backbone view is instantiated and using
http://jsfiddle.net/9BCrs/5/ I have this set up to load a file into a DIV using
http://www.novaprojecten.nl/roosters/lbl/basis/38/c/c00086.htm i'm trying to parse the table seen there... what i want is to
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Static_and_Global_Variables Static or global variables of class type are forbidden: they cause hard-to-find bugs

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.