Technology Tools for Ministry

Community

Web-Empowered Church User Community
All Categories > Ministry Tools > Map Extension > Small extension trouble
Total Posts: 5 - Pages (1): [1]
Author: Ralf Kossmehl
Posted: Apr 24 2008 - 10:19 AM
Subject: Small extension trouble
Hello all,

first of all I would like to thank you for this great extension. I've already tested v1, but v2 is a remarkable improvement. Thanks again.
I have 1 question and two small problems.
Do I have to fill in the field with the default country with an ISO-Countrycode or with the country name (DE, CH or Germany, Switzerland). I haven't been able to find out.

My two problems:

1. It seems you have an error somewhere in your code, rendering the title marker for the bubble results in this:
<div class="" infotitle="">
and I haven't made any changes.
2. I don't know if somebody else already addressed this problem, but this is really strange.
No matter if from or to, typing in the directions only the city sometimes results in a 602 error, eg Lahr (DE) or Herisau (CH) throw this error, but typing in zip +city or a street name +city shows the route correctly. This is really strange as typing in the name of a small village with a few hundred inhabitants without address or zip shows it, and Herisau (16000 inhabitants) and Lahr (30000 inhabitants) show an error.

I tried to find out where the problem comes from, but I haven't been able to track it back.


Any help would be really appreciated.

Thanks in advance and best regards

Ralf
user picture Author: Christoph Koehler
Posted: Apr 24 2008 - 11:01 AM
Subject: re: Small extension trouble
Ralf,

0. The country is passed like that to the Google geocoder, so Germany or Switzerland should work. Not sure if Google understands ISO codes, but it may work.

1. That is often caused if you have html_cleaning turned on. There is a bug currently that makes directions not work if you have quotes in your title, but that's fixed in SVN and doesn't look like your problem.

2. That stuff is passe directly to Google, so not sure it's anything we can do. It can be pretty picky with non-US addresses. It may not know what country the city is in. For example there are many "Paris" in the US, so it has to do some guessing which sometimes doesn't work out too well.

Christoph
Author: Ralf Kossmehl
Posted: Apr 24 2008 - 01:12 PM
Subject: re: Small extension trouble
Hi Christoph,
thanks for the reply,
I'll try it with html_cleaning turned off.

602: I researched around a little to get a clue on how this google stuff works, and since I know a little bit on how servers and requests work, I made a guess on how the google requests are treated by the server you put the request on.
And guess what, I was absolutely right with my guess, at least now it works, it doesnt throw an error anymore.

The point is the server you are passing the request to.
I took a look at your code and it is passing the request to a maps.google.com, suppose this one is located in the US.
I think its normal it would first search within the "national records".
OK a locale is passed with the request, but it just tells the API to deliver output in german language, I don't think it would give the server a clue on where to search first.

So I changed the server to a server located in Switzerland maps.google.ch, and guess what, searching just for Herisau without an address or zip now shows the location correctly.

I also tried with Lahr, Germany, the other city that threw an error, and this also works.

Like I said, seems that the location of the google server is also important to avoid erroneous results.
OK, I don't think you have to select the closest server, but maybe one located eg in Europe if the extension is run in Europe, an African if you run it in Africa, etc.

Would suggest you add a listbox to choose the closest google server, or just add an input field where the user can input the TLD of his country or the nearest google server. Something like that.
This then would translate to the request addresses in class.tx_wecmap_map_google.php and class.tx_wecmap_geocode_google.php.

This is a suggestion, hope this helps.

Thanks again and best regards

Ralf
user picture Author: Christoph Koehler
Posted: Apr 24 2008 - 01:57 PM
Subject: re: Small extension trouble
Ralf,

I looked into your suggestion and it's indeed documented that you can use different countries' geocoding servers. It looks like you can also include the maps js from there, but I need to research that more. This should give better results in geocoding but may not make any difference in the directions. We use the GDirection object which, like you noted, only takes a locale for result language, but no base country. Including the maps js from a regionally closer server may change that, but I am not sure.
That all to say that I like the idea and will probably implement something like that in one of the next versions.

Christoph
Author: Ralf Kossmehl
Posted: Apr 24 2008 - 02:15 PM
Subject: re: Small extension trouble
Hello Christoph,
well, I know that such a search algo like google must be using is a lot more complex than what I tried to explain in my post, but when I switched the server in your scripts to a european one, the error that I had before was completely gone.

OK I turned off html_cleaning, and you where right, seems like html_cleaning has a bug.

Many many thanks for your help, I'm looking forward for more great results, and maybe I can help you step forward in one way or the other.

Best regards

Ralf
Total Posts: 5 - Pages (1): [1]
You must login to post a message to this conference.