function show_map(){
if (isset($_GET["w1"]) && isset($_GET["w2"])){
$w1=$_GET["w1"];
$w2=$_GET["w2"];
echo $w1;
echo $w2;
$this->load->library('googlemaps');
$config=array();
$config['center']='$w1 $w2';
$this->googlemaps->initialize($config);
$marker=array();
$marker['position']='$w1 $w2';
$this->googlemaps->add_marker($marker);
$data['map']=$this->googlemaps->create_map();
$this->load->view('showmap',$data);
}
}
I got w1 and w2 from javascript where i used some javascript codes to get my current location.
I have a variable $w1
which has latitude and $w2
which has longitude and now I cannot provide these variables as the map center point.
Map center syntax is: $config['center']='latitude longitude'
, I have tried this: $config['center']='$w1 $w2';
but it doesn't work.
I'm using php codeigniter.