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 vbgamer45, December 29, 2016, 12:59:42 PM

Previous topic - Next topic

vbgamer45

Link to the mod

Google Member Map

License

  • This Modifications Source Code is subject to the terms of the Mozilla Public License version 1.1 (the "License"). You can obtain a copy of the License at http://mozilla.org/MPL/1.1/.

Introduction

This mod installs a member map to your website which allows your members to pin their location on a map. It uses Google Maps 3.0 API to generate the map and place 'Push" pins.

Simply install this package through the package manager located in your Administration Panel. Manual edits may be required if your site uses a custom theme. This mod is compatible with SMF 2.0

In your admin panel you will need to enable it and set any customization you like. Next, your members will need to edit their profiles and place a pin on the map to show their location and save their profile. That pin will then display on the main member map page. The admin will also need to set the map permissions so users can see and use it.

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

Colin

Neat! It would be cool if you could add a screenshot of an example of the map that is generated.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

AllMassive

Oh - very nice - thank you so much !
I'm using the former Mod since ages, so: Will the 'old Pins' stay after Installation ?

vbgamer45

Not sure but it may I would do a backup just in case.
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

landyvlad

Hi, I followed the directions and have an unrestricted API key  (tried restricted to) from Google maps.

When I installed it, and set the features all seemed ok.

But when I tried to use it, a google map came up for a very brief period of time then it went blank, with the following error:

QuoteThis page didn't load Google Maps correctly. See the JavaScript console for technical details.

Oh, and now it's installed where do I find the part that allows me to admin it....  (silly question but not immediately obvious)

Also a suggestion - where it allows you to choose an icon - is it possible to have a preview of that icon so we can see what we are actually going to get?



EDIT:  Solved but for anyone's future reference the javascript console in your browser will give you precisely the domain you need to give permissions to in the Google API. :D

"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.

landyvlad

Still a note to the developers:

Oh, and now it's installed where do I find the part that allows me to admin it....  (silly question but not immediately obvious)

Also a suggestion - where it allows you to choose an icon - is it possible to have a preview of that icon so we can see what we are actually going to get?

"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.

landyvlad

Spoke too soon !

The map works on the members map page, but NOT on the profile page where people would actually input their information.


js?key=AIzaSyAai1kJAVMjvOAuiM1ZKFX5A87LwnwMj-4&sensor=false&libraries=places:34 Google Maps API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized: http://gsx1400owners.org/forum/index.php?action=profile;area=forumprofile
_.lb @ js?key=AIzaSyAai1kJAVMjvOAuiM1ZKFX5A87LwnwMj-4&sensor=false&libraries=places:34
(anonymous) @ common.js:54
(anonymous) @ common.js:196
c @ common.js:50
(anonymous) @ AuthenticationService.Authenticate?1shttp%3A%2F%2Fgsx1400owners.org%2Fforum%2Findex.php%3Faction%3D...:1
util.js:210 Google Maps API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required


I note that I have authorised the URL it mentions, but I'm not sure about the other errors?

Once you can help me get this sorted out, I'll remove the code from here.  CHeers.
"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

Your site URL to be authorized: http://gsx1400owners.org/forum/index.php?action=profile;area=forumprofile
That is the main error.
You might have to do the whole domain.
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

landyvlad

Thanks mate yeah I figured it out once I did the whole domain - works fine now :)  Great mod :)

I found the admin settings under Admin - Configuration - Modification Settings - member map.

Perhaps it's just me but that seems a bit buried. Most of the other mods I have are on the main tab - like SMF Gallery and EZPortal.  But I suppose there has to be a limit to that !    No doubt just an issue of me getting used to where things end up.

Cheers and thank you !
"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.

alain54100

bonjour
je viens de l installer  mais lorsque je met une adresse  en france  il me marque que je suis au caraibe ou je ne sait ou
pouvez vous me dire ou et le problème   !! merci a vous

vbgamer45

Haven't tested it much myself not sure how it works if it is by ip address then it depends on your isp
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

landyvlad

Having authorised the whole domain, I am getting:

Member Map from top menu bar (display) - works fine.
Member's updating their profile to place a pin. -works fine.
Member's viewing others (and subsequently their own) profile to see their pin location  - NOT working.


The error indicates a particular link to be authorised BUT this link would be different for every member; AND the whole domain is, in theory, authorised...

Any idea what may be going wrong?


edit: Just to let you know that in general my members are VERY impressed with this member map. So, good work :) 
"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.

GL700Wing

Quote from: landyvlad on January 29, 2017, 08:46:56 PM
Member's viewing others (and subsequently their own) profile to see their pin location  - NOT working.

...

Any idea what may be going wrong?

Have you enabled the 'View Member Map' permission for the relevant member group(s)?
Life doesn't have to be perfect to be wonderful ...

landyvlad

Yep.  It's only one the actual forum profiles that people can't see the map.  Other areas like placing their pin, and viewing the overall map - no problem.

It appears to be a problem with authorisation BUT I'm confused because the whole domain is authorised so it SHOUDL carry through; and the error indicates a particular link to be authorised BUT this link would be different for every member.

Hoping to MOD team can help.
"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.

landyvlad

OK I managed to solve this issue by adding yet another URL to the authorised list.
Confuses me because I thought the whole site would be authorised but evidently it doesn't work like that...


vbgamer - is the "Location" in members profile a field that is put in by this mod, or core SMF?
If it's the member map mod - how can I get location to show in the member info next to each of their posts (with avatar etc)

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

Not sure. I don't see in the code that mentions location placeholder.
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

Found a bug in this mod that was preventing the mod Member Notepad from displaying on the Profile Summary page (had to uninstall a lot of mods on a test forum to find the culprit!).

Basically the issue is that after the mod is installed a closing 'dl' tag in ./Themes/default/Profile.template.php is only being shown conditionally whereas without this mod installed it's always shown.

The correct code is as follows:
Find:
<dd>', $context['member']['last_login'], '</dd>
</dl>';


Replace with:
<dd>', $context['member']['last_login'], '</dd>';

if (!empty($modSettings['googleMap_Enable']) && allowedTo('googleMap_view'))
{
if (!empty($context['member']['googleMap']['longitude']) && !empty($context['member']['googleMap']['latitude']))
{
echo '
</dl>
<hr />
<br />
<dl>
<dt><strong>' . $txt['googleMap_Where'] . ' ' . (preg_match('~\s(and|&|&amp;)\s~i', $context['member']['name']) ? $txt['googleMap_Whereare'] : $txt['googleMap_Whereis']) . ' ' . $context['member']['name'] . ':</strong></dt>
<dd>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?key=' . $modSettings['googleMap_Key'] . '&sensor=false"></script>
<div id="map_canvas" style="width: 100%; height: 350px; color: #000000;"></div>
<input type="hidden" name="latitude" size="50" value="', $context['member']['googleMap']['latitude'], '" />
<input type="hidden" name="longitude" size="50" value="', $context['member']['googleMap']['longitude'], '" />
<input type="hidden" name="pindate" size="50" value="', $context['member']['googleMap']['pindate'], '" />
<script type="text/javascript"><!-- // --><', '', '![CDATA[
var latlng = new google.maps.LatLng(', $context['member']['googleMap']['latitude'], ', ', $context['member']['googleMap']['longitude'], ');
var options = {
zoom: 14,
center: latlng,
scrollwheel: false,
mapTypeId: google.maps.MapTypeId.HYBRID,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.DEFAULT
},
};
map = new google.maps.Map(document.getElementById("map_canvas"), options);
var marker = new google.maps.Marker({
position: latlng,
map: map
});
// ]]', '', '></script>
</dd>';
}
}

echo '
</dl>';
Life doesn't have to be perfect to be wonderful ...

Alain Rheault

 8)   the script in that last message as been corrected with the last version of th MOD  ...

But i stil get  that error  from google ...

"Google Maps API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required"

in the Profil.template.php  the line that i read  on line 298 ...

<script type="text/javascript" src="https://maps.google.com/maps/api/js?key=' . $modSettings['googleMap_Key'] . '&sensor=false"></script>

the end of it might be wath is causing this ... ?  but seem an error from google map ...
By the way ... the app work fine exep  a second of lag .. before google map send the litles orange message in the Mozila developer tools ...

I tried to change .. False to true ... removing  the  last argument ... notimg is good to stop those orange liner to came in ...

Wath could i do ...  :-[

I do not find the good coding ...

Thank's in advance for any help !

vbgamer45

So removing it doesn't help?
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

Quote from: Alain Rheault on March 07, 2017, 12:46:59 PM
8)   the script in that last message as been corrected with the last version of the MOD  ...
What is the latest version of the mod?

I encountered the problem with v3.0 which I downloaded at the end of January - I've just installed v3.0 again (test forum, no other mods installed) from a fresh download via the link in the first message in this thread and the problem is still there (ie, if the Member Notepad mod is installed and Google Maps is *disabled* the notepad doesn't show in the member's profile summary).
Life doesn't have to be perfect to be wonderful ...

Advertisement: