MCPcopy Create free account
hub / github.com/RocketMap/RocketMap / map_request

Function map_request

pogom/search.py:614–633  ·  view source on GitHub ↗
(api, position, jitter=False)

Source from the content-addressed store, hash-verified

612
613
614def map_request(api, position, jitter=False):
615 # create scan_location to send to the api based off of position, because tuples aren't mutable
616 if jitter:
617 # jitter it, just a little bit.
618 scan_location = jitterLocation(position)
619 log.debug('Jittered to: %f/%f/%f', scan_location[0], scan_location[1], scan_location[2])
620 else:
621 # Just use the original coordinates
622 scan_location = position
623
624 try:
625 cell_ids = util.get_cell_ids(scan_location[0], scan_location[1])
626 timestamps = [0, ] * len(cell_ids)
627 return api.get_map_objects(latitude=f2i(scan_location[0]),
628 longitude=f2i(scan_location[1]),
629 since_timestamp_ms=timestamps,
630 cell_id=cell_ids)
631 except Exception as e:
632 log.warning('Exception while downloading map: %s', e)
633 return False
634
635
636def gym_request(api, position, gym):

Callers 1

search_worker_threadFunction · 0.85

Calls 2

jitterLocationFunction · 0.85
get_map_objectsMethod · 0.80

Tested by

no test coverage detected