Discussion Forums  >  Self Hosted Control Panels

Replies: 6    Views: 168

jordanko
I hate code!
Profile
Posts: 21
Reg: Nov 07, 2011
Miami
210
08/01/12 10:36 AM (13 years ago)

Issue with find the latitude / longitude in location map

Hi all. I am hoping someone might know the answer to this. I am creating a location map in the hosted buzztouch server but no matter what address I put in the "find the latitude / longitude" feature does not work - all I get is a message stating "Can't find coordinates!". When I use the "show another latitude longitude tool" I can find the info and plug it in, but it is somewhat cumbersome when typing in multiple points. I have used this feature on the buzztouch.com v1.5 and it works flawlessly. It will not work on the hosted server though. I am using hosted server v.2.1.6 - I didn't upgrade to 2.1.7 yet because this issue is not addressed in the change log. Thanks in advance for your help. Jordan
 
SkullyFox
Apple Fan
Profile
Posts: 169
Reg: Jul 15, 2012
Armidale
12,190
like
08/01/12 02:00 PM (13 years ago)
Mine does that occasionally also even when the coordinates are fine, just click "save" and it works anyway..
 
jordanko
I hate code!
Profile
Posts: 21
Reg: Nov 07, 2011
Miami
210
like
08/01/12 02:49 PM (13 years ago)
Yes, but saving the entry isn't the issue. The issue is trying to find the coordinates. The software is supposed to automatically obtain the coordinates and place them in the coordinates field pursuant to the address typed into the subtitle field. For some reason, however, the software will not automatically obtain the coordinates and they have to be sought elsewhere. By chance, have you been able to get the server software to automatically obtain the coordinates for you? If so, how? Thanks!
 
SkullyFox
Apple Fan
Profile
Posts: 169
Reg: Jul 15, 2012
Armidale
12,190
like
08/01/12 06:27 PM (13 years ago)
At this stage, no i havent - but in saying that i have not tried, i simply used the "show another latitude/longitude tool" from the get go. I will give it a go later, see what i come up with and get back to you :) Dave
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
08/01/12 11:05 PM (13 years ago)
OK, been looking at this today. Here's how it works when you enter a location using the Map Screen plugin... This file is the index.php page in the Map screen plugin directory. a) You enter a Title...TAB...focus goes to Sub-Title box. You enter an address (you don't have to enter an address but most folks do for the Sub-Title)...TAB... b) When you're cursor "leaves" the Sub-Title box, a javascript routine runs that fires a background process to fetch the latitude and longitude from the Google Maps API. c) The background script runs a routine in a PHP file. This PHP file is named itemLocationLookup_AJAX.php (also in the Map plugin directory). This file returns the lat / lon pair to the index.php page in the Map plugin directory. This is working in all the test I do. Naturally, if a "non-address" is entered in the Sub Title box, the Google API will not return a valid lat / lon pair. Consider cases where you don't want to use an address for the Sub Title. In these cases you'll end up needing to manually enter the lat / lon. I think we all understand the idea. So, if it's not working, you'll need to debug what isn't working. Start by opening a new browser window and testing the itemLocationLookup_AJAX.php file manually. Type in the URL and provide and address like... yourdomain.com/BT-server/files/plugins/bt_screen_map/itemLocationLookup_AJAX.php?address=1234 Elm St Anytown CA 93940 ENTER. You should get a lat / lon back like: 36.622362|-121.914486 This is lat / lon with a pipe (|) character in between. If you get something else back, or a blank screen, it's not working like it should. Assuming you entered a valid address, you'll need to dig into the itemLocationLookup_AJAX.php file to see where it's failing. The itemLocationLookup_AJAX.php is a simple file (relatively). It's only 20 or so lines of code and all it does is call the Google API EXACTLY like you did when you tested it in the address bar of your browser. It uses cURL to do this behind the scenes. cURL makes an HTTP request just like a regular browser. There isn't anything complex going on here. If it doesn't work, there are only three possible scenarios: 1) When you tab out of the Sub-Title field, the findAddress() javascript routine is not firing. This is in the index.php. It's very very unlikely that this is the case. 2) The address you enter is invalid or Google simply doesn't know what to do with it. 3) The cURL method in the itemLocationLookup_AJAX.php file isn't looking up the address (it's not making the HTTP request). In this case, you'll need to determine why cURL is not working on your server. Hope this helps.
 
SkullyFox
Apple Fan
Profile
Posts: 169
Reg: Jul 15, 2012
Armidale
12,190
like
08/01/12 11:14 PM (13 years ago)
Fantastic, Thanks Dave
 
jordanko
I hate code!
Profile
Posts: 21
Reg: Nov 07, 2011
Miami
210
like
08/03/12 10:21 PM (13 years ago)
Thanks for the insight, much appreciated!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.