Hi Stavros
My changes are simple to write out the $output variable to include the joomla {mosmap .........} plugin.
In the file K2dynamap.php file located in the plugins/k2 folder (in the region of line 89).....
Step 1)
I commented out the original lines that created the $output variable ....
/* Marks comment out */ //$output = '<br />'; //$output .= '<center><img src="
maps.google.com/maps/api/staticmap?center='.$latitude.','.$longitude.'&zoom='.$zoom.'&size='.$width.'x'.$height.'&maptype='.$type.'&markers=color:'.$color.'|label:'.$marker.'|'.$latitude.','.$longitude.'&sensor=false"/></center>';
Step 2)
and added these new lines ......
$output = '<br />'; $output .= '<center>'; $output .= "{mosmap width='500'|height='400'|lat='".$latitude."'|lon='".$longitude."'| zoom='3'|zoomType='Large'|zoomNew='0'|mapType='Satellite'|showMaptype='1'|overview='0'|text='sv DWO'|tooltip='DWO'|marker='1'|align='center'}"; $output .= '</center>';
Where {mosmap ....} is a valid call to mikes googlemap plugin.
Just to restate, I only plugged in the $latitude and $longitude variables above - the other settings for width, height, zoom and so on also need setting.
Step 3)
K2 doesnt seem to process standard joomla plugins like this one for K2 article content views, so what i did below was to import all the joomla content plugins and force the modified $output variable to be processed by the joomla content plugins.
/* Marks Edit */
$o = new stdClass(); $o->text = $output; JPluginHelper::importPlugin('content'); $dispatcher = & JDispatcher::getInstance(); $results = $dispatcher->trigger('onPrepareContent', array (&$o, array(), 0)); $output = $o->text;
So, the {mosmap ....} statement was then turned to full googlemap code by Mikes Googlemap plugin. We still get standard the category view map showing all the K2 items that have been geocoded.
It seems pretty close (close enough for what I need) to what Constantinos showed.
- It is as simple as that - nothing complicated at all. Of course, there can be a performance impact if we process the Joomla plugins - I'll look later and see if I can just import the googlemap plugin to reduce this.
I am sorry but I cant show this on the test site right yet as it contains a client project that is confidential to them and not to be seen at this point, but I'll move it to a demo site later today or tommorrow.
Stavros said:
Can you explain as what your code is doing?
What we will taking with your new module version?