Welcome Guest, Not a member yet? Register   Sign In
Pinpoint location with CI on Google Maps
#1

[eluser]veledrom[/eluser]
Hi,

Is there any specific library or helper to generate an URL that I can also attach latitude and longitude to it and open Google Maps in another page to see the location?

Thanks
#2

[eluser]boltsabre[/eluser]
Wouldn't you just code an html anchor tag with a target="_blank" attribute and the lat and long attached as $_GET parameters?

Then on the target page you'd extract the lat and long via javascript and just build your google map like normal.

Or do you mean open the actual google page (ie, www.maps.google.com)?
#3

[eluser]BIOSTALL[/eluser]
Hi veledrom,

Not sure if it's of any use but I've got a library that embeds a google map into a page with just a few lines of code.

You can download it, view documentation and see demos at the link below:

http://biostall.com/demos/google-maps-v3...r-library/

Hope that helps somewhat,

Thanks,

BIO
#4

[eluser]veledrom[/eluser]
Hi BIOSTALL,

Would you show me where I have to do changes in order not to do full zoom because map my nose is toughing the gound? 50% is enough for me.

Also what is the difference between yours and this one : http://codeigniter.com/wiki/Google_Maps_API_V3_Library

Thanks


Code:
class Map extends CI_Controller {
function __construct()
{
  parent::__construct();
  
}

function index()
{
  // Load the library
  $this->load->library('googlemaps');



  // Initialize the map, passing through any parameters
  //$config['center'] = '1600 Amphitheatre Parkway in Mountain View, Santa Clara County, California';
  $config['zoom'] = "auto";

  $this->googlemaps->initialize($config);
  // Get the co-ordinates from the database using our model

  
  // Loop through the coordinates we obtained above and add them to the map


  $marker = array();
  $marker['position'] = '51.52296408,-0.155051266';
  $this->googlemaps->add_marker($marker);


  // Create the map
  $data = array();
  
  $data['map'] = $this->googlemaps->create_map();
  // Load our view, passing through the map data
  
  //echo "<pre>";print_r($data);exit;
  
  $this->load->view('map_view', $data);
  
  
}
}
#5

[eluser]veledrom[/eluser]
OK. I decided to use http://codeigniter.com/wiki/Google_Maps_API_V3_Library which is excellent work.




Theme © iAndrew 2016 - Forum software by © MyBB