From 04879a2d9ab0cd19f50efc8ce5cd2d7fc649b36b Mon Sep 17 00:00:00 2001 From: astridx Date: Sun, 28 Jul 2019 22:53:14 +0200 Subject: [PATCH] agosmsaddressmarker on module ready --- src/media/mod_agosm/js/agosm.js | 18 +++++++++++++++++- src/modules/mod_agosm/helper.php | 3 +++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/media/mod_agosm/js/agosm.js b/src/media/mod_agosm/js/agosm.js index bab95a8a..1d7c6894 100644 --- a/src/media/mod_agosm/js/agosm.js +++ b/src/media/mod_agosm/js/agosm.js @@ -535,11 +535,13 @@ document.addEventListener('DOMContentLoaded', function () { var objcf = specialcustomfieldpins[specialcustomfieldpin]; let tempMarkercf = null; + if (objcf.cords) { var values = objcf.cords.split(","); tempMarkercf = L.marker(objcf.cords.split(",").slice(0, 2)); - if (values.length > 4) + + if (values.length > 4 && objcf.type !== 'agosmsaddressmarker') { var AwesomeIcon = new L.AwesomeMarkers.icon( { @@ -552,6 +554,20 @@ document.addEventListener('DOMContentLoaded', function () { }) tempMarkercf.setIcon(AwesomeIcon); } + + if (objcf.type === 'agosmsaddressmarker' && objcf.iconcolor && objcf.markercolor && objcf.icon) + { + var AwesomeIcon = new L.AwesomeMarkers.icon( + { + icon: objcf.icon, + markerColor: objcf.markercolor, + iconColor: objcf.iconcolor, + prefix: 'fa', + spin: false, + extraClasses: "agosmsaddressmarkerextraklasse", + }) + tempMarkercf.setIcon(AwesomeIcon); + } let url = "index.php?options=com_content&view=article&id=" + objcf.id; let title = objcf.title; diff --git a/src/modules/mod_agosm/helper.php b/src/modules/mod_agosm/helper.php index 352becfd..2ebe3d03 100644 --- a/src/modules/mod_agosm/helper.php +++ b/src/modules/mod_agosm/helper.php @@ -233,6 +233,7 @@ public static function getListCustomField(&$params) { $itemfiltered1->title = $item->title; $itemfiltered1->id = $item->id; + $itemfiltered1->type = $field->type; $itemsfiltered[] = $itemfiltered1; } } @@ -245,6 +246,7 @@ public static function getListCustomField(&$params) { $itemfiltered2->title = $item->title; $itemfiltered2->id = $item->id; + $itemfiltered2->type = $field->type; $itemsfiltered[] = $itemfiltered2; } } @@ -262,6 +264,7 @@ public static function getListCustomField(&$params) { $itemfiltered3->title = $item->title; $itemfiltered3->id = $item->id; + $itemfiltered3->type = $field->type; $itemfiltered3->lat = $test[0]; $itemfiltered3->lon = $test[1];