Extension talk:Semantic Google Maps

Problems with Multidomain Website / Wrong API key
I have a page that is accesible through different domains. Because I have to use different keys for any domain I created a switch/case with all domains and the matching keys. In fact that onl works when I'm logged in in Firefox, when beeing logged in with IE it also does not work. So maybe there could be an option so that always the right Google-API-Key is used when accessing the page. Another problem is taht when the API-Key does not match a blank page is displayed, thats really horrible because the visitors are send to nothing and have no idea what is happening. So please help me as fast as possible becuase this is a very heavy problem. --DaSch


 * The easiest solution is to add an if-statement to your LocalSettings.php file, setting the value of $wgGoogleMapsAPIKey depending on the domain name. Yaron Koren 14:35, 28 January 2009 (UTC)

I made this. But it only works when I'm logged in. Even other users beeing logged in are getting an error. So I'm not sure if this is checked with every page beeing loaded. --DaSch 16:12, 28 January 2009 (UTC)


 * Sorry, I don't know what to tell you. There's no special domain-checking PHP code that can be run in the extension but can't be run in LocalSettings.php. Yaron Koren 18:13, 28 January 2009 (UTC)


 * Yes sure, but the effects are very strange and by know a had to disable the extension because pages with a map are displayed blank. --DaSch 19:30, 28 January 2009 (UTC)


 * Yeah, that's true - the error-handling could be better. Yaron Koren 20:09, 28 January 2009 (UTC)


 * Well, it seams that the $_SERVER['SERVER_NAME'] parameter not always gives the correct domain, so i changed it to only taking the tld. that works. Maybe the www was not always there or something like this. --DaSch 11:55, 30 January 2009 (UTC)


 * Well, no the error is getting even stranger. On some pages the API-Key is not right. The same page is displayed in Safari with no error an not displayed in Opera because of a wrong API-Key, other pages work the other way, not in Safari but in Opera. Maybe the handling of the API-Key is somewhere buggy. Is it maybe chached somewherere? There also seams to be a bug within IE so that the $_SERVER['SERVER_NAME'] is giving a wrong value. Maybe there could be a possibility to check the domain by javascript at runtime. And the configuration would be with an array of domain and key. Then the script could check for hostname in the request and take the right API-Key. By the way, I think maybe it would be better to have a alternative to GoogleMaps with similar functions, without the API-Key Problems and Google and so on. --DaSch 15:57, 30 January 2009 (UTC)


 * I think now i solved the problem. The thing is that you get a different API-Key when giving a subdirectory. So when generating the API-Key you have to use http://domain.tld/wiki and not http://domain.tld/ because this does not always work. I hope this is my last posting to this problem :) .--DaSch 10:49, 3 February 2009 (UTC)