The popup starts to work (Please note, you need to replace the "YOUR_API_KEY" to the actual key to make it work).
The 2nd change I made is adding the "center" option in this piece of code:
var map = new google.maps.Map(document.getElementById('map_canvas'), {
center: new google.maps.LatLng(-34.397, 150.644), // I add the center location here
zoom: 7,
mapTypeId: google.maps.MapTypeId.ROADMAP,
panControl: false,
mapTypeControl: false,
streetViewControl: false
});
Then the map show up correctly.
However, the route part is still not working as the origin point and destination point are not set properly, but now you have a good start.
thanks for fixing the map. My objective is to get rid of the dialog and load the map in the tab. Tab number 1 (numbering starts at zero) is selected for that purpose. The code below opens the dialog and loads the map
wavemaster
Participant
1293 Points
1129 Posts
hands on jquery fix for a 6 pack
Nov 21, 2012 06:58 PM|LINK
Ok, I have been struggling with this jquery issue and it has taken too much time to get it resolved.
I am offering a 6 pack for anyone who can change my code.
For practical purpose it is probably easiest if you are stateside, however if you can accept PayPal it can work.
the google map needs to load inside the tab.
http://jsfiddle.net/wavemaster/wrZRD/1/
I can do a remote session if necessary.
Robert
HenryLiang
Member
284 Points
45 Posts
Re: hands on jquery fix for a 6 pack
Nov 21, 2012 08:02 PM|LINK
Well, from the code, you are not even referencing to Google Map javascript library. After I added the code below into HTML part
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=true"> </script>The popup starts to work (Please note, you need to replace the "YOUR_API_KEY" to the actual key to make it work).
The 2nd change I made is adding the "center" option in this piece of code:
var map = new google.maps.Map(document.getElementById('map_canvas'), { center: new google.maps.LatLng(-34.397, 150.644), // I add the center location here zoom: 7, mapTypeId: google.maps.MapTypeId.ROADMAP, panControl: false, mapTypeControl: false, streetViewControl: false });Then the map show up correctly.
However, the route part is still not working as the origin point and destination point are not set properly, but now you have a good start.
wavemaster
Participant
1293 Points
1129 Posts
Re: hands on jquery fix for a 6 pack
Nov 21, 2012 09:09 PM|LINK
Thanks for your reply.
thanks for fixing the map. My objective is to get rid of the dialog and load the map in the tab. Tab number 1 (numbering starts at zero) is selected for that purpose. The code below opens the dialog and loads the map
$("a[href=#tabs-2]").click(function(){ alert('ok') $("#showroute").delay(1000).dialog(dialogmapinitialize); })I need it to load the map in the dialog, without user intervention.
Any suggestions?
HenryLiang
Member
284 Points
45 Posts
Re: hands on jquery fix for a 6 pack
Nov 21, 2012 09:20 PM|LINK
That's simple, change the code in your last post to this:
$("a[href=#tabs-2]").click(function(){ initialize(); })