Skip to content

How to use OpenStreetMap on JEA #37

Answered by ilhooq
Enr62 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Enr62 ,

First of all, you have to understand the template override in Joomla,

Then, make an override of components/com_jea/views/property/tmpl/default.php in your template and edit the file default.php.

Place this code where you want to see the map :

<?php echo $this->loadTemplate('leaflet') ?>

Then, create a new file default_leaflet.php at the same level with this code :

defined('_JEXEC') or die;

$latitude  = floatval($this->row->latitude);
$longitude = floatval($this->row->longitude);

if (empty($latitude) || empty($longitude)) return;

$this->document->addScript('https://unpkg.com/[email protected]/dist/leaflet.js');
$this->document->addStyleSheet('https://unpkg.com/[email protected]/dis…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ilhooq
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #33 on December 13, 2023 15:02.