Thank you for responding @ptrblck  . I have labelled my maps like so:
{
  'maps-with-water': [ mapJson1, mapJson2, mapJson3 ],
  'cave-maps': [ mapJson4, mapJson5, mapJson6 ],
  'desert-maps': [ mapJson7, mapJson8 ],
  ...
}

Each mapJson consists of:
{
  elements: [
    { x1: ..., y1: ..., x2: ..., y2: ..., type: ... },
    { x1: ..., y1: ..., x2: ..., y2: ..., type: ... },
    { x1: ..., y1: ..., x2: ..., y2: ..., type: ... },
    ...
  ],
}

I want my model to accept a whole mapJson with all its elements and predict the class it belongs to. So if I test it with mapJson4, it should predict cave-maps.
I have two work-arounds at the moment that I can think of, both of which are not pretty:

I can pad a mapJson so that it always has (say) 50 elements (slots) and if a particular mapJson has only 3 elements, I’ll pad the rest of the 47 elements to maybe { x1: 0, y1: 0, x2: 0, y2: 0, type: 'UNKNOWN' }.
I can convert a mapJson into an image where the entire image is black, except areas where there were elements. For these areas, I’ll color the pixels according to the element type (green for grass, brown for rock, blue for water, etc). This will result in an image that can be up/down-sampled to conform to the input layer of a NN and there will be no need to send a variable length JSON to the model.

I hope I’m able to clarify my wishes. :). I don’t know if this is possible. But I wanna be pushed in the right direction as to how to approach such a problem.