News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Google Member Map

Started by Spuds, December 12, 2007, 01:49:12 PM

Previous topic - Next topic

mikeymx5

found a problem in the code in the GoogleMap20.php on line 380.

// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((empty($settings['hide_post_group']) || $marker['group'] == '') && $marker['post_group'] != '')
$datablurb.= '</tr><tr><td>' . $marker['post_group'] . '<br />' . $marker['group_stars'] . '</td>';


should be

// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
if ((!empty($settings['hide_post_group']) || $marker['group'] == '') && $marker['post_group'] != '')
$datablurb.= '</tr><tr><td>' . $marker['post_group'] . '<br />' . $marker['group_stars'] . '</td>';


the missing ! causes the group stars not to show.

mikeymx5

This mod and support seems as dead as Charlie Sheen's Career.

MrMike

Quote from: mikeymx5 on October 26, 2011, 03:05:09 PMThis mod and support seems as dead as Charlie Sheen's Career.

Ouch.

Spuds

Quote from: mikeymx5 on October 26, 2011, 12:45:18 AM
found a problem in the code in the GoogleMap20.php on line 380.

....

the missing ! causes the group stars not to show.
Actually the ! should not be there either.  The problem is that $marker['group_stars'] should not be part of that if condition at all, only the $marker['post_group'] should be in there for it to be consistent with the rest of SMF. 

I'll update that as soon as Mr. Sheen returns to 2 1/2 men.

mikeymx5

Thanks, while you are looking into this I have had report and have had it happen to me where if you search for you location and
it places a pin, the pin is not saved, you have to click the pin to remove it and reclick to add it for it to be saved.

Spuds

Quote from: mikeymx5 on October 28, 2011, 10:38:45 AM
Thanks, while you are looking into this I have had report and have had it happen to me where if you search for you location and
it places a pin, the pin is not saved, you have to click the pin to remove it and reclick to add it for it to be saved.
When you do the search, after Google determines a pin location, you MUST still click on the map to 'set' the pin ....

The pin that Google places is just a search result (specifically the first one is shown but it is not necessarily the only one, just the most likely one) hence the need to still click on the map so the mod knows that is the pin/location you are accepting.   

Also that search function which was built in to the 2.0 api is the only reason I have not updated this to the 3.0 api as that search function is not built in to the new api and to add it is more work then 3.0 is beneficial.

Holyfrey

This mod do not work corectly, it gives a error when installing it says it is for SMF 2 version 2.0.1 but it is not.

Bugo

I think it's necessary to replace $txt['home'] with $txt['home1'] because $txt['home'] is already defined in SMF language files.

Spuds

Yup ... your the first to notice :) I actually have that done in an update I'll get on the site later today with a couple of other minor fixes.

imburner

http://www.realhomemadeturbo.com/forum/index.php?action=googlemap Can you tell me whats the issue here with the map not showing up? Freshly installed

mikeymx5

did you turn it on in the settings / check permissions?

mikeymx5

OK I was able to find where it was pulling the code for Male and Female and Turn it into Group A vs Group B or in my case Club member vs Non Member groups.

in GoogleMap20.php you can change the code to

if ($marker['group'] == 'Club Member')
$markers.= 'gender="1"';
elseif ($marker['group'] == 'Non Member')
$markers.= 'gender="2"';
else $markers.= 'gender="0"';

Then under the template rename Male and Female to the Group Names.

While I understand that is not the correct way of doing this edit, but it will make it so i only have to edit a few lines if I update this package.

Thanks for the Mod it has really helped with our club.

imburner

Quote from: mikeymx5 on November 11, 2011, 01:36:08 PM
did you turn it on in the settings / check permissions?

Yes its all turned on

Spuds

And you entered an API key and the sitename in the box is what you set for your api key?  If that is good then its could be a missing js file, if you give me a test account I'll take a look.

Tonyvic

#1534
What a great mod, thanks guys. :)
I have a minor problem when viewed with Internet Explorer, the info bubble is very wide when showing a member with an avatar.
With no avatar it is normal, and when viewed with FF & Chrome everything is fine.

Tony

Spuds

Well that stinks !  Looks like IE is picking up some extra div info from the DOM structure that the others are not ...

Try this and see if it fixes the problem, in GoogleMap20.php

find the following (its what opens the info bubble when you click on the name)
gmarkers[i].openInfoWindowHtml(htmls[i]);
replace
gmarkers[i].openInfoWindowHtml(htmls[i], {maxWidth:240});

find the following, its what opens an info bubble when you click on the pin
marker.openInfoWindowHtml(html);
replace
marker.openInfoWindowHtml(html, {maxWidth:240});

Tonyvic

Many thanks Spuds,
That fixed it, now working perfectly. :)

Tony

tassie73

Hi spuds,

If I want to add a field in the profile page for members to write a blurb about themselves that is then displayed in the info blurb, how would I go about that mate?

This is a great mod you guys have here! So many uses and possibilities....

Cheers guys

Chris

Spuds

The information in the bubble is created in googlemap20.php in the MapsXML() function.

Look in there and you will see a string called datablurb, the information in that gets displayed in the bubble.  The bubble has a header, and then right an left divs, the right div is the avatar, the left div the info.

So you would need to check for the profile field in the MapsXML() function, and if it exists for the user add it to the blurb (as the list element in the left div)  for display.  I don't recall in which var the custom fields are stored but they should be available in the $markers array, just not sure what key they are under of the top of my head.

tassie73

Thanks mate. I will have a play around with it and let you know if I have any other questions.


Cheers

Chris

Advertisement: