127 Posts
Cappu
10 years ago
Topic
Hello,

just bought the Seblod Map Plugin. Its quite interesting, but I could not figure out the following:

- how to zoom the map automatically if there is is just one marker (and I am on an individual address - not the list). It zooms to the default latitude/longitude I set.
- if the marker can hava a shadow icon applied

Thanks for any hint.

Kind regards,

Bernhard



Get a VIP membership
127 Posts
Cappu
10 years ago
0
Level 1
Oh, wow. I thought I could do this easily with Seblod. - Thanks for this info, zwergo!
127 Posts
Cappu
10 years ago
0
Level 1
Hi Zwergo,
your hint saved my weekend. - Your suggestion points to a much more elegant way to use a Map with Seblod (at least for Google Maps with one Marker per Article). - I do not need the Seblod Map Plugin for this solution.

Here is what I did:
1. In the Form & Content Type I calculate the Latitude and Longitude in respective fields by using the Seblod 'Address to Coordinates' Plugin http://www.seblod.com/products/920

2. Get the Reumer Google Maps Extension
http://extensions.joomla.org/extensions/maps-a-weather/maps-a-locations/street-maps/1147

3. Install the Reumer Extension and got to the Plugin configuration to activate it an to check the settings of the plugin (Google API key, Icons etc.)

4. Use Seblod HTML overwrite to add the Reumer Map code to your template
i.e. in /templates/seb_one/position//content/topbody.php
In my case it looks like this:
{mosmap align='center'|width='100%'|height='400'|lat='<?php echo $cck->getValue('latitude'); ?>'|lon='<?php echo $cck->getValue('longitude'); ?>'|zoom='16'|mapType='Normal'|text='
<div style="width:250px;heigth: 100px; text-align: left;"><b><?php echo 'AUST '.$cck->getValue('art_title'); ?></b>
<br><?php echo $cck->getValue('strasse'); ?> <?php echo $cck->getValue('hausnummer'); ?><br/>
<br><?php echo $cck->getValue('plz'); ?> <?php echo $cck->getValue('ort'); ?><br/>
<?php echo 'Telefon: '.str_replace(' ', ' ', $cck->getValue('telefon')); ?></div>'}

Finished!

Note: The Marker Icon (and much more Google Maps parameters) I could set in the Plugin configuration. For some reason I could not get the Marker shadow to work. Guess this has something to do with the Google Maps v3 API.




10 years ago
0
Level 1
@Cappu,

thank you for sharing your solution.

You could even do it without a HTML override and use a Freetext field to put in the mosmap code. As long as you make sure that the "Prepare Content" option in the configuration tab is set to yes, then the Reumer map plugin should work.

I had the same problem and solved it by modifying the original SEBLOD map template code because I had already purchased it. Now my map gets centered to the marker position when there is only one marker. When there are multiple markers, the map auto extends so that all markers are visible and auto adjusts the zoom level.
127 Posts
Cappu
10 years ago
0
Level 1
Hi Gebeer,

Thanks for the hint with the Freetext field. - Even more elegant.

Very nice idea to tweak the Seblod map template. - You could hand it over to the Seblod Team to include it into the next update.


127 Posts
Cappu
10 years ago
0
Level 1
Hi zwergo,

havn't tried it with Freetext yet. - If it's possible to add PHP code there and execute it Gebeer's method should work.

There is one drawback in the use of Reumer Google Maps Extension: "t's not possible to add multiple locations or addresses to one map with the plugin." http://tech.reumer.net/Google-Maps/Documentation-of-plugin-Googlemap/welcome.html

Besides that the extension is great: the approach mentioned works with 1 marker for 1 article. -




10 years ago
1
Level 1
Hi zwergo, Cappu,

I was wrong about the Freetext field, sorry. I didn't read Cappu's code careful. so I didn't see that there is PHP code in it. You would have to use the Code Pack. But than it's not a free solution, again :-(. So the template override that Cappu suggested is propably the best way.

What I really miss in SEBLOD is a field plugin that adds a Google map with a single marker to either a content view or even a list view. For other CCKs these Gmap fields are available. So maybe the SEBLOD dev team or one of the other more code savvy users will provide us with a field plugin like that one day...

127 Posts
Cappu
10 years ago
0
Level 2
Hi gebeer,

I agree, the complexitiy to add a map is pretty high.

BTW: Seblod offers the SEBLOD Form & List pack to facilitate the map inclusion into your Form & Content Type; you don't need to define a Joomla Module before. - But it's still nothing intuitive.

Actually I like the idea to use another highly specialiced Googel Maps extension. I need to configure the map to the maximum. Maybe to complex for a plugin for Seblod. - There is Joomla's Plugin system with excellent events other extensions may use - and Reumer Google Maps Extension is doing that nicely (the markers remind me to NoNumbers). I like this.

I bought the Code Pack an will check if its possible to add the marker there. But actually due to lack of documentation I have to trial and error on how to access the cck fields (Thanks for any hint on that, btw...).

I will try to figure out how to get mutiple markers into the Reumer Google Maps Extension. It offers the use of external KML files (XML files with geo data). - There should be a way to create this file on the fly with Seblod (no idea how to that at the moment on my side).


10 years ago
0
Level 1
PS: I will also send my modifications to the devs. Maybe they can incorporate them into upcoming version of the map template.
187 Posts
Pathos
10 years ago
1
Level 1

How did you do this Gebeer?

"I had the same problem and solved it by modifying the original SEBLOD map template code because I had already purchased it. Now my map gets centered to the marker position when there is only one marker. When there are multiple markers, the map auto extends so that all markers are visible and auto adjusts the zoom level."

10 years ago
0
Level 2

Hi Pathos,

if you send me your email via the contact form on my website, I can send you my modified index.php of the map template.

Sorry to make it that complicated. Still no PM function in this forum. And the map template is commercial code so I don't want to just paste it here ;-)

149 Posts
MtnPavlas
10 years ago
1
Level 1

The Google map solution by Reumer is pretty sweet, guys. Very much configurable (at global level but also at a per-map level). I've implemented it this way:

I have a content type GPS with a GPS file upload field. In the Intro and Content views I then needed to provide a link to the GPS file download but also wanted to render the GPS tracks on a map. So I've created two fields:

  1. File upload field
  2. Text field that reads off the field above - I've set up the storage to Standard -> Free -> <table_for_GPS_content_type> -> <GPS_file_upload_field>

For the text field, I then set the typography to HTML and entered the following: {mosmap width='100%'|height='450'|kml='*value*'|mapType='Terrain'|marker='0'}

See it in action here:


It could be easily adjusted to read off the latitude/longitude fields.

To display multiple markers - KML, GPX and other GPS-type files can contain multiple markers and then you could use the solution above. You can create KML files in Google Earth and other mapping software. This would not be dynamic, of course, but may work for some.

Seblod team, please consider adding the auto-zoom functionality to the map template.

10 years ago
0
Level 2

Hi MtnPavlas,

great implementation, thanks for sharing!

Reumer's Gmaps plugin really is the most flexible out there and very well maintained over the years.

Senlod map template really does need some improvements. Hope, the dev guys will find time to do that...

127 Posts
Cappu
10 years ago
0
Level 1

Hi MtnPavlas,

thanks for sharing your solution! Cool that using a text field works with the Reumer map. - Very interesting GPS solution. - Would you provide us a link to your live site - on the screenshot there is almost nothing to see....

149 Posts
MtnPavlas
10 years ago
0
Level 1

The GPS functionality is not yet public (still beta testing) but you could check out a similar solution I used for the Trail content type on the same site:

http://192.163.202.209/trails/tiger-mtn

However, I didn't use a text field for this but you can see a combination of a map marker and GPS tracks on the same map rendition. This has been implemented by using the Minima template so I entered the code for Reumer map plugin directly in the template file:

{mosmap width='100%'|height='400'|kml='<?php echo JURI::base().$cck->getValue('trail_gps_file');?>'|lat='<?php echo $cck->getValue('trail_latitude');?>'|lon='<?php echo $cck->getValue('trail_longitude');?>'|mapType='Terrain'|marker='0'}
149 Posts
MtnPavlas
10 years ago
0
Level 1

Trying to insert the image of the GPS map implementation again - hopefully it won't get so minified as it did the first time.

127 Posts
Cappu
10 years ago
1
Level 1

Very impressive. - This is a very nice example. - Very clever, too. You just uploaded the KML file to the root of your site?! Seems very straight forward to point to the file using kml='>?php getValue('trail_gps_file');?>' in the mosmap marker.  Very smart the text field solution for this, too.

149 Posts
MtnPavlas
10 years ago
0
Level 2

Cappu, I configured the file upload field to store the full path (i.e. "images/gps/<content id>/<file name>" ... e.g. "images/gps/153/crystal-mountain.gpx") ... that's why getValue('trail_gps_file'); works just fine.

127 Posts
Cappu
10 years ago
0
Level 1

Thanks for the hint. - Just experimented with your text-field solution. Works nice. Wondering if this could work on List Types, too?

10 years ago
4
Level 1

Hi, i purchased the seblod map now. Are there news about the automatic zoom to a marker? Or is it possible to implement the soloution of gebeer? Thx for help!

10 years ago
3
Level 2

Hi, i purchased the seblod map now. Are there news about the automatic zoom to a marker? Or is it possible to implement the soloution of gebeer? Thx for help

There are no news as far as I know. Octopoos really should fix this and publish a new version.

Anyways, in this gist you can find my modified index.php. Replace this with the original index.php in templates/seb_map folder. Lines 118-124 are mainly interesting for autozoom.

Please note that these changes are in no way generic, but they work for my use case and have also worked for others. You might want to change the longitude value that is hardcoded in line 122.

Also look for the variables $centercode and $fitmybounds further down in the code to understand what is happening.

The Seblod devs might not like that I publish part of their product publicly as a gist. But I don't really mind unless they tell me to take it off github again. I'm just getting too many requests for that file.

Hope this helps. If you have any questions, go ahead.

97 Posts
Anjo
9 years ago
1
Level 3

Hi gebeer, this improvement on map template is much appreciated. I don't feel as bad after spending 30eur. 

Anyway, I made a code suggestion on gist because it wasn't zooming properly to one marker. 

Thanks

Anjo

9 years ago
0
Level 4

Hi Anjo, thanks for sharing your improvements.

67 Posts
Bonitto
7 years ago
0
Level 3

It's a shame there hasn't been any updates with this feature yet. I actually was really hoping the SEBLOD maps plugin could auto center and zoom for a single map marker without me having to use another extension.

Update:

I see auto zoom and centering is now available. You will have to go into your Maps List and Search Type and do the following:

  1. Go to your List View 
  2. Click Template
  3. Scroll down to Markers Section
  4. Set Auto Zoom = yes
127 Posts
Cappu
10 years ago
0
Level 1

Hi gebeer,

Thanks for sharing your code. - Which that Octopoos will implement this in the near future, too.

Kind regards,

Bernhard

548 Posts
joomleb
7 years ago
0
Level 1

Hi guys,

after two year, Do you have any news here, any new experience on a powerful SEBLOD & Google Map ?

Do you have any new and/or different suggestions ?

Get a Book for SEBLOD