[XT] Membermap

[XT] Membermap 1.0.2

No permission to download
  1. Google Maps JavaScript API is for creating the map.
  2. Google Geocoding API is for create Lat/Long values from the location field.
  3. Google Maps Static API is for creating the minimap shown in the user account.
  4. Google Places API is for autocomplete the location field.
So i mean that API 1 is user browser and 2-4 is server side. Am i right @Hoffi ?
 
@mcatze We need payment for using Google Maps API? Google forcing to You are not an administrator of any billing accounts. To enable billing on this project, create a new billing account.
 
Not necessarily payment.
You need to have a billing account setup in case you go over the free allocation of API calls, however they have an very generous free tier. Hundreds of thousands of call per month, you can google the current amount. Most small sites will not hit this and hence you won't be charged.
It's why it's important to restrict your API keys to your own domain though.
If you have an incredibly busy site you'll want to monitor it.
 
So i mean that API 1 is user browser and 2-4 is server side. Am i right @Hoffi ?
I'd like to suggest you create 2 API key settings for these within ACP, 1 for browser and 1 for server side, so that we can safely/securely our API accounts and keys. When they're combined, you cannot apply restrictions and your API key, and thus billing, can be used by anyone and/or any website.

Screen Shot 2021-04-19 at 14.39.32.webp
 
Last edited:
I'd like to suggest you create 2 API key settings for these within ACP, 1 for browser and 1 for server side, so that we can safely/securely our API accounts and keys. When they're combined, you cannot apply restrictions and your API key, and thus billing, can be used by anyone and/or any website.
Thats a good point I think. I have made an issue entry at GitHub for this.
 
How do existing members appear on the maps?
Despite using 'XT: Make ALL user in map visible' and then 'XT: Rebuild user lat/long data', both from /admin.php?tools/rebuild, I only get 3 users appearing on the map. Hundreds have valid values within their 'Location' field.
 
The way I have do it:

1. XT: Rebuild user lat/long data to build lat/long from existing location field entries, attention this uses the API and can cost
2. XT: Make ALL user in map visible to switch the database fields for visibility from "0" to "1" for ALL members at once

Thats all - after that I have in my case over 2.000 members at my map:
1618831956078.png

I use Xenforo 2.2.x latest and the latest RC2 of the XT:Membermap addon

The addon comes with a own log for API requests - do you activate it take a look at?

For German XT:Membermap users:
Translation to German language: https://www.xendach.de/resources/membermap-de-sprachpaket-xt.390/
 
I use Xenforo 2.2.x latest and the latest RC2 of the XT:Membermap addon
Same versions, and same actions. But only 3 users shown on the map for me.
Nothing within /admin.php?xt-api-logs/ for the rebuilds.
 
What says a look at your database at table xf_user_profile at fields xt_mm_... :
1618832737554.png

Are there only 3 (as you say) such complete map entries or a lot more?
If a lot more, then they should visible at map. This works for since Beta 4 of the addon.
 
Yes of course, its worldwide - and the best: one tractor at map stands often for more than one Zetor tractor. Looks like the Red Armee of tractors. ;)
1618838099495.webp

Clustering will have a better performance, but it looks just better the way it looks now. :D
 
Are there only 3 (as you say) such complete map entries or a lot more?
From 3, to now 4. Looks to me like geocoding of existing users is not working, only once they update their location or save their profile?

SQL:
mysql> select xt_mm_location_lat, xt_mm_location_long, xt_mm_show_on_map from xf_user_profile where xt_mm_location_lat <> 0;
+------------------------------------+------------------------------------+-------------------+
| xt_mm_location_lat                 | xt_mm_location_long                | xt_mm_show_on_map |
+------------------------------------+------------------------------------+-------------------+
| -28.016667000000000000000000000000 | 153.400000000000000000000000000000 |                 1 |
| -35.280936800000000000000000000000 | 149.130009200000000000000000000000 |                 1 |
| -32.231501800000000000000000000000 | 148.632964500000000000000000000000 |                 1 |
| -31.433333000000000000000000000000 | 152.900000000000000000000000000000 |                 1 |
+------------------------------------+------------------------------------+-------------------+
4 rows in set (0.02 sec)

mysql> select count(user_id) from xf_user_profile where xt_mm_show_on_map = 1;
+----------------+
| count(user_id) |
+----------------+
|          60324 |
+----------------+
1 row in set (0.02 sec)

mysql> select count(user_id) from xf_user_profile where location <> '';
+----------------+
| count(user_id) |
+----------------+
|          22083 |
+----------------+
1 row in set (0.02 sec)
 
Your APIs are all active and have no limitations?
Try to rebuild the addon first and then again let the XT: Rebuild user lat/long data run.
1618898044430.webp
 
Your APIs are all active and have no limitations?
Active, and restricted to just the 4 API's required as per ACP settings, /admin.php?options/groups/xt_membermap/

Screen Shot 2021-04-20 at 16.03.11.webp


Try to rebuild the addon first and then again let the XT: Rebuild user lat/long data run.
That appears to have done it, thanks! :)

SQL:
mysql> select count(user_id) from xf_user_profile where xt_mm_location_lat <> 0;
+----------------+
| count(user_id) |
+----------------+
|          21909 |
+----------------+
1 row in set (0.01 sec)
 
Suggestion:
For both performance and relevance, add an ACP option so that only users active in the last xx (admin defined) months are displayed on the map.
 
Last edited:
Suggestion:
For both performance and relevance, add an ACP option so that only users active in the last xx (admin defined) months are displayed on the map.
Good Point. But maybe use the default XF User is active setting for this, to make the displays aligned.
 
Bug:
URL is /xt-membermap/ but template xt_mm_index outputs canonical as /membermap
Code:
<xf:macro template="metadata_macros" name="canonical_url" arg-canonicalUrl="{{ link('canonical:membermap') }}" />

Realised/fixed because I added a route filter to change /xt-membermap to /membermap
 
Suggestion:
If user visiting Membermap index has a lat/long within their profile, use that as the Default Lat/Long for map display centering. Fall back to ACP Default Lat/Long if the user does not have lat/long within their profile. Thus, map will centre and zoom around users own location, and showing nearby users.
 
Top Bottom