- Posts: 295
COMMUNITY FORUM
Google Map or other Map Integration
- stavroch
-
- Offline
- Elite Member
What we will taking with your new module version?
Please Log in or Create an account to join the conversation.
- Mark Beddis
-
- Offline
- New Member
- Posts: 7
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?
Please Log in or Create an account to join the conversation.
- stavroch
-
- Offline
- Elite Member
- Posts: 295
Please Log in or Create an account to join the conversation.
- Mark Beddis
-
- Offline
- New Member
- Posts: 7
I think I answered a different question to what you asked.
Whay my mod does is give all the google map zoom, switch view, etc functionality provided by Mikes googlemap plugin - to provide a bit more map functionality than that provided by the static image generated in the K2DynaMap extension (for single items).
Take a look at Mike Reumer's site at tech.reumer.net/ and you will see what his plugin can do. I have found it very good in the past.
Mark
Stavros said:
Ok we are waiting your demo site. Although and the Nick project display the long - lat of items in the module position and under of each k2 item.
Please Log in or Create an account to join the conversation.
- stavroch
-
- Offline
- Elite Member
- Posts: 295
Please Log in or Create an account to join the conversation.
- Nick Texidor
-
- Visitor
This feature was requested a while ago by Stavros, and is actually something I'm working on adding to K2DynaMap at the moment. However, in addition to dynamic zooming, we'll also be showing the other K2 Items on the Map.
I hope to have it completed soon.
Nick
Mark Beddis said:
Hi Stavros
I think I answered a different question to what you asked.
Whay my mod does is give all the google map zoom, switch view, etc functionality provided by Mikes googlemap plugin - to provide a bit more map functionality than that provided by the static image generated in the K2DynaMap extension (for single items).
Take a look at Mike Reumer's site at tech.reumer.net/ and you will see what his plugin can do. I have found it very good in the past.
Mark
Stavros said:
Ok we are waiting your demo site. Although and the Nick project display the long - lat of items in the module position and under of each k2 item.
Please Log in or Create an account to join the conversation.
- Mark Beddis
-
- Offline
- New Member
- Posts: 7
That sounds great - really looking forward to seeing it.
One feature request I would love to suggest is the ability to geocode an additional K2 field (a postal address) to the lat / lon fields with an override to the true lat lon fields if these are entered (as errors geocoding occur!!). I have done this in the past by calling the google API to perform this. It just makes life for the end user when they go in and edit stuff.
Regards - I think your extension is really good.
Mark
Nick Texidor said:
Hi Mark,
This feature was requested a while ago by Stavros, and is actually something I'm working on adding to K2DynaMap at the moment. However, in addition to dynamic zooming, we'll also be showing the other K2 Items on the Map.
I hope to have it completed soon.
Nick
Mark Beddis said:
Hi Stavros
I think I answered a different question to what you asked.
Whay my mod does is give all the google map zoom, switch view, etc functionality provided by Mikes googlemap plugin - to provide a bit more map functionality than that provided by the static image generated in the K2DynaMap extension (for single items).
Take a look at Mike Reumer's site at tech.reumer.net/ and you will see what his plugin can do. I have found it very good in the past.
Mark
Stavros said:
Ok we are waiting your demo site. Although and the Nick project display the long - lat of items in the module position and under of each k2 item.
Please Log in or Create an account to join the conversation.
- Pasquale Luisi
-
- Offline
- New Member
- Posts: 9
Constantinos Griponisiotis said:
are you looking something like this: www.mykorinthia.gr/epagelmaties ?
Please Log in or Create an account to join the conversation.
- vaishumon.r
-
- Offline
- New Member
- Posts: 2
Google Maps apps are easy to make thanks to google codes
If you want to integrate Google My Map then you can
check this out bestfromgoogle.blogspot.com/2011/05/google-my-maps-kml-integration-for-your_4609.html
If there was a easy way to do it with some plugins please tell me
Thanks
Please Log in or Create an account to join the conversation.
- vaishumon.r
-
- Offline
- New Member
- Posts: 2
Google Maps apps are easy to make thanks to google codes .
If you want to integrate Google My Map then you can check this out
bestfromgoogle.blogspot.com/2011/05/google-my-maps-kml-integ... there was a easy way to do it with some plugins please tell me.
Thanks
Please Log in or Create an account to join the conversation.
- stavroch
-
- Offline
- Elite Member
- Posts: 295
Please Log in or Create an account to join the conversation.
- Adnan Pirota
-
- Offline
- New Member
- Posts: 8
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
Hi Mark.
Do you maybe know how to pass dynamaps parameter for different markers icons ?
I managed to pass many parameters, but this one is hard.
Your code miss one "{" after $output .= '</center>';. Blank page without it.
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
It is possbile to use this code in K2 template:
<div class="map"><?php /* get all Modules assigned to Position 'map' */$mapItem = &JModuleHelper::getModules( 'map' );/* loop through the array and render their output */foreach ($mapItem as $map) { $_options = array( 'style' => 'xhtml' ); echo JModuleHelper::renderModule($map,$_options);}?></div>
and put dynamaps module in "map" position. But as it is now some scroll out and all markers in K2 category are visible.
As i said, new version comes very soon, i hope.
But i would like to keep Googlemaps plugin because of very nice option to calculate (and print) direction route in one lightbox window. (or new Google maps window)
Please Log in or Create an account to join the conversation.
- pamidipadudravid
-
- Offline
- Junior Member
- Posts: 33
Please Log in or Create an account to join the conversation.