Skip to content

Commit

Permalink
3.0.12
Browse files Browse the repository at this point in the history
3.0.12
  • Loading branch information
PhocaCz committed Jul 4, 2021
1 parent c914db3 commit 6309365
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 7 deletions.
6 changes: 5 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ Phoca Maps Plugin is a Joomla! plugin. With Phoca Maps Plugin you can display on







## Version

3.0.10
3.0.12



Expand Down
Binary file modified content-phocamaps-release.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<element>phocamaps</element>
<folder>content</folder>
<type>plugin</type>
<version>3.0.10</version>
<infourl title="Phoca Maps Content Plugin 3.0.10">https://www.phoca.cz/</infourl>
<version>3.0.12</version>
<infourl title="Phoca Maps Content Plugin 3.0.12">https://www.phoca.cz/</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/PhocaCz/PhocaMapsPlugin/releases/download/3.0.10/plg_content_phocamaps_v3.0.10.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/PhocaCz/PhocaMapsPlugin/releases/download/3.0.12/plg_content_phocamaps_v3.0.12.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
Expand Down
60 changes: 59 additions & 1 deletion phocamaps.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) {
$db->setQuery($query);
$mapp = $db->loadObject();


if (empty($mapp)) {
echo '<div class="alert alert-error">'. JText::_('PLG_CONTENT_PHOCAMAPS_PLUGIN_ERROR') . ' - '. JText::_('PLG_CONTENT_PHOCAMAPS_MAP_NOT_EXISTS') . ' (ID = '.$idMap.')</div>';
return false;
Expand Down Expand Up @@ -428,7 +429,14 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) {
$output .= $map->setTypeControlOpt($mapp->typecontrol, $mapp->typecontrolposition).','."\n";
$output .= $map->setNavigationControlOpt($mapp->zoomcontrol).','."\n";
$output .= $map->setMapOption('scaleControl', $mapp->scalecontrol, TRUE ).','."\n";
$output .= $map->setMapOption('scrollwheel', $mapp->scrollwheelzoom).','."\n";
//$output .= $map->setMapOption('scrollwheel', $mapp->scrollwheelzoom).','."\n";

if ($mapp->gesturehandling != '') {
$output .= $map->setMapOption('gestureHandling', '"' . $mapp->gesturehandling . '"').','."\n";
} else {
$output .= $map->setMapOption('scrollwheel', $mapp->scrollwheelzoom).','."\n";
}

$output .= $map->setMapOption('disableDoubleClickZoom', $mapp->disabledoubleclickzoom).','."\n";
// $output .= $map->setMapOption('googleBar', $mapp->googlebar).','."\n";// Not ready yet
// $output .= $map->setMapOption('continuousZoom', $mapp->continuouszoom).','."\n";// Not ready yet
Expand Down Expand Up @@ -534,6 +542,45 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) {

} else {

//OSM tracks
if ($tmpl['map_type'] == 2) {

$tmpl['fitbounds'] = $mapp->fitbounds_osm;
$textarea = $mapp->trackfiles_osm;
$textarea = str_replace(array("\r\n", "\n", "\r"),'',$textarea);
$tracks = explode(",",$textarea);

$textarea = $mapp->trackcolors_osm;
$textarea = str_replace(array("\r\n", "\n", "\r"),'',$textarea);
//$colors = explode(",",$textarea);
$colors = array_map('trim', explode(',', $textarea));

$tracksA = array();
foreach ($tracks as $k => $v) {
$v = trim($v);
$ext = pathinfo($v,PATHINFO_EXTENSION);

if (($ext != 'gpx') && ($ext != 'kml')) {
$v = '';
} else {
//if no path specified add default path (hardcoded to /phocamapskml for now)
if (strpos($v,'/') === false) {
$v = 'phocamapskml/'.$v;
}
$v = trim($v,'/');

$tracksA[$k] = array();
$tracksA[$k]['file'] = JFile::exists(JPATH_ROOT.'/'.$v) ? JURI::base().$v : '';
$tracksA[$k]['color'] = isset($colors[$k]) ? $colors[$k] : '';
}
}
$tmpl['tracks'] = $tracksA;
} else {
$tmpl['tracks'] = array();
}



$map = new PhocaMapsMapOsm($id);


Expand Down Expand Up @@ -636,6 +683,17 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) {
if ($tmpl['osm_easyprint'] == 1) {
$map->renderEasyPrint();
}

if (!empty($tmpl['tracks'])) {
foreach ($tmpl['tracks'] as $ky=>$trk) {
$fitbounds = $ky==0 ? $tmpl['fitbounds'] : false;
if (isset($trk['file'])) {
$map->renderTrack($trk['file'], $trk['color'], $fitbounds);
}
}
}


$map->renderMap();

########################### END OPENSTREETMAP
Expand Down
4 changes: 2 additions & 2 deletions phocamaps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension type="plugin" group="content" method="upgrade" version="3.9">
<name>plg_content_phocamaps</name>
<author>Jan Pavelka (www.phoca.cz)</author>
<creationDate>19/12/2020</creationDate>
<creationDate>04/07/2021</creationDate>
<authorEmail></authorEmail>
<authorUrl>https://www.phoca.cz</authorUrl>
<copyright>Jan Pavelka</copyright>
<license>GNU/GPL</license>
<version>3.0.10</version>
<version>3.0.12</version>
<description>PLG_CONTENT_PHOCAMAPS_DESCRIPTION</description>
<projectName>PhocaMapsPlugin</projectName>

Expand Down

0 comments on commit 6309365

Please sign in to comment.