Group nearby resource tiles of the same type into patches, and label
them on the map, e.g. "Iron ore / 2.4M", or "Crude oil / 12 wells".
- events-library: ResourcePatch model, shared by the server and map.
- events-server-web: ResourcePatchService reads the map-chunk-resource
topic from the beginning (read_committed) into memory, and on request
groups tiles into connected patches (join distance 2 tiles for ore,
12 for infinite resources, whose wells are spread out). Results are
cached until new data arrives.
New endpoint: GET .../servers/{id}/map/resources/s{surface}/patches
- web-map: toggleable "Resource patches" overlay with labels at each
patch centre and a hover tooltip, refreshed every minute. Patches
under 10 tiles are hidden. (Surface 1 only, like the rest of the map.)
- events-mod: mark resources infinite based on the prototype's
infinite_resource. Entity initial_amount is nil for e.g. crude oil, so
oil fields were treated as hundreds of tiny ore patches.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
33 lines
852 B
CSS
33 lines
852 B
CSS
.leaflet-tile {
|
|
/* https://github.com/Leaflet/Leaflet/issues/3575 */
|
|
/*width: 257px !important;*/
|
|
/*height: 257px !important;*/
|
|
/*box-shadow: 0 0 1px rgba(0, 0, 0, 0.05);*/
|
|
|
|
image-rendering: pixelated;
|
|
}
|
|
|
|
.leaflet-container {
|
|
/* make the Leaflet map background transparent, so it matches the site theme */
|
|
background-color: rgba(255, 0, 0, 0.0) !important;
|
|
}
|
|
|
|
/* resource patch labels, e.g. 'Iron ore / 2.4M' - centred on the patch, readable on any terrain */
|
|
.resource-patch-label {
|
|
width: auto !important;
|
|
height: auto !important;
|
|
background: none;
|
|
border: none;
|
|
}
|
|
|
|
.resource-patch-label span {
|
|
display: block;
|
|
transform: translate(-50%, -50%);
|
|
white-space: nowrap;
|
|
text-align: center;
|
|
font-size: 12px;
|
|
font-weight: bold;
|
|
line-height: 1.2;
|
|
color: #fff;
|
|
text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 2px #000;
|
|
}
|