Google Map Viz Overlays Eval Questions

xycofryx

Member
Joomla: 3.9.4 Stable
Fabrik: 3.9 (Feb 21, 2019)

Good day!

I have a couple of questions about this piece of code on the Google Maps Visualization with the following code:
Code:
$myOverlays = array(
   'urls' => array(),
   'labels' => array(),
   'preserveViewports' => array(),
   'suppressInfoWindows' => array()
);
foreach ($this->iconRowData as $iconData) {
   $myOverlays['urls'][] = $iconData['data']['yourtable___overlayurl'];
   $myOverlays['labels'][] = $iconData['data']['yourtable___overlaylabel'];
   $myOverlays['preserveViewports'][] = '1';
   $myOverlays['supressInfoWindows'][] = '0';
}
return $myOverlays;
1) Can the element "fileupload" be applied to the "yourtable___overlayurl" part of the code?
2) Does the Overlay's URL needs the relative path or or absolute path to work?
3) Are "yourtable___overlayurl" and "yourtable___overlaylabel" the only one you gonna change inside the given code.
4) If I somehow insert a overlay in the "Overlays URL" tab would the Overlay's Eval be overridden?

I ask these questions because I can't seem to make it work on these part. I have also tested it on a fresh install.
 
Oh, in which case ...

1) Yes, I think so (simple uploads, anyway, not sure about AJAX or cropped) but see 2 ...
2) Fully qualified URL, so you'd need to prepend your 'live site' part of the URL and the upload path.
3) You have to provide the data structure shown, and array of 4 arrays, with those labels (urls, labels, etc).
4) We merge whatever you return from the eval into any static overlays you specify:

https://github.com/Fabrik/fabrik/bl...alization/googlemap/models/googlemap.php#L151

-- hugh
 
Thank you very much Hugh!

Last few question:

1) Can I use the code:
Code:
$myOverlays['urls'][] = $iconData['data']['http://myurl'.'yourtable___overlayurl'];
because the fileupload element always prepend a "/" to the link that I can't simply use {$jConfig_live_site}.

2) How can I inspect (f12) a kmz or kml to know if it is properly loaded or not?

You can choose not to answer, for I know I am violating the decorum of a forum, but I know deep in my heart these questions are very much related.

Thank you again and Best Regards,

Sam
 
1 - no, because that's not valid code. Or rather, the array key ['http://myurl'.'yourtable___overlayurl'] won't exist. You could do something like ...

Code:
$myOverlays['urls'][] = JURI::root() . ltrim($iconData['data']['yourtable___overlayurl'], '/');

... which should trim any / off the front of your element value, and append that the JURI::root() (which is the J! library call to get the site root, and I think will always have a / on the end).

2 - erm, I have no idea. You'd probably have to put a breakpoint in the viz JS, where it tries to load the overlays, and see if it works.

https://github.com/Fabrik/fabrik/bl...rik_visualization/googlemap/googlemap.js#L587

You'll have to set "Debug JS" in the Fabrik global debug options, to get uncompressed JS.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top