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

The Archive Base Latest Questions

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

I am trying to add a google map to my android tablet to detect

  • 0

I am trying to add a google map to my android tablet to detect where the terminal is.But the map is not displayed completely. only a small part was displayed. and after rotate the screen, it can displayed perfectly.
I did all this according to http://www.digitalnoiz.com/mobile-development/geolocation-jquery-mobile-maps/
This is my html code:

 <head>
        <link href='stylesheets/jquery.mobile-1.1.0.css' rel='stylesheet' />
        <link href='stylesheets/my.css' rel='stylesheet' />
        <script charset='utf-8' src='javascripts/jquery/jquery-1.7.1.min.js' type='text/javascript'></script>
        <script charset='utf-8' src='javascripts/jquery.ui.map.min.js' type='text/javascript'></script>
        <script charset='utf-8' src='http://maps.google.com/maps/api/js?sensor=true' type='text/javascript'></script>
        <script charset='utf-8' src='javascripts/application.js' type='text/javascript'></script>
        <script charset='utf-8' src='javascripts/jquery/jquery.mobile-1.1.1.js' type='text/javascript'></script>
    <script type="text/javascript" charset="utf-8" src="javascripts/phonegap/cordova-2.0.0.js"><\/script>
    </head>
    <body>
     <!-- Diagnostic -->
        <div data-role='page' id='diagnostic_page'>
          <div data-position='inline' data-role='header' data-theme='a'>
            <h2>
              Diagnostic
            </h2>
            <a data-icon='arrow-l' href='#index_page'>
              Back
            </a>
            <a data-role='button' href='#diagnostic_page' id='PageRefresh'>
              Refresh
            </a>
          </div>
          <div data-role='content' style='padding: 15px'>
            <ul data-divider-theme='a' data-inset='true' data-role='listview'>
             <!--there are some other list variables-->
              <li data-theme='c'>
                Show current location:
                <a class='classspan' href='#location_page'>
                  Click on me
                </a>
              </li>
            </ul>
          </div>
        </div>
        <!-- show current location -->
        <div data-role='page' data-theme='c' id='location_page'>
          <div data-position='fixed' data-role='header' data-theme='a'>
            <a data-icon='arrow-l' href='#diagnostic_page'>
              Back
            </a>
            <h2>
              DigitalNoiz
            </h2>
            <div data-role='header'></div>
            Geolocation
            <div id='map_canvas'></div>
            <div id='geolocation'></div>
          </div>
        </div>
     </body>

This is my Jquery code, all my function code are edited in application.js.

function onLoad() {
    console.log('Init reached');
    $.mobile.allowCrossDomainPages = true;
    $.mobile.showPageLoadingMsg();
    $.support.cors = true;
    document.addEventListener('deviceready', onDeviceReady, false);
}
function onDeviceReady() {
    console.log('Starting up...');
//  navigator.app.overrideBackbutton(true);
    document.addEventListener("backbutton", onBackKeyDown, false);
    console.log('Initializing db'); 
    refreshpage();
        getPosition();

}
function getPosition(){
    var geoOptions = { enableHighAccuracy: true, timeout: 10000 };
    navigator.geolocation.getCurrentPosition(function(position){ // geoSuccess
        // we have the position
        var geolocation = $('#geolocation');
        geolocation.html('<table></table>');

        var table = geolocation.find('table');
        if(position.coords.latitude)
            table.append('<tr><th>Latitude</th><td>' + position.coords.latitude + '</td></tr>');
        if(position.coords.longitude)
            table.append('<tr><th>Longitude</th><td>' + position.coords.longitude + '</td></tr>');
        if(position.coords.altitude)
            table.append('<tr><th>Altitude</th><td>' + position.coords.altitude + '</td></tr>');
        if(position.coords.accuracy)
            table.append('<tr><th>Accuracy</th><td>' + position.coords.accuracy + '</td></tr>');
        if(position.coords.altitudeAccuracy)
            table.append('<tr><th>Altitude Accuracy</th><td>' + position.coords.altitudeAccuracy + '</td></tr>');
        if(position.coords.heading)
            table.append('<tr><th>Heading</th><td>' + position.coords.heading + '</td></tr>');
        if(position.coords.speed)
            table.append('<tr><th>Speed</th><td>' + position.coords.speed + '</td></tr>');
        if(position.coords.timestamp)
            table.append('<tr><th>Timestamp</th><td>' + new Date(position.timestamp) + '</td></tr>');

         //show position on map 
        var map_canvas = $('#map_canvas');
        map_canvas.gmap(
            {'center' : position.coords.latitude + ',' + position.coords.longitude,
            'zoom' : 12,
            'disableDefaultUI':true,
            'callback':function(){
                var self = this; 
                var marker = self.addMarker({ 'position' : this.get('map').getCenter() });
                marker.click(function(){
                    self.openInfoWindow({ 'content' : 'This is your current location' }, this);
                });
            }
        }); 
    }, function(error){ // geoError
        navigator.notification.alert('error: ' + error.message + '\n' + 'code: ' + error.code);
    }, geoOptions);
}

Can anybody could give me some advices?

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

    I had this too (especially in Chrome on the desktop) and solved it by resizing the map when it had finished rendering (in ‘idle’ state):

    google.maps.event.addListenerOnce(map, 'idle', function() {
       google.maps.event.trigger(map, 'resize');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am trying to dispaly a basic google map on my application but that's not
I am trying to add multiple google markers on a map and I am
I am trying to simply add a Google Search bar onto my own map
I am trying to use the Google Map API- I've successfully managed to add
I'm trying to extend jWysiwyg with an function to add a map from Google
I'm trying to add a Google map to a website I am developing. I
I am trying to add markers to a google map created after an ajax
Trying to do a map example I found here http://codemagician.wordpress.com/2010/05/06/android-google-mapview-tutorial-done-right/ The problem is this
I have been trying to add google map to my Umbraco based website. It
Am trying to add 2-way bindings between event listeners on Google Map V3 markers

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.