Jump to content

Getting Invalid Result with report/get_result_map

get_result_map map png

  • This topic is locked This topic is locked
No replies to this topic

#1 Guest_DCombes_*

  • Guests

Posted 03 January 2018 - 17:43 PM

I am using the PHP/Wialon interface and seeking to generate a map PNG from recent tracker messages and believe I am making the right calls in the right sequence, but am getting an Invalid Result (error:3) from the report/get_result_map call.
From a quick scan of my sample code, can someone please advise what I am doing wrong?
Many thanks!
// Login to wialon using token
$result = $wialon_api->login($token);
$json = json_decode($result, true);
$sid = $json['eid'];
// SID returned ok

// get unit ID (only one on account)
$result = $wialon_api->call('core_search_items',$params);
$unit_id = $srch_res->items[0]->id;
// Unit ID returned ok

// Get 20 recent messages from unit 
$result = $wialon_api->call('messages_load_last',$params);
// 20 recent messages returned ok, majority with location data

// Clean up report buffer
$result = $wialon_api->call('report_cleanup_result',$params);
// Gives Error:0 = OK

// Create track layer using create_messages_layer
$params='{"layerName":"JoeTracker", "itemId":'.$unit_id.', "timeFrom":'.$first_t.', "timeTo":0, "tripDetector":0, "trackColor":"#0000FF", "trackWidth":5, "arrows":1, "points":1, "pointColor":"#FF0000", "annotations":1, "flags":16}';
$result = $wialon_api->call('render_create_messages_layer',$params);
// Result: string(295) "{"name":"JoeTracker","bounds":[51.591087,-0.150262,51.591316,-0.15005],"units":[{"id":14507980,"msgs":{"count":20,"first":{"time":1514997426,"lat":51.5911331177,"lon":-0.150049999356},"last":{"time":1515000138,"lat":51.5912284851,"lon":-0.150261998177}},"mileage":198.178266576,"max_speed":1}]} " 

// Init graphic layer
$result = $wialon_api->call('render_enable_layer',$params);
// Gives Enabled:1 = OK

// Get map png
$result = $wialon_api->call('report_get_result_map',$params);
// Gives Error:3 = "Invalid result"


  • Charlesdwept likes this

Also tagged with one or more of these keywords: get_result_map, map, png

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users