(api, position, jitter=False)
| 612 | |
| 613 | |
| 614 | def 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 | |
| 636 | def gym_request(api, position, gym): |
no test coverage detected