123 Posts
EclipseMedia
9 years ago
13
Topic

Does anyone have steps to allow someone who creates a new article, enters a google map address in a text field and its displayed as a google map?

Get a Book for SEBLOD
4229 Posts
Kadministrator
9 years ago
0
Level 1

There is map template you could use

http://www.seblod.com/products/51

106 Posts
krkr
9 years ago
0
Level 1

I believe that question was about map in article not a search&list template.

Like for mosmaps.
I made it with position override, couldn't find another solution to show map in each article with some simple field which generates this..

{mosmap lat='<?php echo $cck->getValue('latitude');?>'|lon='<?php echo $cck->getValue('longitude');?>'}

PS. And I still didn't found any example or idea how to get work "any" joomla plugin inside seblod with seblod values. :(

Brgds

123 Posts
EclipseMedia
9 years ago
8
Level 1

I installed Joomla Plugin at

http://extensions.joomla.org/extension/google-maps-by-reumer

I created 2 new text fields called longitude and latitude 

I created a 3rd text field with default value

{mosmap lat='getValue('latitude');?>'|lon='getValue('longitude');?>'}

But it simply does nothing. What am I missing or done wrong?

123 Posts
EclipseMedia
9 years ago
7
Level 2

Just an update. I noticed the code gets stripped from the original

{mosmap lat='<?php echo $cck->getValue('latitude');?>'|lon='<?php echo $cck->getValue('longitude');?>'}

to

{mosmap lat='getValue('latitude');?>'|lon='getValue('longitude');?>'}

So I know I am doing something wrong. I have a feeling I am not suppose to use Text field with Default Value. What is the correct way

9 years ago
6
Level 3

Hi,

You're almost done with what you have.

Try to apply a' HTML' typo to your 3rd field and put this in the typo HTML textarea (accessed via the + button) :

{mosmap lat='$cck->getValue("latitude")'|lon='$cck->getValue("longitude")'}

If you don't want latitude and longitude fields to be displayed, apply a 'hidden' variation on them or set them in the 'hidden' position.

Olivier

123 Posts
EclipseMedia
9 years ago
5
Level 4

Seems so close. The issue is this. I made the 3rd field where the "typo" goes hidden from Admin. But it does not show anything on the front. However if I make the field viewable and enter any text in the field and save. The 3rd field then displays and the map attempts to load. So there is an issue that the field won't display if empty.

9 years ago
4
Level 5

Hi,

Try to set the storage to 'none' for your 3rd field. You don't need it on your admin view, just in front.

Olivier

123 Posts
EclipseMedia
9 years ago
3
Level 6

I changed Storage ²  Format / Object to NONE

and didn't make any difference. Seems so close.

9 years ago
2
Level 7

Hi EclipseMedia,

try to use a freetext instead of text field.

In the freetext write "blabla..." and use on it the typo that Olivier advise above.


regards.

Lionel

123 Posts
EclipseMedia
9 years ago
1
Level 8

Hi Lionel, 

We are getting closer again. After creating the free text field, putting blabla for default value, create a HTML typo with

{mosmap lat='$cck->getValue("latitude")'|lon='$cck->getValue("longitude")'} as the code, The map now displays HOWEVER its grayed.

When I looked at the javascript values I noticed that the longitude and latitude coordinates from the first two fields did not get entered.

Instead it looks like this ,"latitude":"$cck->getValue(\"latitude\")","longitude":"$cck->getValue(\"longitude\")",

As you can see it just enter $cck->getValue(\"latitude\") instead of the field value 44.651982 and

$cck->getValue(\"longitude\") instead of the field value -63.533936

9 years ago
0
Level 9

Hi EclipseMedia,

the tag 

$cck->get('my_field');

must be used with ' and not "


Regards.

Lionel

27 Posts
Diegohag
8 years ago
1
Level 1

Hi i have the same problem but i can´t resolve see my post  https://www.seblod.com/community/forums/fields-plug-ins/help-with-map thanks. 

7 years ago
0
Level 2

Bonjour,

J'utilise également le plugin mosmap, j'ai essayé d'automatiser la longitude et latitude avec le plugin de seblod, malheureusement chez moi il ne fonctionne pas malgré la version récente (type de champ invisible), j'ai trouvé une alternative car je ne peux pas demander aux internautes de rentrer les coordonnées manuellement.

J'ai créé un champ de type zone de texte "address" puis un champ texte libre "mosmap" et comme cité plus haut dans la typo de ce champ "html" j'ai ajouté

{mosmap address='$cck->getValue('adresse')'}

pour éviter que la carte se charge automatiquement par défaut , j'ai posé une condition.

pour ma part ça fonctionne très bien, une chose importante si vous êtes en local il faut rentrer L'API KEY dans le plugin

Get a VIP membership