code: def get_tile_locations_by_gid(self, gid):
          
          for l in self.visible_tile_layers:
              for x, y, _gid in [i for i in self.layers[l].iter_data() if i[2] == gid]:
                  yield x, y, l
docs: Search map for tile locations by the GID
  
          Return (int, int, int) tuples, where the layer is index of
          the visible tile layers.
  
          Note: Not a fast operation.  Cache results if used often.
  
          :param gid: GID to be searched for
          :rtype: generator of tile locations