Welcome Guest, Not a member yet? Register   Sign In
Googlemap with codeigniter?
#1

[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.
#2

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

[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)
#4

[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
#5

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

[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.
#7

[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




Theme © iAndrew 2016 - Forum software by © MyBB