Help! I am trying to pull maps in a pop up passing address. I have two scripts, function initialize passes adress to get maps. and this function called on a button click event. My scripts are not working. help is much appreciated.
function initialize() {
debugger;
var map = new GMaps({
lat: 0,
lng: 0,
zoom: 0
});
GMaps.geocode({
address: $("#lblOfficeAddress").val(),
callback: function (results, status) {
debugger;
if (status == 'OK') {
var latlng = results[0].geometry.location;
map.fitBounds(results[0].geometry.viewport);
map.addMarker({
lat: latlng.lat(),
lng: latlng.lng()
});
}
}
});
}
$(function () {
$("#btnmap").click(function () {
$("#dialog").dialog({
modal: true,
title: "Location",
width: 600,
hright: 450,
buttons: {
Close: function () {
$(this).dialog('close');
}
},
open: function () {
debugger;
var mapOptions = {
//center: new google.maps.LatLng(34.095131, -84.258404),
//zoom: 18,
//mapTypeId: google.maps.MapTypeId.ROADMAP
initialize();
}
debugger;
var map = new google.maps.Map($("#canvasMap")[0], mapOptions);
}
});
});
});