Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
agosmsaddressmarker on module ready
Browse files Browse the repository at this point in the history
  • Loading branch information
astridx committed Jul 28, 2019
1 parent 656a431 commit 04879a2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/media/mod_agosm/js/agosm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{
Expand All @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/modules/mod_agosm/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ public static function getListCustomField(&$params)
{
$itemfiltered1->title = $item->title;
$itemfiltered1->id = $item->id;
$itemfiltered1->type = $field->type;
$itemsfiltered[] = $itemfiltered1;
}
}
Expand All @@ -245,6 +246,7 @@ public static function getListCustomField(&$params)
{
$itemfiltered2->title = $item->title;
$itemfiltered2->id = $item->id;
$itemfiltered2->type = $field->type;
$itemsfiltered[] = $itemfiltered2;
}
}
Expand All @@ -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];

Expand Down

0 comments on commit 04879a2

Please sign in to comment.