Change popup and icon size

This commit is contained in:
1F616EMO 2024-06-05 18:46:42 +08:00
parent d6e65af8f2
commit fc97c517e3
No known key found for this signature in database
GPG Key ID: EF52EFA8E05859B2
2 changed files with 11 additions and 11 deletions

View File

@ -209,9 +209,9 @@ export default function(cfg, map, overlays, wsChannel){
} }
if (cfg.mapobjects.um_area_forsale) { if (cfg.mapobjects.um_area_forsale) {
overlays.UnifiedMoneyAreaForSale = new UnifiedMoneyAreaForSaleOverlay(); overlays["Area For Sale"] = new UnifiedMoneyAreaForSaleOverlay();
if (isDefault("um_area_forsale")) { if (isDefault("um_area_forsale")) {
map.addLayer(overlays.UnifiedMoneyAreaForSale); map.addLayer(overlays["Area For Sale"]);
} }
} }

View File

@ -2,26 +2,26 @@ import AbstractIconOverlay from './AbstractIconOverlay.js';
import {HtmlSanitizer} from '../../lib/HtmlSanitizer.js'; import {HtmlSanitizer} from '../../lib/HtmlSanitizer.js';
export default AbstractIconOverlay.extend({ export default AbstractIconOverlay.extend({
initialize: function() { initialize: function () {
AbstractIconOverlay.prototype.initialize.call(this, "um_area_forsale"); AbstractIconOverlay.prototype.initialize.call(this, "um_area_forsale");
}, },
getMaxDisplayedZoom: function(){ getMaxDisplayedZoom: function () {
return 8; return 8;
}, },
getIcon: function(obj){ getIcon: function (obj) {
return L.icon({ return L.icon({
iconUrl: "pics/um_area_forsale_sign_alpha.png", iconUrl: "pics/um_area_forsale_sign_alpha.png",
iconSize: [32, 32], iconSize: [16, 16],
iconAnchor: [16, 16], iconAnchor: [16, 16],
popupAnchor: [0, -16] popupAnchor: [0, -16]
}); });
}, },
createPopup: function(obj){ createPopup: function (obj) {
return "<h4>Area for sale</h4><hr>" + return "<h4>Area for sale</h4>" +
"<b>Description:</b> $" + HtmlSanitizer.SanitizeHtml(obj.attributes.description || "N/A") + "<br>" + "<h5>" + HtmlSanitizer.SanitizeHtml(obj.attributes.description || "No Description") + "</h5><hr>" +
"<b>Owner:</b> " + HtmlSanitizer.SanitizeHtml(obj.attributes.owner) + "<br>" + "<b>Owner:</b> " + HtmlSanitizer.SanitizeHtml(obj.attributes.owner) + "<br>" +
"<b>Area IDs:</b> " + HtmlSanitizer.SanitizeHtml(obj.attributes.id) + "<br>" + "<b>Area IDs:</b> " + HtmlSanitizer.SanitizeHtml(obj.attributes.id) + "<br>" +
"<b>Price:</b> $" + HtmlSanitizer.SanitizeHtml(obj.attributes.price) + "<br>"; "<b>Price:</b> $" + HtmlSanitizer.SanitizeHtml(obj.attributes.price) + "<br>";