News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Google Member Map

Started by vbgamer45, December 29, 2016, 12:59:42 PM

Previous topic - Next topic

Dan_

I uninstalled 3.01 and installed 3.02,  Still have the mixed content warning...  It does seem to stay green until the pins load.

attached...

vbgamer45

Hmm made another change. new update before I just updated the .js file now made a php files changes for the same cluster image code.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Dan_

Bingo!  ;D

I had to delete the 3.02 file, it told me I already had the package on the server...   But all green padlocks now.  Awesomeness.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Juan Carlos

Excellent mod, it would be perfect to have it for 2.1 beta
Juan Carlos

vbgamer45

Will do once 2.1 final comes out
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

lup1n2

Hi
looks like a great mod but i cant get to add pins to it i i click the "Click here to add or edit your pin location on the map." but it brings up the user profile and there is no where to add the location . any help would be gratefully received 

Thanks In Advance


lup1n2

Ok got it to work but.. only an admin can place the pins. The normal members cannot see the location in their profile, But also there is no google map  permissions in the admin area to assign to members

Any help would be appreciated

landyvlad

Admin - Configuration - modification settings - member map.

ensure the mod is enabled.

And under Members - General Permissions in the "general section" there is are options
View member Map
Place pins on member map

ensure both are ticked.

"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

alamin

Suddenly my map has stopped working! :'(
hxxp:prnt.sc/gr9uva [nonactive]

Louis

#70
Feature request:
(1) remove styles from template into css file
(2) make the whole template a bit more responsive, e.g. by replacing the table structures by floating css boxes

I just started working on this for a forum using the reseller theme - this is what I've done so far:

Added some lines of css to GoogleMap.css
#mapWindow { margin-bottom: 10px; height: 512px; }
#map_leftSidebar { white-space: nowrap; display: inline-block; padding-right: 10px; }
#map_rightSidebar { display: inline-block; white-space: nowrap; padding-left: 10px; }
#map_main { display: inline-block; width: 80%; }
#map { height: 500px; }
.mapFloatingbox { display: inline-block; padding: 5px; }


and modified GoogleMap.template.php:<?php
// Google Member Maps Modification

function template_map()
{
global $context$modSettings$scripturl$txt$settings;

if (!empty($modSettings['googleMap_Enable']))
{
echo '
<div id="main_container">
<div class="cat_bar">
<h3 class="catbg">'
$txt['googleMap'], '</h3>
</div>

<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">'
;

// Show a left sidebar?
if ((!empty($modSettings['googleMap_Sidebar'])) && $modSettings['googleMap_Sidebar'] == 'left')
{
echo '
<div id="map_leftSidebar">
<div class="centertext"><em><strong>'
$txt['googleMap_Pinned'], '</strong></em></div>
<hr style="width: 94%;" />
<div id="googleSidebar" class="googleMap_Sidebar" ></div>'
;

if (!empty($modSettings['googleMap_BoldMember']))
echo '
<div class="centertext googleMap_Legend">
<strong>' 
$txt['googleMap_bold'] . '</strong>&nbsp;' $txt['googleMap_OnMove'] . '
</div>'
;

echo '
</div>'
;
}

// our map
echo '
<div id="map_main">
<div id="mapWindow">
<div id="map"></div>
<div id="googleMapReset" onclick="resetMap(); return false;" title="'
$txt['googleMap_Reset'] . '"></div>
</div>'
;

// Set the text for the number of pins we are, or can, show
if ($context['total_pins'] >= $modSettings['googleMap_PinNumber'] && $modSettings['googleMap_PinNumber'] != 0)
echo
sprintf($txt['googleMap_Thereare'], '<strong>(' $modSettings['googleMap_PinNumber'] . '+)</strong>');
else
echo
sprintf($txt['googleMap_Thereare'], '<strong>(' $context['total_pins'] . ')</strong>');

echo '
</div>'
;

// Show a right sidebar?
if (!empty($modSettings['googleMap_Sidebar']) && $modSettings['googleMap_Sidebar'] == 'right')
{
echo '
<div id="map_rightSidebar">
<div class="centertext"><em><strong>'
$txt['googleMap_Pinned'], '</strong></em></div>
<hr style="width: 94%;" />
<div id="googleSidebar" class="googleMap_Sidebar"></div>'
;

if (!empty($modSettings['googleMap_BoldMember']))
echo '
<div class="centertext googleMap_Legend">
<strong>' 
$txt['googleMap_bold'] . '</strong>&nbsp;' $txt['googleMap_OnMove'] . '
</div>'
;

echo '
</div>'
;
}

// Show a legend?
if (!empty($modSettings['googleMap_EnableLegend']))
{
echo '
<div class="cat_bar">
<h4 class="catbg"><span class="align_left">'
$txt['googleMap_Legend'], '</span></h4>
</div>
<div class="centertext">'
;

if (empty($modSettings['googleMap_PinGender']))
echo '
<div class="mapFloatingbox"><img src="https://chart.apis.google.com/chart'
$modSettings['npin'], '" alt="" />'$txt['googleMap_MemberPin'], '</div>';
else
echo  '
<div class="mapFloatingbox"><img src="https://chart.apis.google.com/chart'
$modSettings['npin'], '" alt="" />'$txt['googleMap_AndrogynyPin'], '</div>
<div class="mapFloatingbox"><img src="https://chart.apis.google.com/chart'
$modSettings['mpin'], '" alt="" />'$txt['googleMap_MalePin'], '</div>
<div class="mapFloatingbox"><img src="https://chart.apis.google.com/chart'
$modSettings['fpin'], '" alt="" />'$txt['googleMap_FemalePin'], '</div>';

if (!empty($modSettings['googleMap_EnableClusterer']) && ($context['total_pins'] > (!empty($modSettings['googleMap_MinMarkertoCluster']) ? $modSettings['googleMap_MinMarkertoCluster'] : 0)))
{
$codebase 'https://raw.githubusercontent.com/googlemaps/v3-utility-library/master/markerclusterer';
$chartbase "https://chart.apis.google.com/chart";

switch ($modSettings['cpin'])
{
case 1:
$pinsrc $codebase '/images/m1.png';
break;
case 2:
$pinsrc $codebase '/images/people35.png';
break;
case 3:
$pinsrc $codebase '/images/conv30.png';
break;
default:
$pinsrc $chartbase $modSettings['cpin'];
}

echo '
<div class="mapFloatingbox"><img src="' 
$pinsrc '" height=37 />'$txt['googleMap_GroupOfPins'], '</div>';
}

echo '
</div>'
;
}

echo '
<div class="centertext">'
;

// If they can place a pin, give them a hint
if (allowedTo('googleMap_place'))
echo '
<a href="'
$scripturl'?action=profile;area=forumprofile">'$txt['googleMap_AddPinNote'], '</a>
'
;

// Google earth klm output enabled?
if (!empty($modSettings['googleMap_KMLoutput_enable']))
echo '
<br><a href="'
$scripturl'?action=.kml"><img src="'$settings['default_theme_url'], '/images/google_earth_feed.gif" border="0" alt="" /></a>
'
;
echo '
</div>'
;

// Close it up jim
echo '
</div>
<span class="botslice"><span></span></span>
</div>
</div>'
;

// Load the scripts so we can render the map
echo '
<script type="text/javascript" src="https://maps.google.com/maps/api/js?key=' 
$modSettings['googleMap_Key'] . '&sensor=false"></script>
<script type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/markerclusterer_compiled.js"></script>
<script type="text/javascript" src="'
$scripturl'?action=googlemap;sa=.js;count='$context['total_pins'] .'"></script>';
}
}
?>



Pls note: This is work in progress and has only been roughly tested with SMF 2.0.14 and a modified Reseller theme - YMMV.
It is your mind that creates this world (Buddha)

Louis

Another minor change I found useful for "nicer" display of user details after clicking on the pin:

add to css.googleMap img.avatar { max-width: 240px; max-height: 240px; }

change line 505 of GoogleMap.php from <div class="floatright" style="height:' . $div_height . 'px">' . $marker['avatar']['image'] . '<br /></div>';

to <div class="floatright" style="max-height:' . $div_height . 'px">' . $marker['avatar']['image'] . '<br /></div>';
It is your mind that creates this world (Buddha)

Louis

And a minor bug: the PM link expanded over the blurb text in the user pin popup - it is lacking a closing </a> tag in GoogleMap.php line 566
Correct code should be (line 561ff.) // Show the PM tag
$datablurb .= '
<li>
<a href="' . $scripturl . '?action=pm;sa=send;u=' . $marker['id'] . '">';
$datablurb .= $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($marker['online']['is_online'] ? 'on' : 'off') . '.gif" height="16" border="0" />' : ($marker['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']);
$datablurb .= '</a>
</li>
It is your mind that creates this world (Buddha)

vbgamer45

Update
3.0.4
!Fixed closing </a> tag in a couple spots thanks to Louis
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

GL700Wing

#74
Thanks for the update.

Also, and I know it's only minor, but the issue I reported in Profile.template.ph in February is still not fixed which means I had to do a manual edit again to get this mod to work with Member Notepad.
Life doesn't have to be perfect to be wonderful ...

lather

This was working on our old server. When we moved to a new server the forum would not work and I tried reapair-settings including remove all hooks. Finally resorted to uploading a fresh set of files which removed all mods. I have re-installed Google Member Map and the map dispalys as well as the list of members who had previously placed pins but no pins show on the map.
Also trying to add a pins does not work.
What do I need to do to fix this?

http://www.ridemsta.com/mstaforums/index.php?action=googlemap

Thanks

Louis

#76
Quote from: lather on October 18, 2017, 12:51:23 PMbut no pins show on the map
The pins do show on the map, but apparently all appear at 0.0S 0.0E somewhere off the coast of Africa. Are the coordinates still correct in the database? (Would be surprised if not, but asking anyway)
It is your mind that creates this world (Buddha)

lather

Quote from: Louis on October 18, 2017, 03:51:30 PM
Quote from: lather on October 18, 2017, 12:51:23 PMbut no pins show on the map
The pins do show on the map, but apparently all appear at 0.0S 0.0E somewhere off the coast of Africa. Are the coordinates still correct in the database? (Would be surprised if not, but asking anyway)
Yes the coordinates appear to be correct, longitude in the -84 to -77 and latitude 26-40 range which is continental USA, certainly not the Gulf of Guinea. I think that spot where the pins display is probably lat 0 and long 0

landyvlad

What is the update process please?  Is it just upload and install the new one, or do I uninstall./delete the old one first?
(It'd be cool if this info was included in the description of the mod, for easy reference)

Thanks
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: