As one of the to-do’s from our latest tech circle meeting protocol, I’m adding other flow charts, this time not an overview, but with a time-axis to show how the data flows will happen on specific user actions.
Time axis runs from top (start) to bottom (action finished).
These examples are based on the situation that a partner website (e.g. a SSEDAS partner) wants to displays POIs with a specific tag to his organization, e.g. “ssedas_partner=1”. These tags are stored on the TransforMap-Tag-DB.
First load of a map-website
When the map-plugin is displayed the first time, as much data as possible should be served from static files to reduce the load on the live database servers. To optimize here makes sense, because 90-98% of the users do not interact with the map (zooming in/out, panning).
In words: Each of the different (SSEDAS-partner) websites has a fixed starting point and bounding box (BBOX), where the map is shown. For this BBOX, daily extracts are generated out of the databases and served as a static file for each of the partners (instead of more complicated requests to different data servers).
When the user starts to pan the map or zoom in, dynamic loading of content kicks in:
Dynamic loading of more data on map move
As the data is pulled live from different databases, some steps are necessary to collect all data for displaying new POIs:
- After the user panned/scrolled the map to a new position, the “new” area where POIs are to be downloaded is calculated
- Download requests are first sent to the TransforMap-Tag-DB with the BBOX and the a selector (ssedas_partner=1) - it returns all data in the BBOX which has the tag “ssedas_partner=1” set.
- Then the web-map parses this data: In there are links to OSM objects for each POI. (and other sources in the future).
- It queries the (Overpass) OSM-server, asking for the linked objects.
- The OSM server returns a set of objects.
- The web-map matches the TransforMap objects with the OSM objects and generates “combined objects” internally, with are added to the map.
Until now, we display only POI Icons (maybe with a name) on the map, no media content yet.
The media content gets loaded dynamically when the user clicks on a POI:
Click on POI
When the user clicks on a POI, a pop-up opens which displays further information and media about the object.
I guess only 1% of map users ever click on a pop-up, so this content is loaded dynamically on request.
So when a pop-up is opened, it is checked if there are any links to external media content. If there is, the content is fetched and added to the pop-up dynamically.
If the map-plugin is configured not to show objects according to SSEDAS-tags, but e.g. to show all fair-trade objects from OSM, it works the other way round: At first all OSM-Objects are loaded, and after them the corresponding objects out of the TransforMap-Tag-DB.