Open Spettacolo83 opened 8 years ago
I tried to call this function from NicklasW\PkmGoApi\Services\Request\MapRequestService:
public function getResources($latitude, $longitude)
{
// Retrieve a list of cell ids from the latitude and longitude
$cellIds = S2::getCellIds($latitude, $longitude);
// Retrieve the map resources
$resources = $this->getRequestService()->getResources($latitude, $longitude, $cellIds);
print_r('Resources: '.$resources);
}
But it return all the array void:
forts=>array(
)
spawn_points=>array(
)
deleted_objects=>array(
)
fort_summaries=>array(
)
decimated_spawn_points=>array(
)
wild_pokemons=>array(
)
catchable_pokemons=>array(
)
nearby_pokemons=>array(
)
Do you know how can I fix it?
The Map API is not done yet, you'll have to wait a bit more ;)
You could try this snippet while you wait.
$application = new ApplicationKernel('INSERT_USER', 'INSERT_PASSWORD', Factory::AUTHENTICATION_TYPE_PTC);
$application->setLocation(INSERT_LATITUDE, INSERT_LONGITUDE);
$map = new Map();
$map->update();
var_dump($map->getPokestops());
Thank you so much! If I can help you, let me know!
Only one time getPokestops() gave me a complete array, but now is always void!
That is an example of what I've received:
[0]=>
object(NicklasW\PkmGoApi\Api\Map\Data\Resources\Fort)#50 (16) {
["id":protected]=>
string(35) "2bb412d263b2457881354a707c779cc6.16"
["lastModifiedTimestampMs":protected]=>
int(1470036347544)
["latitude":protected]=>
float(52.588293)
["longitude":protected]=>
float(-2.115976)
["enabled":protected]=>
bool(true)
["type":protected]=>
int(1)
["ownedByTeam":protected]=>
int(0)
["guardPokemonId":protected]=>
int(0)
["guardPokemonCp":protected]=>
int(0)
["gymPoints":protected]=>
int(0)
["isInBattle":protected]=>
bool(false)
["cooldownCompleteTimestampMs":protected]=>
int(0)
["sponsor":protected]=>
int(0)
["renderingType":protected]=>
int(0)
["activeFortModifier":protected]=>
string(0) ""
["lureInfo":protected]=>
NULL
}
[1]=>
object(NicklasW\PkmGoApi\Api\Map\Data\Resources\Fort)#639 (16) {
["id":protected]=>
string(35) "94dbfe8dfb9d4785a5e6fe10085756f9.16"
["lastModifiedTimestampMs":protected]=>
int(1470047822589)
["latitude":protected]=>
float(52.596062)
["longitude":protected]=>
float(-2.114933)
["enabled":protected]=>
bool(true)
["type":protected]=>
int(1)
["ownedByTeam":protected]=>
int(0)
["guardPokemonId":protected]=>
int(0)
["guardPokemonCp":protected]=>
int(0)
["gymPoints":protected]=>
int(0)
["isInBattle":protected]=>
bool(false)
["cooldownCompleteTimestampMs":protected]=>
int(0)
["sponsor":protected]=>
int(0)
["renderingType":protected]=>
int(0)
["activeFortModifier":protected]=>
string(0) ""
["lureInfo":protected]=>
NULL
}
Do you know where is the name of the PokeStop?
I look forward to getNearbyPokemon ;)
Names are only in the fort details response, which I think is not exposed yet. But I'm also waiting for this to be implemented, I like the clean API already :)
....
$application->setLocation(INSERT_LATITUDE, INSERT_LONGITUDE);
$map = new Map();
$map->update();
var_dump($map->getPokestops());
....
Returns the following:
Parse error: syntax error, unexpected 'DEFAULT' (T_DEFAULT), expecting identifier (T_STRING) or class (T_CLASS) in /home/www/..../res/POGOProtos/Map/Fort/FortData.php on line 33
Replace INSERT_LATITUDE and INSERT_LONGITUDE with valid values.
$application->setLocation(47.466582, 9.750203);
$map = new Map();
$map->update();
var_dump($map->getPokestops());
returns :
Parse error: syntax error, unexpected 'DEFAULT' (T_DEFAULT), expecting identifier (T_STRING) or class (T_CLASS) in /home/www/..../res/POGOProtos/Map/Fort/FortData.php on line 33
Which PHP version are you using? This sounds like a very old one.
Version 5.6.22, should update to v7 asap
I was wrong, it's not the class constants, but a reserved word, just get the newest version. PHP 5.6 should work fine, anyways.
Hi @NicklasWallgren any idea on the Map API release date? :)
Looks like Niantic changed something again, get no response(empty array) for getPokestops() & getGyms.
Yes, they did, and it's pretty heavy. https://www.reddit.com/r/pokemongodev/comments/4w1cvr/pokemongo_current_api_status/
The login and getProfileData is still working! Do you know how can I retrieve the "gyms currently conquered" value? I didn't find it! Thanks!
Is map data working now? or no?
If it is, an example to get Pokestops and Gyms would be awesome.
Nope, needs to wait for #65
The old method does not work:
$application->setLocation(47.466582, 9.750203);
$map = new Map();
$map->update();
var_dump($map->getPokestops());
How can I get the list of Pokestops with the new version of API?
Hello there, Is there any method/function to scan your local area for looking for PokeStops, Pokemons or Gyms? Thank you so much!