0

i am using google map with jquery mobile .

i want to get user current location in google map... in default page (Default page) there are links in footer... in default page in footer when i click location it works it goes to location page gives user location... but in default page in footer when i click another link such as map and then i click location
$('#map_canvas').gmap().bind('init' does not triggered...the page loads but map does not load .it goes to page in browser and

$(document).ready(function () { 

works but $('#map_canvas').gmap().bind('init' not works

user1688401
  • 1,851
  • 8
  • 47
  • 83

1 Answers1

1

The reason for which it works the first time is that the anchors inside the navigation bar of your first page contain the rel=external attribute. This forces a full page refresh when changing page.

ex: <a href="Contact.htm" class="ui-btn-active ui-state-persist" rel="external">

But rel="external" is missing from the anchors inside your footer navigation bar included on the other pages.

I hope this helps.

Apostolos Emmanouilidis
  • 7,179
  • 1
  • 24
  • 35
  • thank for your answear...i added rel="external" to all page but it does not work... http://beta.yazilimsozluk.com/ – user1688401 Apr 27 '13 at 19:14
  • http://beta.yazilimsozluk.com/index.html this is default page...when i click map then i click location in the URL there is location URL (http://beta.yazilimsozluk.com/PlacePin.htm) but it does not load...and when in chrome i look resource there is default page html source not location page(placepin) source – user1688401 Apr 27 '13 at 19:16
  • rel="external" is still missing from the navigation bar anchors. check the source code of your pages. – Apostolos Emmanouilidis Apr 27 '13 at 19:32
  • view-source:http://beta.yazilimsozluk.com/Index1.htm in here there is rel="externel" ...maybe you should clear your cache?
  • Places
  • Map
  • Location
  • – user1688401 Apr 27 '13 at 20:12
  • @ Tolis Emmanouilidis i should clear cache:) thanks it is work in browser now i moved phonegap as IOS app in app it does not work but it is another business thanks again .... – user1688401 Apr 27 '13 at 20:17
  • and also sometimes it work some times it does not work i will try catch this stituation – user1688401 Apr 27 '13 at 20:25
  • You're welcome :) I've noticed some issues in your source page. The document ready handler should not be used in conjunction with jQuery Mobile. You should use events like http://api.jquerymobile.com/pageinit/ . In addition you could make the maps working after Ajax page transition. I've written a relevant example here: http://stackoverflow.com/questions/12051911/can-not-get-multiple-page-jquery-mobile-working-with-google-maps/12060654#12060654 – Apostolos Emmanouilidis Apr 27 '13 at 20:36
  • i changed...i used this $( "#aboutPage" ).on( "pageinit", function( event ) { now no page fired this event:) . beta.yazilimsozluk.com – user1688401 Apr 27 '13 at 20:51
  • $( '#details' ).live( 'pageinit',function(event){ tihs works..do you suggest? – user1688401 Apr 27 '13 at 21:40