From 7ed269e961e828e7ed61dc1099392f36aa209286 Mon Sep 17 00:00:00 2001 From: Daniel Kipp Date: Wed, 17 Jun 2026 12:54:53 +0200 Subject: [PATCH 1/2] [FIX]: replace MarkerImage with icon object for Google markers (fix mantis #43204) --- .../Maps/classes/class.ilGoogleMapGUI.php | 4 ++-- .../Maps/templates/default/tpl.google_map.js | 22 +++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/components/ILIAS/Maps/classes/class.ilGoogleMapGUI.php b/components/ILIAS/Maps/classes/class.ilGoogleMapGUI.php index c3666dcffe72..3cb833948145 100755 --- a/components/ILIAS/Maps/classes/class.ilGoogleMapGUI.php +++ b/components/ILIAS/Maps/classes/class.ilGoogleMapGUI.php @@ -1,7 +1,5 @@ {USER_INFO}<\/span><\/div>"); -if (google.maps) +var ilMarkerImage = null; +if (typeof google !== "undefined" && google.maps) { - var ilMarkerImage = new google.maps.MarkerImage( - "./assets/images/standard/icon_mapm.svg", - new google.maps.Size(12, 20), - new google.maps.Point(0,0), - new google.maps.Point(6, 20)); + // Google Maps still supports legacy `google.maps.Marker`, but `google.maps.MarkerImage` + // is an older wrapper API for marker icons. Using the icon as a plain object with + // `url`, `scaledSize`, `origin`, and `anchor` passes the same marker configuration in + // the format the current marker API expects. This keeps the existing legacy marker + // behavior and custom SVG icon, while avoiding the deprecated `MarkerImage` wrapper + // that no longer rendered reliably here. + ilMarkerImage = { + url: "./assets/images/standard/icon_mapm.svg", + scaledSize: new google.maps.Size(12, 20), + origin: new google.maps.Point(0, 0), + anchor: new google.maps.Point(6, 20) + }; } -if (google.maps) +if (typeof google !== "undefined" && google.maps) { ilInitMaps(); } From 49a058bec11a2a42691ca406d9252883c9bd6651 Mon Sep 17 00:00:00 2001 From: Daniel Kipp Date: Wed, 17 Jun 2026 13:31:53 +0200 Subject: [PATCH 2/2] [FIX]: display multiple Google maps on one page --- .../ILIAS/Maps/templates/default/tpl.google_map.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/ILIAS/Maps/templates/default/tpl.google_map.js b/components/ILIAS/Maps/templates/default/tpl.google_map.js index aec1332b4ace..c3d40ee9870a 100755 --- a/components/ILIAS/Maps/templates/default/tpl.google_map.js +++ b/components/ILIAS/Maps/templates/default/tpl.google_map.js @@ -13,11 +13,11 @@ * https://github.com/ILIAS-eLearning */ -ilMapData = Array(); -ilMap = Array(); -ilMapOptions = []; -ilCM = Array(); -ilMapUserMarker = Array(); +window.ilMapData = window.ilMapData || []; +window.ilMap = window.ilMap || []; +window.ilMapOptions = window.ilMapOptions || []; +window.ilCM = window.ilCM || []; +window.ilMapUserMarker = window.ilMapUserMarker || []; ilMapData["{MAP_ID}"] = new Array({LAT},{LONG},{ZOOM},{TYPE_CONTROL},{NAV_CONTROL},{UPDATE_LISTENER},{LARGE_CONTROL},{CENTRAL_MARKER}); ilMapUserMarker["{MAP_ID}"] = Array(); @@ -60,7 +60,7 @@ function ilInitMaps() for (var i=0;i