User map [Deleted]

I'll PC you the latest version (1.7)
I don't think any of those things are a problem any more. Well, a few "beta" testers have not reported anything.
 
All fixed now. A combination of PEBCAK and a bug on my side. :)


Note to others: You cannot tick the Show Individual Pins. The map will not render with that selected.


I'll fix it soon and do a release.
 
I'm not actually 100% sure it was me. Somehow, I had a space added on to the end of the API keys (both of them). When I deleted the keys completely, then added them back in without the space, the error stopped occurring. Then when I added the space back in, just to try and break it again, it still didn't throw the error. It just suddenly started working.

unchecking requiring user location on registration fixed registrations getting blocked, unchecking Show Individual Pins allowed the map to start working - can see everyone's pins

I have re-checked Require Location and registration still works. I can't break the API key even by adding 10 spaces at the end now.
 
Version 1.7 still getting this error, which I found is happening when a user with no map location filled in, opens the "View your own map" link...

Code:
Server Error Log
Error Info
ErrorException: Undefined index: map_location - library/Crispin/UserMap/ControllerPublic/UserMap.php:16
Generated By: xxxxxxxxxxxxx, A moment ago
Stack Trace
#0 /var/www/clients/client180/web812/web/library/Crispin/UserMap/ControllerPublic/UserMap.php(16): XenForo_Application::handlePhpError(8, 'Undefined index...', '/var/www/client...', 16, Array)
#1 /var/www/clients/client180/web812/web/library/XenForo/FrontController.php(351): Crispin_UserMap_ControllerPublic_UserMap->actionIndex()
#2 /var/www/clients/client180/web812/web/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#3 /var/www/clients/client180/web812/web/index.php(13): XenForo_FrontController->run()
#4 {main}
Request State
array(3) {
  ["url"] => string(51) "https://www.xxxxxxxxxxxx.com/usermap?viewuser=1/"
  ["_GET"] => array(1) {
    ["viewuser"] => string(2) "1/"
  }
  ["_POST"] => array(0) {
  }
}


Second thing.... now there is a field for SERVER AND BROWSER APIs? What does this mean? Why two APIs? And what are they doing? It would be great to get some instructions for the best practice.
 
Last edited:
So I just need one key? The browser key? I find it very hard to understand the stuff when there is no clue what the intentions of the functionality in context of the add-on is...
 
@CrispinP mentioned to me that the you don't really need the browser key but I'm using it anyways.

What I did was:

Create Google Cloud account & Register project
Add/enable the Google Maps Geocoding API and the Google Maps Javascript API
Go through the Oauth Consent and Domain Verification (in my case I had to add a txt entry to the DNS Zone File but I think there is more than one way)
Get the Brower and Server keys
Under the Server Key, do not add an IP address even if you have a dedicate IP for your installation
Under the Browser Key, add the wildcard field like they outline
Paste these into the ACP fields
Wait. They say 5 minutes but IME I think it took longer.
Go to the Geocoding > Usage screen
Update your usermap with /usermap/massupdate
Refresh the Usage screen. You should see activity.
 
Under the Server Key, do not add an IP address
@CrispinP I think this is actually what was causing my issue with authorizing the API, either that, or it was taking too long for the API to get set up. This is the other thing I removed before the addon started working. But I went back and added it again just now and changed my location and I got a completely different server error
Error Info
XenForo_Exception: API access to Google was denied.This IP, site or mobile application is not authorized to use this API key. Request received from IP address 208.100.58.82, with empty referer - library/Crispin/UserMap/Model/UserMaps.php:242
Generated By: Turbo, 6 minutes ago
Stack Trace

#0 /home/***/public_html/library/Crispin/UserMap/DataWriter/User.php(19): Crispin_UserMap_Model_UserMaps->getGeoLocationFromLocation(1, 'Iowa (United St...')
#1 /home/***/public_html/library/XenForo/DataWriter.php(1423): Crispin_UserMap_DataWriter_User->_postSave()
#2 /home/***/public_html/library/XenForo/ControllerPublic/Account.php(313): XenForo_DataWriter->save()
#3 /home/***/public_html/library/Awedo/ACLocation/ControllerPublic/Account.php(48): XenForo_ControllerPublic_Account->actionPersonalDetailsSave()
#4 /home/***/public_html/library/XenForo/FrontController.php(351): Awedo_ACLocation_ControllerPublic_Account->actionPersonalDetailsSave()
#5 /home/***/public_html/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /home/***/public_html/index.php(13): XenForo_FrontController->run()
#7 {main}
instead of
Error Info
XenForo_Exception: API access to Google was not OK. Returned. - library/Crispin/UserMap/Model/UserMaps.php:251
Generated By: Turbo, 25 minutes ago
Stack Trace
"not OK" is some weird generic error that was really not helpful so I don't know what was going on - the space after the API key entries in ACP could have been it. The server IP address entry could have been it.

just including all of this here in case someone with as little knowledge as I decides to get this addon and set up all the API keys and then runs into similar errors. I would hope this would save them the headache.

On the next installation, I plan to duplicate my same errors and see if I get the same results :LOL:
 
@CrispinP mentioned to me that the you don't really need the browser key but I'm using it anyways.

What I did was:

Create Google Cloud account & Register project
Add/enable the Google Maps Geocoding API and the Google Maps Javascript API
Go through the Oauth Consent and Domain Verification (in my case I had to add a txt entry to the DNS Zone File but I think there is more than one way)
Get the Brower and Server keys
Under the Server Key, do not add an IP address even if you have a dedicate IP for your installation
Under the Browser Key, add the wildcard field like they outline
Paste these into the ACP fields
Wait. They say 5 minutes but IME I think it took longer.
Go to the Geocoding > Usage screen
Update your usermap with /usermap/massupdate
Refresh the Usage screen. You should see activity.
Okay, that is a little more than I was expecting. A few steps more than the other map add-on I had. Everybody here said JavaScript API would be enough, now Geocoding is needed too. I will try this. Thanks.
 
@Mouth said javascript was all you need, but @CrispinP kept referring to the Geocoding API and the 2500/day limit, so I just added both as I didn't get clarification on which one was actually needed or if both were. I'll test that out on the next site :)
 
This is also assuming that a key is needed at all. I wasn't exactly clear on this but couldn't get it to work without one for some odd reason, that may have been this one though
Note to others: You cannot tick the Show Individual Pins. The map will not render with that selected.
 
@CrispinP mentioned to me that the you don't really need the browser key but I'm using it anyways.

What I did was:

Create Google Cloud account & Register project
Add/enable the Google Maps Geocoding API and the Google Maps Javascript API
Go through the Oauth Consent and Domain Verification (in my case I had to add a txt entry to the DNS Zone File but I think there is more than one way)
Get the Brower and Server keys
Under the Server Key, do not add an IP address even if you have a dedicate IP for your installation
Under the Browser Key, add the wildcard field like they outline
Paste these into the ACP fields
Wait. They say 5 minutes but IME I think it took longer.
Go to the Geocoding > Usage screen
Update your usermap with /usermap/massupdate
Refresh the Usage screen. You should see activity.


So.... I did as you said to setup the stuff...

The mass update actually showed a page with a list of updated locations from the users (who had filled in their "location" field).
The Google Page showed "Activity" in the stream...
Still no pins on the map...

To avoid wasting my time by continuing with fishing in muddy waters, I strongly recommend that @CrispinP posts a "best practice for setting up Google APIs for this add-on" as reference here, so we can be sure at least that we have done all right according to the functionality of the add-on. If we have done it right in setting it up and it still doesn't work, we can be sure it is a bug.
 
I am just not seeing the usermap. XML installed without server error, "Crispin User Map" options can be set and saved, both available user group permissions are set to "yes" for administratives - but visiting
http://ip/xen/xenforo/usermap with administrator gives me a 404 - it's just not there.

May this be because of the ip-address instead of a domain? Or because of the additional folder "xen" before xenforo root?
Or, I have Debian 7 with PHP 5.3.3 installed, 5.4 is not currently available.

I've tried now on a local XAMP installation with PHP 5.6 in localhost/xenforo/usermap - and it's the same, 404

What did you do to make this run?
  • normal addon: copy "upload", choose xml to install
  • afterwards go into Options - Crispin Usermap - just have a look and save, no Google API key needed at the beginning (Crispin said so)
  • go to Usergroup permission, set both option to "yes" (for administratives, as I use an admanistrator to test)
  • Go into user profile of admin, set a location in field "Map location", like "10787, Berlin"
  • visit localhost/xenforo/usermap
Forgot anything?
Get 404 ...

I really feel like a dummy - what I am missing here, I don't get this to run. Is it the same, as you guys did or do I forget a step?
I always get 404 when trying to call usermap.
 
Top Bottom