Good Evening Stackoverflow Lords & Ladies,
I am attempting to develop a Layar layer to use at my work but I'm having some difficulties right out of the gate. Here's the scenario
I have downloaded the Sample Code that Layar provides for the tutorial, Here's the link
Now I have not modified ANY of this code.
I have set up a database with the name of joejoz_layar In that database, I have imported the included .SQL file and THAT creates TWO tables, Layer & POI.
Now I just want to see how this thing is connecting and what the output looks like, so I upload all the included files to my server, and travel to firstTutorial_simplified.php on my box.
This is the error I get:
Message: layerName parameter is not passed in GetPOI request. Warning: Cannot modify header information - headers already sent by (output started at firstTutorial_simplified.php:64) in firstTutorial_simplified.php on line 225 {"layer":null,"hotspots":[],"errorCode":20,"errorString":"No POI found. Please adjust the range."}
Now the SQL import does include ONE POI so I'm really confused on what I'm doing wrong here. Here's the config.inc.php that I modified:
define('DBHOST', 'localhost');
define('DBDATA', 'joejoz_layar');
define('DBUSER', 'joejo_layar01');
define('DBPASS', 'XXXXXXXXX');
I've try to find the answer elsewhere only to run into stuff in Swedish... which I don't speak. Can someone NOT related to the Swedish Chef help me?
It looks to me as your not passing all the required values to $_GET
eg: $_GET['layerName']
, $_GET['lat']
, $_GET['lon']
and $_GET['radius']
keys must match the key/value array that your sending to getRequestParams($keys);
line 191,
Line 56 in firstTutorial_simplified.php
matches $keys
with isset($_GET[$key])
thus invoking the exception on line 59 if ones missing.
This is an API that returns a json string but you need to pass parameters
./firstTutorial_simplified.php?layerName=somelayer&lat=12345&lon=12345&radius=12345
Visiting the script directly will invoke errors as there is no checks
so really you just need todo some isset() checks else not run the code.