ansarali / jquery-ui-map

Automatically exported from code.google.com/p/jquery-ui-map
0 stars 0 forks source link

Refresh #38

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Will not center correctly... check it out.

Original issue reported on code.google.com by johansalllarsson on 15 Feb 2012 at 9:36

GoogleCodeExporter commented 8 years ago
Hi ,
For some reason (in r136)when i replace in my code <link rel="stylesheet" 
href="jquery.mobile-1.0a4.min.css" /> by  <link rel="stylesheet" 
href="jquery.mobile-1.0.1.min.js" /> the map does not display anymore.It is 
like google.loader.ClientLocation = null

jquery.mobile-1.0.1.min.js is supposed to be the most recent compare to 
jquery.mobile-1.0a4.min.css.
Thanks,

Original comment by ciss...@gmail.com on 3 Apr 2012 at 7:51

GoogleCodeExporter commented 8 years ago
Well first off you shouldn't load javascript in the stylesheet tag, that
alone might cause alot of issues. You need to use the google loader (jsapi)
to be able to get the clientlocation from google.loader.Clientlocation, and
that could be null if google can't figure out were you are.

/Johan

-- 
Med v�nliga h�lsningar

Johan S�ll Larsson

MT (Swe): +46-739-728 777
MT (Thai): +66-876-808202
E-post: johansalllarsson@gmail.com
Skype: johan.sall.larsson
Twitter: http://twitter.com/johansall

Original comment by johansalllarsson on 4 Apr 2012 at 6:31

GoogleCodeExporter commented 8 years ago
I am also having the issue with maps not centering properly. Any updated 
information would be great!!!

Thanks!!

Original comment by dorkfro...@gmail.com on 2 Jul 2012 at 1:30

GoogleCodeExporter commented 8 years ago
@dorkfro You may need to be more specific. Try this 
http://stackoverflow.com/questions/9924296/how-can-i-use-jquery-or-javascript-in
side-a-google-maps-infowindow

And also try asking in #jquery on the IRC server Freenode

Original comment by gyar...@gmail.com on 2 Jul 2012 at 6:21

GoogleCodeExporter commented 8 years ago
I have been utilizing this code below (the x are there for obvious reasons).
Utilizing the 'center' I would assume the map would center on  the coordinates, 
which they have done in the past with V2. However in this case, it manages to 
be off centered and centers to somewhere towards the bottom right of the 
location. I have tried multiple coordinates in different areas and it appears 
to be the same issue.  

$('#page-home').live("pageinit", function() {
                     $('#map_square').gmap(
                                           {   'center' : new google.maps.LatLng(xxxxxxxx, -xxxxxxxxx),
                                           'zoom' : 12, 
                                           'mapTypeControl' : false,
                                           'navigationControl' : false,
                                           'streetViewControl' : false,

                                           })

                    .bind('init', function(evt, map) { 
                           $('#map_square').gmap('addMarker', 
                                                 { 'position': 'xxxxxxxxx, -xxxxxxxxx', 

                                                    'animation' : google.maps.Animation.DROP, 

                                                 }); 
                          });

Original comment by dorkfro...@gmail.com on 2 Jul 2012 at 10:15

GoogleCodeExporter commented 8 years ago
Ok I figured it out....

Instead of .live('pageinit"), use "pageshow"

Original comment by dorkfro...@gmail.com on 4 Jul 2012 at 3:11