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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:58:11+00:00 2026-06-08T15:58:11+00:00

I was testing out this demo on query-ui-maps: http://jquery-ui-map.googlecode.com/svn/trunk/demos/jquery-google-maps-mobile.html#directions_map Everything is the same except

  • 0

I was testing out this demo on query-ui-maps:
http://jquery-ui-map.googlecode.com/svn/trunk/demos/jquery-google-maps-mobile.html#directions_map

Everything is the same except for the head section of my index.html file:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,  user-scalable=no">
        <link rel="stylesheet" href="jquery-mobile/jquery.mobile.css" />
        <link href="css/jquery.mobile-swatch.css" rel="stylesheet" type="text/css"/>
        <link href="css/custom-icons.css" rel="stylesheet" type="text/css"/>
        <link href="css/mapapp.css" rel="stylesheet" type="text/css"/>
        <script src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"  type="text/javascript"></script>
        <script src="js/jquery.js"></script>
        <script src="jquery-mobile/jquery.mobile.js"></script>
        <script type="text/javascript" src="ui/jquery.ui.map.js"></script>
        <script type="text/javascript" src="ui/jquery.ui.map.extensions.js"></script>
        <script type="text/javascript" charset="utf-8" src="js/cordova-iphone.js"></script>
        <script type="text/javascript" src="ui/jquery.ui.map.services.js"></script>
        <script type="text/javascript" src="js/jquery-ui-autocomplete-1-8-15.js"></script>
<script type="text/javascript" src="js/modernizr.js"></script>
        <script type="text/javascript" src="js/demo.js"></script>

The demo works in safari on my desktop but loads the screen attached whether I test in an ios5 simulator or an ios5 phone. No errors are logged to the console. I am testing in Xcode and using phone gap.
Blank  screen
Please help.

This is the code:

var mobileDemo = { 'center': '57.7973333,12.0502107', 'zoom': 10 };
        $('#directions_map').live('pageinit', function() {
            demo.add('directions_map', function() {
                $('#map_canvas_1').gmap({'center': mobileDemo.center, 'zoom': mobileDemo.zoom, 'disableDefaultUI':true, 'callback': function() {
                    var self = this;
                    self.set('getCurrentPosition', function() {
                        self.refresh();
                        self.getCurrentPosition( function(position, status) {
                            if ( status === 'OK' ) {
                                var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude)
                                self.get('map').panTo(latlng);
                                self.search({ 'location': latlng }, function(results, status) {
                                    if ( status === 'OK' ) {
                                        $('#from').val(results[0].formatted_address);
                                    }
                                });
                            } else {
                                alert('Unable to get current position');
                            }
                        });
                    });
                    $('#submit').click(function() {
                        self.displayDirections({ 'origin': $('#from').val(), 'destination': $('#to').val(), 'travelMode': google.maps.DirectionsTravelMode.DRIVING }, { 'panel': document.getElementById('directions')}, function(response, status) {
                            ( status === 'OK' ) ? $('#results').show() : $('#results').hide();
                        });
                        return false;
                    });
                }});
}).load('directions_map');

        });


        $('#directions_map').live('pageshow', function() {
            demo.add('directions_map', $('#map_canvas_1').gmap('get', 'getCurrentPosition')).load('directions_map');
        });

    </script>

</head>
<body>
    <div id="directions_map" data-role="page">
        <div data-role="header">
            <h1>jQuery mobile with Google maps v3</h1>
            <!--<a data-rel="back">Back</a>-->
        </div>
        <div data-role="content">
            <div class="ui-bar-f ui-corner-all ui-shadow" style="padding:1em;">
                <div id="map_canvas_1" style="height:300px; width:100%;"></div>
                <p>
                    <label for="from">From</label>
                    <input id="from" class="ui-bar-f" type="text" value="G&ouml;teborg, Sweden" />
                </p>
                <p>
                    <label for="to">To</label>
                    <input id="to" class="ui-bar-f" type="text" value="Stockholm, Sweden" />
                </p>
                <a id="submit" href="#" data-role="button"  data-icon="search">Get directions</a>
            </div>
            <div id="results" class="ui-listview ui-listview-inset ui-corner-all ui-shadow" style="display:none;">
                <div class="ui-li ui-li-divider ui-btn ui-bar-f ui-corner-top ui-btn-up-undefined">Results</div>
                <div id="directions"></div>
                <div class="ui-li ui-li-divider ui-btn ui-bar-f ui-corner-bottom ui-btn-up-undefined"></div>
            </div>
        </div>
    </div>


</body>

  • 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-08T15:58:16+00:00Added an answer on June 8, 2026 at 3:58 pm

    After much searching, this has proved to be the best answer:
    http://code.google.com/p/jquery-ui-map/wiki/Examples#Example_get_user_position

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

Sidebar

Related Questions

I'm testing out the Google Places autocomplete feature here: https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete I want to get
I'm currently testing out retrieving json from jquery. The service url is: http://imgsvc.heroku.com/images In
I'm testing this out in LINQPad with the CRM plugin. What should my query
Reference is this page: http://demo.mypreviewbetasite.com/laverona/menu.html File in question: http://demo.mypreviewbetasite.com/laverona/scripts/menu.js The page works as expected
Check out this test: http://jsperf.com/delegate-on-vs-bind-5 What I did was delegate the child with a
I am testing out ajax with Django + jQuery. I have this in my
Anybody out there have experience testing out of process assemblies? I'm testing some Com+
Please share your view on this kind of thing i'm currently testing out :
I've uploaded a simple Azure website (am testing out authentication) and have found this:
I was testing/trying out this Perl one-liner , and I'm trying to figure out

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.