Scodigo, Inc.

Log In | Register

Cart Items:
0

Error : Class Not Fount

I purchased a php script from code322.com and am trying to get it to work with SmartPill. The script (library?) makes it rediculously easy to make google maps. I have not however been able to get this to work in filemaker, either with just the webviewer or SmartPill. If I use the following code in testbed.fp7

 require_once('gmap.php');  
$gmap = new GMap('gmap','dir'); 
$gmap->show_map_control = false; 
$gmap->showDirections('San Antonio,TX','Houston,TX'); 

The result is:

PHP Notice: Undefined index: SERVER_PROTOCOL in I:\Program Files\FileMaker\FileMaker Pro 10 Advanced\Extensions\PHP Support\gmap.php(2) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 21
PHP Notice: Undefined index: SERVER_PORT in I:\Program Files\FileMaker\FileMaker Pro 10 Advanced\Extensions\PHP Support\gmap.php(2) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 22
PHP Notice: Undefined index: SERVER_PORT in I:\Program Files\FileMaker\FileMaker Pro 10 Advanced\Extensions\PHP Support\gmap.php(2) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 23
PHP Notice: Undefined index: SERVER_NAME in I:\Program Files\FileMaker\FileMaker Pro 10 Advanced\Extensions\PHP Support\gmap.php(2) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 24
PHP Notice: Undefined index: REQUEST_URI in I:\Program Files\FileMaker\FileMaker Pro 10 Advanced\Extensions\PHP Support\gmap.php(2) : eval()'d code(1) : eval()'d code(1) : eval()'d code on line 24

So then I tried:

require_once('http://localhost/gmap/gmap.php');  
$gmap = new GMap('gmap','dir'); $gmap->show_map_control = false; 
$gmap->showDirections('San Antonio,TX','Houston,TX'); 

and received this:

PHP Fatal error:  Class 'GMap' not found in Embedded code on line 3

Any ideas as to what the issue may be, or how to resolve this? Thank you for your time.

 Bob

my thinking was that I could

my thinking was that I could return the code (result) and display it in a webviewer via the data:text/html. The first one with the errors actually returned some javascript along with the PHP errors. Of course I couldn't get it to display because those error are affecting the code sent to google maps, so google maps is returning errors also. Ultimately I am wanting to use the google maps api in Filemaker, but not have all the garbage that comes along with using just url requests.

I tried using just the webviewer, but due to the php, it's not possible. I would love to get this to work. I manage a company that does high speed internet installations. Having a custom map, showing markers for jobs, weather, driving directions, etc inside of Filemaker would be fantastic. I don't have access to FMS, nor can I convince my boss he needs to spend the $$$ for it, so I'm trying to devise an alternative.

Bob

Looking into this

Micah Woods's picture

Hello Bob,

I agree this would be great to have in FileMaker. I think it's possible with SmartPill but it'll take a bit of work. I'll put it on my list and post back when I have something to show. In the meantime, you might take a look at an article by Mike Lee at Proof:

http://www.proofgroup.com/blog/2008/nov/google_mapping_redux

Regards,
Micah

Error : Class Not Found

Micah Woods's picture

Hello Bob,

Based on the first result where you're getting the Undefined index warnings, I think this is because those CONSTANTS aren't available within our version of PHP. This is because we're not running on the server and thus PHP doesn't make these available.

It may be possible to alter the code and fix those issues but ultimately, what are you trying to achieve? If you're trying to display the map in a web viewer, I think you might have to run the PHP on a web server vs. from within SmartPill.

Regards,
Micah