Just want to pass php variables $x and $y to javascript map function (as lat and long). Please help. Here is my controller:
<?php
$x = 25.114667;
$y = 55.137797;
?>
Here is my JS file:
function initialize()
{
var myCenter = new google.maps.LatLng(lat,long);
var mapOptions = {
center:myCenter,
zoom:12,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap")
,mapOptions);
} google.maps.event.addDomListener(document.getElementById('showhidemap'), 'click', initialize);
alert(lat)below thevar long = "<?php echo $y; ?>";and see value is coming or not.