Advertisement:

Author Topic: Google Member Map  (Read 21687 times)

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,473
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Google Member Map
« on: December 29, 2016, 12:59:42 PM »
Link to Mod

Originally by Spuds posted with new bug fixes.

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.


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

Offline Colin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,858
  • Gender: Male
  • SMF Developer
    • colinschoen on GitHub
Re: Google Member Map
« Reply #1 on: December 29, 2016, 01:06:01 PM »
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

Offline AllMassive

  • Jr. Member
  • **
  • Posts: 141
  • Gender: Male
Re: Google Member Map
« Reply #2 on: January 23, 2017, 05:17:59 PM »
Oh - very nice - thank you so much !
I'm using the former Mod since ages, so: Will the 'old Pins' stay after Installation ?

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,473
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Google Member Map
« Reply #3 on: January 23, 2017, 05:19:04 PM »
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

Offline landyvlad

  • Full Member
  • ***
  • Posts: 615
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Google Member Map
« Reply #4 on: January 27, 2017, 11:25:38 PM »
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:

Quote
This 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

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.

To paraphrase Kindred: "There are no technical solutions to social problems."

Offline landyvlad

  • Full Member
  • ***
  • Posts: 615
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Google Member Map
« Reply #5 on: January 27, 2017, 11:30:38 PM »
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?

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.

To paraphrase Kindred: "There are no technical solutions to social problems."

Offline landyvlad

  • Full Member
  • ***
  • Posts: 615
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Google Member Map
« Reply #6 on: January 27, 2017, 11:39:38 PM »
Spoke too soon !

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

Code: [Select]
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.
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.

To paraphrase Kindred: "There are no technical solutions to social problems."

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,473
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Google Member Map
« Reply #7 on: January 28, 2017, 12:15:26 AM »
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

Offline landyvlad

  • Full Member
  • ***
  • Posts: 615
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Google Member Map
« Reply #8 on: January 28, 2017, 12:49:46 AM »
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 !
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.

To paraphrase Kindred: "There are no technical solutions to social problems."

Offline alain54100

  • Jr. Member
  • **
  • Posts: 220
  • Gender: Male
    • http://www.federation-pizzaiolos-france.fr/forum
Re: Google Member Map
« Reply #9 on: January 28, 2017, 02:14:27 PM »
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

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,473
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Google Member Map
« Reply #10 on: January 28, 2017, 07:43:24 PM »
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

Offline landyvlad

  • Full Member
  • ***
  • Posts: 615
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Google Member Map
« Reply #11 on: January 29, 2017, 08:46:56 PM »
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 :) 
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.

To paraphrase Kindred: "There are no technical solutions to social problems."

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 440
  • Gender: Female
Re: Google Member Map
« Reply #12 on: January 29, 2017, 10:45: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)?

Offline landyvlad

  • Full Member
  • ***
  • Posts: 615
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Google Member Map
« Reply #13 on: January 30, 2017, 09:27:11 PM »
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.
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.

To paraphrase Kindred: "There are no technical solutions to social problems."

Offline landyvlad

  • Full Member
  • ***
  • Posts: 615
  • Gender: Male
    • Michael Reed on Facebook
    • GSX1400 Owners ORG
Re: Google Member Map
« Reply #14 on: February 01, 2017, 01:57:39 AM »
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
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.

To paraphrase Kindred: "There are no technical solutions to social problems."

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,473
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Google Member Map
« Reply #15 on: February 02, 2017, 08:21:30 PM »
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

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 440
  • Gender: Female
Re: Google Member Map
« Reply #16 on: February 27, 2017, 12:55:55 AM »
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:
Code: [Select]
<dd>', $context['member']['last_login'], '</dd>
</dl>';

Replace with:
Code: [Select]
<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>';

Offline Alain Rheault

  • Semi-Newbie
  • *
  • Posts: 15
Re: Google Member Map
« Reply #17 on: March 07, 2017, 12:46:59 PM »
 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 ...

Code: [Select]
"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 ...

Code: [Select]
<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 !

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,473
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Google Member Map
« Reply #18 on: March 07, 2017, 01:30:28 PM »
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

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 440
  • Gender: Female
Re: Google Member Map
« Reply #19 on: March 07, 2017, 04:58:18 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).