Extension talk:Google Maps/Archive/2006

Latest comment: 17 years ago by Martinm

Ok for Non Technical Users?

edit

I'd like to use this on my site, but it looks technically beyond me. I barely get html, and know next to nothing about java or php. Is this something I can do, or should i get someone to help? And if I need to get help, how would I find someone qualified? Thank you for your assistance. --Natcolley 14:21, 26 May 2006 (UTC)Reply

Hi Nat, if you can understand the installation instructions, you won't feel overwhelmed, I promise. --Emiller 02:43, 22 October 2006 (UTC)Reply

Heyup

edit

Love it. Pretty straight forward. Of course it would be nice to be able to get a new LAT/LON from messing around with the map, but for now I can paste them in from google links.

However, have you considered letting us specify the colour of the waymarker for the entries we make?

http://www.lundman.net/wiki/index.php/Tokyo

Thanks for your excellent code.

Ohh actually. This is unlikely, but I must admit it would be nice if you have a point, which leads to a page, to be able to have a return link "map" that takes you back (that's easy) and selects/centers the map point in question (harder) ...

Maybe you can figure out how to open links in a separate window? --Emiller 02:43, 22 October 2006 (UTC)Reply


0.6 Doesn't work??

edit

Notice: Undefined index: units in /wiki/extensions/GoogleMaps/GoogleMaps.php on line 283
Notice: Undefined index: scale in /wiki/extensions/GoogleMaps/GoogleMaps.php on line 283
Notice: Undefined index: selector in /wiki/extensions/GoogleMaps/GoogleMaps.php on line 283
Notice: Undefined index: units in /wiki/extensions/GoogleMaps/GoogleMaps.php on line 110
Notice: Undefined index: scale in /wiki/extensions/GoogleMaps/GoogleMaps.php on line 110
Notice: Undefined index: selector in /wiki/extensions/GoogleMaps/GoogleMaps.php on line 110
Notice: Undefined variable: wgScriptPath in /wiki/extensions/GoogleMaps/GoogleMaps.php on line 120
Notice: Undefined variable: wgScriptPath in /wiki/extensions/GoogleMaps/GoogleMaps.php on line 121

note: i've edited the paths above to shorten them to just the wiki
Davecotter 19:28, 4 October 2006 (UTC)Reply

I think this is fixed in Version 0.7. Let me know! --Emiller 03:10, 22 October 2006 (UTC)Reply
Nope, I still get this:
Notice: Undefined index: EditPage::showEditForm:initial in
/wiki/extensions/GoogleMaps/GoogleMaps.php on line 51
Notice: Undefined index: ParserAfterTidy in /wiki/extensions/GoogleMaps/GoogleMaps.php on line 67
And that's with 0.7.3 Davecotter 20:48, 25 October 2006 (UTC)Reply
I think you need to put "wfSuppressWarnings();" at the start of the function. Davecotter 20:54, 25 October 2006 (UTC)Reply
I think I fixed this in 0.7.4, but if you've got it nailed no need to upgrade :) --Emiller 08:51, 27 October 2006 (UTC)Reply
Nope, I get the exact two error messages on a clean install. I tried adding "wfSuppressWarnings();" at the start of the function but still no luck. Martinm 16:22, 04 January 2007 (UTC)Reply
OK, I think I found the problem. Try out 0.7.5. --Emiller 06:10, 8 January 2007 (UTC)Reply
Unfortunately 0.7.5 gives even more errors:

Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 127
Notice: Undefined index: width in extensions\GoogleMaps\GoogleMaps.php on line 129
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 127
Notice: Undefined index: height in extensions\GoogleMaps\GoogleMaps.php on line 129
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 127
Notice: Undefined index: Main Page in Cextensions\GoogleMaps\GoogleMaps.php on line 127
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 127
Notice: Undefined index: zoom in extensions\GoogleMaps\GoogleMaps.php on line 129
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 134
Notice: Undefined index: type in extensions\GoogleMaps\GoogleMaps.php on line 136
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 134
Notice: Undefined index: controls in extensions\GoogleMaps\GoogleMaps.php on line 136
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 134
Notice: Undefined index: units in extensions\GoogleMaps\GoogleMaps.php on line 136
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 134
Notice: Undefined index: scale in extensions\GoogleMaps\GoogleMaps.php on line 136
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 134
Notice: Undefined index: selector in extensions\GoogleMaps\GoogleMaps.php on line 136
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 134
Notice: Undefined index: icons in extensions\GoogleMaps\GoogleMaps.php on line 136
Notice: Undefined index: icons in extensions\GoogleMaps\GoogleMaps.php on line 150
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 134
Notice: Undefined index: icon in extensions\GoogleMaps\GoogleMaps.php on line 136
Notice: Undefined index: icon in extensions\GoogleMaps\GoogleMaps.php on line 150
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 127
Notice: Undefined index: version in extensions\GoogleMaps\GoogleMaps.php on line 129
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 127
Notice: Undefined index: precision in extensions\GoogleMaps\GoogleMaps.php on line 129
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 134
Notice: Undefined index: color in extensions\GoogleMaps\GoogleMaps.php on line 136
Notice: Undefined index: color in extensions\GoogleMaps\GoogleMaps.php on line 150
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 134
Notice: Undefined index: overview in extensions\GoogleMaps\GoogleMaps.php on line 136
Notice: Undefined index: overview in extensions\GoogleMaps\GoogleMaps.php on line 150
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 134
Notice: Undefined index: geocoder in extensions\GoogleMaps\GoogleMaps.php on line 136
Notice: Undefined index: geocoder in extensions\GoogleMaps\GoogleMaps.php on line 150
Notice: Undefined index: Main Page in extensions\GoogleMaps\GoogleMaps.php on line 134
Notice: Undefined index: localsearch in extensions\GoogleMaps\GoogleMaps.php on line 136
Notice: Undefined index: localsearch in extensions\GoogleMaps\GoogleMaps.php on line 150

Note: path has been shorted to just the relevant parts. Martinm 18:09, 10 January 2007 (UTC)Reply

Having Problems with Preview Page after Extension Install

edit

MediaWiki: 1.6.8 PHP: 4.4.4 MySQL: 4.1.21-standard-log

I've installed this extension and it works perfectly, with 1 exception. If I create a google map or edit a page that has a googlemap as part of it, when I click Preview (before saving the page), I get a list of Error Notices across the top of the page:

Notice: Undefined index: GSmallMapControl in /home/coolpeop/public_html/wiki/extensions/GoogleMaps.php on line 128

Notice: Undefined index: G_HYBRID_MAP in /home/coolpeop/public_html/wiki/extensions/GoogleMaps.php on line 128

Notice: Undefined index: GSmallMapControl in /home/coolpeop/public_html/wiki/extensions/GoogleMaps.php on line 128

Notice: Undefined index: width in /home/coolpeop/public_html/wiki/extensions/GoogleMaps.php on line 165

Notice: Undefined index: width in /home/coolpeop/public_html/wiki/extensions/GoogleMaps.php on line 168

Notice: Undefined index: height in /home/coolpeop/public_html/wiki/extensions/GoogleMaps.php on line 165

Notice: Undefined index: height in /home/coolpeop/public_html/wiki/extensions/GoogleMaps.php on line 168

Notice: Undefined index: controls in /home/coolpeop/public_html/wiki/extensions/GoogleMaps.php on line 168

Notice: Undefined index: in /home/coolpeop/public_html/wiki/extensions/GoogleMaps.php on line 168


However if I save the page with the map on it, it will display and work properly without errors. Only the preview page shows the above. Anyone have any ideas how to fix this? It's going to throw my users for a loop!--71.72.21.196 17:07, 28 August 2006 (UTC)Reply

I think it has to do with $wgGoogleMapsDefaults not being defined. I think I've fixed this issue in Version 0.7, but post back here! --Emiller 03:10, 22 October 2006 (UTC)Reply


Love it

edit

Just started playing with it, and I really love it!

I do get the following errors though:

Notice: Undefined index: width in /var/www/html/wiki/extensions/GoogleMaps.php on line 36
Notice: Undefined index: height in /var/www/html/wiki/extensions/GoogleMaps.php on line 36
Notice: Undefined index: type in /var/www/html/wiki/extensions/GoogleMaps.php on line 44
Notice: Undefined index: controls in /var/www/html/wiki/extensions/GoogleMaps.php on line 45
Notice: Undefined index: in /var/www/html/wiki/extensions/GoogleMaps.php on line 45

After a couple of times reloading they disappear, I guess because the page is than taken from cache, not from the DB anymore.

Any thought on that ?

GBrowserIsCompatible

edit

I have your extension installed on my wiki but suddenly it doesnt seem to work anymore and With Firefox 1.5.0.1 i get

Error: GBrowserIsCompatible is not defined

in the javascript console.

Hmm, but i can see the maps on the test page you provide and also on regular google maps. Now i just wonder why my installation broke when it used to work before. Maybe since mediawiki upgrade something changed? shrug Hmmm, any hints? Mutante 07:19, 24 February 2006 (UTC)Reply

Mutante

edit

Did you follow steps 2 and 3? I.e., is your page correctly including the JavaScript from Google's site?

Access to maps.google.com on pages without any Google Map?

edit

Why is maps.google.com also accessed on wiki pages without any Google Map? --217.162.54.24 14:10, 10 April 2006 (UTC)Reply


Because the file skins/MonoBook.php contains:

<script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo $wgGoogleMapsKey ?>" type="<?php $this->text('jsmimetype') ?>"></script>

So the browser who loads the page open a connection also to maps.google.com --Fvitale 09:54, 5 May 2006 (UTC)Reply

Changed in version 0.4.0; it will only access maps.google.com on pages that have maps. --Emiller 20:47, 7 May 2006 (UTC)Reply

More than one map per page

edit

Does anybody is already working on it? Can I contribute? --Fvitale 10:04, 5 May 2006 (UTC)Reply

I just got a many-map version working on FF and Safari; I'll upload it once I test on IE. --Emiller 19:24, 7 May 2006 (UTC)Reply
OK, it works on IE. Enjoy version 0.4.0 of Google Maps Extension. --Emiller 20:46, 7 May 2006 (UTC)Reply

Installation without modifying core code

edit

Is there any way that this extension can be installed without having to modify skins/MonoBook.php and the like. I hate to modify code that comes with mediawiki and will be overwritten on the next upgrade. Is there something that can be put into the LocalSettings.php file instead or directly into the extension to load the script section that needs to be in the head section? -- Suso 05:07, 6 May 2006 (UTC)Reply

Yes! Check out version 0.4.0. --Emiller 20:52, 7 May 2006 (UTC)Reply


Can't get Editors map to show

edit

I just installed google maps 0.5.1 with the latest mediawiki 1.6.7, it works great. Im very interested in the Editors Map but do not see it at all, how can I get this to show up. It says "It inserts a link that says "show map" above the toolbar buttons" but I dont see it on any edit pages.

Allowing users to easily get the lat/long is key to a good geowiki and a map to get long/lat by click, address (now supported in with google api) would be great. Thanks


Hi, am having the same problem.. the extension is awesome but for some reason when i get to the "edit" page area the "show map" link isnt displayed, anyone have an idea why this is?

thanks!!


In GoogleMaps.php, search and replace 'article' --> 'bodyContent'


Comment above worked fine, I've replaced

document.getElementById('bodyContent').insertBefore(links, document.getElementById('wikiPreview').nextSibling); 

with

document.getElementById('toolbar').appendChild(links);

though which makes the 'show map' link show up between the buttons and the edit field. Looks much nicer. My .02 cent.

Nice work, folks. Actually, replacing "article" with "bodyContent" makes MonoBook work at the expsense of all other skins. The above solution makes it work with all skins, and has been incorporated into version 0.5.4. Sorry for the bug, and thanks for the solution! --Emiller 15:46, 11 July 2006 (UTC)Reply

MediaWiki version supported

edit

I know this works in 1.5.8 of MediaWiki. Any future updates to support 1.6.x? PFunk 3 May 2006

Hmm, it works for me with version 1.6.3. -- Suso 05:07, 6 May 2006 (UTC)Reply
Yep, it works out of the box with 1.6.x. --Emiller 20:52, 7 May 2006 (UTC)Reply
I'm having issues installing this on a fresh version of 1.6.5. It's reading the /extensions/GoogleMap.php file but for whatever reason im seeing no effect across the site. No special buttons in the edit section, and a simple <googlemap ... > tag just prints to screen. Any thoughts? -- Matt 18:54, 15 May 2006 (UTC)
Yes, I'm having the exact same problem. A fresh 1.6.5. But no "show map" link. Is this a bug? -- Kenji 20:58, 24 May 2006 (UTC)
Same problem here on new 1.6.5 install. the googlemap tag just prints to screen as text. -- 67.42.190.210 19:39, 30 May 2006 (UTC)Reply
On a (recently upgraded) 1.6.7 install, GoogleMaps is expecting an 'article' div, where MonoBook provides only 'bodyContent'. Changing GoogleMaps.php to substitute at least makes the 'show map' link appear. - Iskander
This really helped... thanks a ton!!! - AJ
Version 0.5.4 fixes this issue to work with all skins. Thanks for the detective work. --Emiller 15:47, 11 July 2006 (UTC)Reply
I'm usually pretty good with this stuff, but I've installed 0.5.4 to a MediaWiki 1.6.8 and am seeing no effect across the site like the people mention above. Map code prints out as code, and no button on edit pages. MonoBook.php is putting out a div id'd as 'toolbar', so I'd think it would work, but I see no effects.
Ok, I manually forced BBEdit/Fetch to upload as text rather than Automatic and it's at least running some code now.
edit

Hi, I'm using it with Mediawiki 1.5.6 and am testing with tags like this:

 <googlemap lat="46.415523" lon="-94.283938" zoom="3" controls="large">
 46.415523,-94.283938, [[Brainerd International Raceway]]
 </googlemap>

The problem is the wiki link gets converted to Brainerd International Raceway rather than an actual link. Any ideas?

Are you doing this on the Brainerd International Raceway page? If a page links to itself, it will just show up as bold text. --Emiller 02:43, 22 October 2006 (UTC)Reply


Feature Requests

edit

Lines

edit

It'd be cool to draw lines between points, especially if you want to describe a trail or give driving directions. The Google Maps API lets you do this (described here), but it's not enabled here yet. I think the proper syntax would be to put a ">" before each point you wanted connected to the previous point. If you wanted the line to curve somewhere, but didn't want a marker there, then you would just leave out the description, e.g.

 42.4191,-23.104410, Start your journey here!
 > 42.4811,-23.1948441
 > 42.50825,-23.540258, Here's a good place to stop for lunch
 > 42.04481,-23.580208
 > 42.4805,-23.580082
 > 42.3804,-24.341041, You're finished, hoorah!

That would make a line that passed through all six points in order, but only three points would have markers.

Info balloon tabs

edit

Like here. Might just be eye candy, I'll see if I can work it in and patch.

Perhaps add a pipe delimiter in the description for tab separations.
Done! Check out Version 0.7 --Emiller 03:10, 22 October 2006 (UTC)Reply

Custom markers

edit

Have added some code to this great extension, which make it possible to use custom markers. See User:Modjo/GoogleMapsExtension for more information.

Nice work, Modjo. Version 0.7 integrates this feature; check out the Extension:Google Maps/Installation page. --Emiller 02:43, 22 October 2006 (UTC)Reply

Make map type chooser optional

edit

Wow, excellent stuff. I just discovered this extension after breaking the extension I was using, and am glad I found it! Since I bet you've got nothing to do... What about an option to get rid of the map type chooser? They take up a lot of space, and on a thin map (300px) they cover up the zoom controls. (I'm using it for an area that doesn't have any detailed satellite images...)

Here's hoping you keep up the great work! —Alxndr (t) 05:51, 22 August 2006 (UTC)Reply

Hi Alxndr, based on your suggestion, I've made this an option in version 0.6.0. Check it out! --Emiller 06:4


Over-ride default values for a single page

edit

Hm, my feature request: allow the possibility of overriding the default values for a single page only. ie. in that page insert some new tag with new default values, that apply to editing that page only. Why? Because I'm using this to find geo coords for Wikipedia. It's way faster than any other method I've seen, for smaller structures such as buildings or parks. But it does mean I can pretty much only work on one city at a time, unless I set up multiple MediaWikis which doesn't seem like a smart idea! Did this make sense? I know it's probably not reasonable, but hey, I can try. :) --pfctdayelise 16:20, 27 July 2006 (UTC)Reply

This is a reasonable feature request. I think the right way to do it would be to make the config look like:
  $wgGoogleMapsDefaults = array( "Main Page" => array("lat" => 13.48041, "lon" => -42.3184 ),
                                 "Montreal" => array("lat" => 42.2811, "lon" = -19.3910 ) );
and have it figure it out from there. Don't think I'll have time to do this, but I'll certainly accept a patch... --Emiller 07:23, 19 September 2006 (UTC)Reply
Well, I found time after all. Check out Version 0.7! --Emiller 03:10, 22 October 2006 (UTC)Reply


RESOLVED problems

edit

Problems with Internet Explorer - how to fix them

edit

I'm using Mediawiki 1.7.1 with Monobook skin. I got Javascript parsing errors using IE. I discovered that in addition to patching includes/OutputPage.php it is necessary to patch skins/MonoBook.php.

The patch is contained now in the installation manual.

Thanks!!! --Emiller 02:43, 22 October 2006 (UTC)Reply

Clash with Gallery2Wiki extension

edit

It is not possible to have this extension installed and working with the Gallery2wiki extension.

Installing Gallery2Wiki and Google Maps Extension results in a javascript error for the the Google Maps Extension - ie any page with an installed Map.

This is the error you get (example page):

%%BEGINJAVASCRIPTc73ecb6178fea1843a5ad1d5b1126694838eec99b0051c1f18594cd49d56119f%% function createMarker(point, label) { var marker = new GMarker(point); GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(label); }); return marker; } function addLoadEvent(func) { var oldonload = window.onload; if (typeof oldonload == 'function') { window.onload = function() { oldonload(); func(); }; } else { window.onload = func; } } window.unload = GUnload;%%ENDJAVASCRIPTc73ecb6178fea1843a5ad1d5b1126694838eec99b0051c1f18594cd49d56119f%%

This has been fixed as of Google Maps Extension 0.7.2. --Emiller 16:21, 24 October 2006 (UTC)Reply


Problem upgrading from .6 to .7 - RESOLVED

edit

MediaWIki = 1.8.1

Firefox = Mac OS X 1.5.0.7

.6 was working great and then I upgraded by replacing the GoogleMaps directory in the extensions folder (I left LocalSettings.php as is) - Now my main Wiki Page does not load. My Wiki is very simple. The only thing I can think of is that my wiki is not run from the root directory, it is located in /wiki.

If I comment out the 2 lines in LocalSettings.php, the site starts find.

Any thoughts? --Caseyk 15:18, 24 October 2006 (UTC)Reply

What version of PHP are you running? And which specific version of Google Maps Extension? And what operating system is the server running? --Emiller 16:22, 24 October 2006 (UTC)Reply

php - 5.0.4-10.5

GoogleMaps Extension v 0.7.2 (I tried 0.7.1 with the same result. I also tried using the array and the single token Key strings)

Thanks for the quick reply --Caseyk 16:56, 24 October 2006 (UTC)Reply

Added > OS is Linux 2.6.8-022stab067.1-enterprise --Caseyk 23:45, 24 October 2006 (UTC)Reply

Added - ALL WORKING NOW on 0.7.3 - For some reason it was not including GoogleMapsMessages.php - THANKS FOR YOUR HELP! --Caseyk 18:21, 25 October 2006 (UTC)Reply

Paths don't work - RESOLVED

edit

I have followed the install instructions for paths, however neither the editor nor a manual addition of path data work at http://www.burkina.at/Satellitenkarte (version 0.7.3 on MW 1.6.7). I imagine it has to to with LocalSettings.php, so here goes a snip (from the very end of the file):

$wgGoogleMapsKey = "XYZ";
require_once( "extensions/GoogleMaps/GoogleMaps.php" );
$wgGoogleMapsPathsEnabled = true;
$wgGoogleMapsDefaults = array( "zoom" => 13, "type" => "satellite", "lat" => 12.369, "lon" => -1.524 );

What did I do wrong? --Helge 14:48, 26 October 2006 (UTC)Reply

This is my fault, Helge. The variable was labeled incorrectly on the installation page (fixed). You want:
$wgGoogleMapsEnablePaths = true;
--Emiller 16:19, 26 October 2006 (UTC)Reply
Cool, works like a charm now! --Helge 17:59, 26 October 2006 (UTC)Reply

Default zoom, width, and height array

edit

Question: Am I passing the zoom, width, and height properly at the bottom of the array in the following example?

$wgGoogleMapsDefaults = array(

              "Boston" => array( "lat" => 42.358333, "lon" => -71.060278 ),
              "New York City" => array( "lat" => "40.714167", "lon" => -74.006389 ),
              "lat" => 43.580391, "lon" => -54.140625, "zoom" => 2, "width" => 600, "height" => 400); # these apply to all other pages

It seems when I change the value for "zoom", the default zoom does not change when viewing maps. I don't know if I'm having a caching issue or what the problem may be. --MediaHound 17:24, 27 October 2006 (UTC)Reply

Edit - I was testing this on a page with an existing map, so it was not updating properly. It seems it was taking the settings of the old map set to show for that page. I think I'm all resolved now :) --MediaHound 18:14, 27 October 2006 (UTC)Reply

Just so we're all clear, normally you specify the zoom in the <googlemap> tag, like
   <googlemap zoom="10">
What's in the $wgGoogleMapsDefault array will only apply if no zoom is specified there (and on the editor's map). --Emiller 01:56, 28 October 2006 (UTC)Reply

How do i find Lat/Lon

edit

How do i take an address and find the Latitude/Longitude needed for the extension? ~jgs

Try a Geocoder.
Version 0.7 includes a Geo-coder! --Emiller 02:43, 22 October 2006 (UTC)Reply

Slow execution?

edit

Since upgrading from 0.2 to 0.4, using FireFox, my map now loads so slowly, i am interrupted three times with this dialog:

Warning: Unresponsive script


A script on this page may be busy, or it may have
stopped responding. You can stop the script now, or you
can continue to see if the script will complete.

I have only 211 points on my map and plan to add many more. Is there a way, during the function block:

   for($i=0; $i < sizeof($points); $i++) {
   ...
   }

to allow the process to breathe, like a Yield() call or something?

Here's my map: http://www.ktunes.net/wiki/index.php/Map.

Thanks.

--Davecotter 18:46, 12 May 2006 (UTC)Reply

Interesting. An unresponsive script is a client-side problem, so changing the part you mention won't fix it. The only change between those versions that might affect performance, as far as I can tell, is the use of version 2 of the Google Maps API. I wonder if that slowed things down for some reason? I'm really not sure. I did stumble across this: http://www.acme.com/javascript/#Clusterer, which might speed things up by consolidating some of the points. I haven't tested it, but if it works I'll incorporate it into the extension. Feel free to give it a whirl if you're up to it. --137.165.217.4 19:16, 13 May 2006 (UTC)Reply
I haven't had any real problems with 0.4. Of course I only have 6 points. I don't think the word "only" can be applied to 211 points. --DonSeiler 16:57, 15 May 2006 (UTC)Reply

--James Humphrey

I have the same problem with a new application of mine at:

http://www.tennismaps.com/index.asp?regionid=1

There are 114 points and it is taking 10-15 seconds to load the page in Firefox and around 30 seconds to load in IE. I do not accept that 114 or 211 is too many points to use on a map. It makes me wonder just how heavy these point objects are. I haven't found a solution yet, but have just started looking. I see that ktunes still has the problem.

The problem is that there is a "click" listener for every point on the map. The correct way to do this is to have one listener on the map that opens the balloons on behalf of each marker. The next version, which is in the works, will do this correctly. --Emiller 07:11, 23 August 2006 (UTC)Reply
Version 0.6.0 fixes this problem by creating only one click listener for each map. You should notice a significant performance improvement. --Emiller 06:57, 19 September 2006 (UTC)Reply


Still slow with 0.6.0

edit

Just upgraded and it's still too slow, i still get that dialog above (tho this time only once). There must be something that can be done about this?
Davecotter 19:35, 4 October 2006 (UTC)Reply

Version 0.7 includes additional performance enhancements; should be about 2x faster at adding markers, and much faster for markers without captions. --Emiller 03:10, 22 October 2006 (UTC)Reply


Not compatible with Bad Behaviour

edit

After installing the bad behaviour extension to my wiki the google maps extension no longer renders the maps.

Is this a known bug and is there any fix to it.

No known solution, but this is now documented on the Extension:Google Maps/Compatibility page. (unsigned)
I successfully run a wiki with googlemaps-extesion 0.5.3 and badbehaviour v1 at http://www.burkina.at. --Helge 08:02, 22 October 2006 (UTC)Reply
Bad Behavior works with Google Maps Extension 0.7.2. Thanks for the bug report! --Emiller 16:20, 24 October 2006 (UTC)Reply

Editor doesn't seem to work on my site - RESOLVED

edit

Just upgraded to 0.7.3 (on mediawiki 1.6.7). The "make new map" link shows up, however disappears when clicked. No editor shows up. Tested on XP in Firefox2 and IE6. Paths not enabled. See http://www.burkina.at/Satellitenkarte. --Helge 15:50, 25 October 2006 (UTC)Reply

Hi Helge, the problem is that it expects {$wgScriptPath}/extensions/GoogleMaps/EditorsMap.js to lead to the EditorsMap.js file, but it appears you have some Rewrite rules that prevent this. Is your setup unusual somehow? I wonder how to fix this in all cases, because I bet people have a lot of unusual Rewrite set-ups. --Emiller 02:12, 26 October 2006 (UTC)Reply
Aaah! Should have thought about that myself. Yes, my rewrite rules rewrite everything but a specified lot. So I now excluded the folder /extensions from the rewrite rules. My .htaccess file now reads like that:
RewriteEngine on

# Don't rewrite requests for files in MediaWiki subdirectories,
# MediaWiki PHP files, HTTP error documents, favicon.ico, or robots.txt
RewriteCond %{REQUEST_URI} !^/(stylesheets|images|skins)
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/favicon.ico
RewriteCond %{REQUEST_URI} !^/robots.txt
RewriteCond %{REQUEST_URI} !^/nowiki
# include these last two lines if you use the analog stats
RewriteCond %{REQUEST_URI} !^/failed_auth.html$
RewriteCond %{REQUEST_URI} !^/stats
# used to enable the GoogleMaps-extension (and all other extensions with similar issues):
RewriteCond %{REQUEST_URI} !^/extensions

RewriteRule ^(.*)$ index.php?title=$1 [QSA]
(Note: these .htaccess settings will only work if in conjuction with $wgArticlePath = "/$1"; in LocalSettings.php)
--Helge 09:35, 26 October 2006 (UTC)Reply


Complaints/Suggestions

edit

I appreciate the code update. However, I'm concerned that it is getting a bit bloated. Earlier versions were much easier to read. If I hadn't already been familiar with a previous google map extension I would probably have been a bit overwhelmed. I have basically deleted about half of the code so that it is a bit more manageable and extendable. I'm just hoping that future versions don't continue to add large amounts of code and features to this that I do not need. Other than that I love the extension. Dave Schissler

Hi Dave, I appreciate the feedback. Funny how things meant to be simple soon suffer from feature bloat! But in this case I'm not sure anything is terribly extraneous. I've tried to keep the code organized, at least, but code comments are lacking. I'll try to add some more comments to make the extension more comprehensible. --Emiller 02:40, 7 July 2006 (UTC)Reply
I've done a major code cleanup with version 0.7, so hopefully you'll find it easy to hack! --Emiller 03:10, 22 October 2006 (UTC)Reply


Patches/updates

edit

Basic Icon Classes (custom markers)

edit

Thanks for the extension, excellent. However, I wanted to label a number of things on a page using custom labels to refer to the markers so I modified version 0.5.4 to allow for it:

What I've done is:

  1. Changed the way the points are read so that if there are 4 items in the CSV list then the first item is taken as a letter to use as a tag (note: only uppercase letters can be used because they are Google Map's standard markers: www.google.com/mapfiles/marker + <letter> + .png
  2. Changed the JS createMarker() function so that if a custom label is passed it will create a GMarker with a custom icon using that label.

Example (with 2 custom markers 'A' & 'B' and a non-label marker):

<googlemap height="550" width="550" align="center" lat="-35.316859" lon="150.436349" zoom="17" controls="medium" type="map">
A,-35.316859,150.436349,Amanda's Coffee Shop & Deli
B,-35.316675,150.435555,Annabel's Cafe
-35.316937,150.435963,Cafe Java
</googlemap>

(note: labels and non labels can be mixed on the same map as each one is parsed separately)

Based on Google Maps API Documentation Using Icon Classes

I'm sure this idea could be easily extended even further but this does what I want ATM.

-- Rod @ Ulladulla Wiki, 9 September 2006

Hey Rod, I love the idea and worked this into Version 0.7. Check out the "icons" attribute in Extension:Google Maps/Syntax. Thanks! --Emiller 02:43, 22 October 2006 (UTC)Reply
Thanks for doing that, very nice work on 0.7. I only realised a week or so ago that my alterations don't work properly in IE, you only get the shadow of the bubble, you've done a much better (and more comprehensive) job than my sloppyness! -- Rod @ Ulladulla Wiki, 26 October 2006

Solving an HTTP_HOST and api key issue

edit

I have a lot of domain names linked to my website (I know I should redirect all of them to one url, anyways). The google map api brings up an annoying window if the http_host server variable is not the same one that you used to sign up for the api. I added another variable to LocalSettings and then added the following lines of code.

In LocalSettings.php

$wgGoogleMapsHTTP_HOST = 'www.baseball-reference.com';

In GoogleMaps.php, I added the following in googleMaps_EditForm()

if ($_SERVER["HTTP_HOST"] != $wgGoogleMapsHTTP_HOST) {
  $output = ' ';
  return;
}


I added the following in googleMaps_Render($source, $argv). I put it after the defaults were set.

if ($_SERVER["HTTP_HOST"] != $wgGoogleMapsHTTP_HOST) {
  $output = '<DIV STYLE="border: solid; padding: 10px; width:'.$o['width'].'px;  height:'.
   $o['height'].'px; ">In order to see the map you must have the <TT>'.
   $wgGoogleMapsHTTP_HOST.'</TT> url in your browser bar</DIV>';
  return($output);
}


you also have to add $wgGoogleMapsHTTP_HOST to the lists of globals in the subroutines.

Here it is in action.

Love the extension btw.

Interesting. What would be even better is an array of map keys for a number of domains, and it would pick the appropriate one to use based on the request. (Or show a blank if there's a mis-match.) --Emiller 07:23, 19 September 2006 (UTC)Reply
There's now support for multiple API keys. Check out Extension:Google Maps/Installation#Multiple_API_keys. --Emiller 02:43, 22 October 2006 (UTC)Reply

A problem: Code being output without replacement of substitution stuff

edit

Editor's Map comes up, but displaying the page gives stuff like:

%%BEGINJAVASCRIPTd4520279...e3daed4%% function createMarker(point, label) { var marker = new GMarker(point); GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(label); }); return marker; } function addLoadEvent(func) { var oldonload = window.onload; if (typeof oldonload == 'function') { window.onload = function() { oldonload(); func(); }; } else { window.onload = func; } } window.unload = GUnload;%%ENDJAVASCRIPTd452...aed4%%

(I subbed ellipses inside the part that is my key). Any thoughts? --- Sarah

Hi Sarah, what version of MediaWiki are you using? --Emiller 06:46, 19 September 2006 (UTC)Reply

bad_behavior_extension installed? See #Not_compatible_with_Bad_Behaviour

Return to "Google Maps/Archive/2006" page.