From 6a59ff5193f8a8add016781f8fc925ae3b0b8417 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 6 Aug 2025 19:29:16 +0200 Subject: [PATCH 1/2] marker size --- source/UI/js/Map/MapMarker.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/source/UI/js/Map/MapMarker.js b/source/UI/js/Map/MapMarker.js index 338f4ed3..d6efa2e8 100644 --- a/source/UI/js/Map/MapMarker.js +++ b/source/UI/js/Map/MapMarker.js @@ -43,12 +43,12 @@ Ox.MapMarker = function(options) { that[key] = val; }); setColor() + setSize() const element = document.createElement('div') element.style.border = '2px solid black' element.style.borderRadius = '50px' element.style.backgroundColor = '#' + Ox.toHex(that.color) - element.style.width = '16px' - element.style.height = '16px' + element.style.width = element.style.height = that.size + 'px' that.marker = new maplibregl.Marker({ raiseOnDrag: false, shape: {coords: [8, 8, 8], type: 'circle'}, @@ -229,13 +229,8 @@ Ox.MapMarker = function(options) { } } - function setOptions() { - // workaround to prevent marker from appearing twice - // after setting draggable from true to false (google maps bug) - var fix = false, // that.marker.getDraggable() && !that.place.editing, - size = that.map.options('markerSize'); - //Ox.Log('Map', 'setOptions, that.map: ', that.map) - setColor() + function setSize() { + var size = that.map.options('markerSize'); if (size == 'auto') { that.size = 8; Ox.forEach(areaSize, function(size, area) { @@ -250,6 +245,16 @@ Ox.MapMarker = function(options) { } else { that.size = size(that.place); } + } + + function setOptions() { + // workaround to prevent marker from appearing twice + // after setting draggable from true to false (google maps bug) + var fix = false, // that.marker.getDraggable() && !that.place.editing, + size = that.map.options('markerSize'); + //Ox.Log('Map', 'setOptions, that.map: ', that.map) + setColor() + setSize() /* fixme, some of those can be set some not that.marker.setOptions({ // fixme: cursor remains pointer @@ -266,6 +271,7 @@ Ox.MapMarker = function(options) { */ //that.marker._color = that.color; that.marker._element.style.cursor = that.place.editing ? 'move' : 'pointer'; + that.marker._element.height = that.marker._element.width = that.size + 'px' that.marker.setDraggable(that.place.editing); that.marker.setLngLat(that.place.center); if (fix) { From 8dbfcc0ecec4af0b3f7cbfba4b91f1ee334864fe Mon Sep 17 00:00:00 2001 From: j Date: Wed, 6 Aug 2025 19:30:08 +0200 Subject: [PATCH 2/2] fix raster subdomains --- source/UI/js/Map/Map.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/UI/js/Map/Map.js b/source/UI/js/Map/Map.js index 4a551da4..031b94ae 100644 --- a/source/UI/js/Map/Map.js +++ b/source/UI/js/Map/Map.js @@ -935,12 +935,11 @@ Ox.Map = function(options, self) { 'raster-tiles': { 'type': 'raster', 'tiles': [ - // FIXME: use protocol and make use of all subdomains - //'https://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}' - 'https://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}' - + 'https://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', + 'https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', + 'https://mt2.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', + 'https://mt3.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', ], - 'subdomains':['mt0','mt1','mt2','mt3'], 'tileSize': 256, 'attribution': 'FIXME', @@ -951,6 +950,7 @@ Ox.Map = function(options, self) { 'id': 'simple-tiles', 'type': 'raster', 'source': 'raster-tiles', + 'roundZoom': true, 'minzoom': 0, 'maxzoom': 22 }