I'm trying to work through some issues with the field content for our Maps plugin, but I'm not sure about the best way to go about it.
Currently the value for each map field is stored as an element with the content stored in a custom table. This is useful for a couple of reasons. First, we can use the separate table to perform complex quering of elements by their geographic location or sort them by distance. Second, it allows us to take advantage of eager loading so we get the benefit of storing our content separately, while not having to worry about the N+1 query problem (assuming people
with the field in their queries).
But there are some drawbacks, which is why I'm looking to change how we do it. First there's a bug where data is not propagating across sites and I can't for the life of me work out why. Second, when you eager load the field you have to get the first value of an array (
entry.map) to get the map content rather than just accessing it directly. And finally, having an element and everthing that comes with it seems overkill considering how simple the data is.
Idealy I'd like to either get the data for the field as part of the element query (along with the regular content), or I'd like to manually handle eager loading all the data and have it happen automatically (and not require
 when accessing it).
Is there a correct way of storing this kind of data? Are either of my two options above actually do-able?