CodeIgniter Forums
Googlemap with codeigniter? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Googlemap with codeigniter? (/showthread.php?tid=27702)



Googlemap with codeigniter? - El Forum - 02-18-2010

[eluser]Iwasignited[/eluser]
Hi all,

I receive this notice:
Quote:A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: libraries/GMaps.php

Line Number: 115

I loaded the library in my controller, and the view display google map successfuly but the notice is still there.

The library downloaded here http://www.zimuel.it/blog/?p=23

Please let me know my mistake.
Thanks.


Googlemap with codeigniter? - El Forum - 02-18-2010

[eluser]flaky[/eluser]
put the code here, we (still) don't have super powers to guess your code


Googlemap with codeigniter? - El Forum - 02-18-2010

[eluser]Iwasignited[/eluser]
in my controller
Code:
$this->load->library('GMaps', 'my_api_key_goes_here');

and my view
Code:
$search = "a test address";    
        if ($this->load->gmaps->getInfolocation($search)) {
            $longitude = $this->gmaps->getLongitude();
            $latitude = $this->gmaps->getLatitude();
                        echo $longitude;
                        echo $latitude;
        }

the Gmaps.php downloaded from zimuel blog (http://www.zimuel.it/blog/?p=23)


Googlemap with codeigniter? - El Forum - 02-18-2010

[eluser]danmontgomery[/eluser]
It's not your mistake, it's a notice in the gmaps.php file you downloaded which is shown because of codeigniter's default error reporting


Googlemap with codeigniter? - El Forum - 02-18-2010

[eluser]Iwasignited[/eluser]
Thanks noctrum,
So, anyone has a working Gmaps library. I really need it.


Googlemap with codeigniter? - El Forum - 02-18-2010

[eluser]danmontgomery[/eluser]
Didn't you just say that it displays the map successfully...?

You can suppress the notice or edit the appropriate line in gmaps to check for whichever part of that chain is not an object.


Googlemap with codeigniter? - El Forum - 02-19-2010

[eluser]coolgeek[/eluser]
[quote author="Iwasignited" date="1266526202"]Thanks noctrum,
So, anyone has a working Gmaps library. I really need it.[/quote]

Any reason you're not using http://www.phpinsider.com/php/code/GoogleMapAPI/ as extended in the CI wiki http://codeigniter.com/wiki/Google_Maps/ ?

I ask because I'm setting it up for the first time myself