Extension talk:Google Maps/Archive/2008
Add topicERROR Cannot modify header informationSince installed the extension I get this when saving
[edit]Since installed the extension I get this when saving or even starting the page:
Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/********/wiki/LocalSettings.php:1) in /www/htdocs/********/wiki/includes/WebResponse.php on line 10
What happend - can you help me please - apart the ERROR (which is shown over my whole site) the extension works well
- I was getting similar errors, along with specific warnings in GoogleMaps.body.php and SpecialGoogleMapsKML.php. I asked on the installation article's discussion page and got this reply:
- Temporary solution:
- Just go ahead and remove the leading "&" sign on the parameters in the function calls at the stated lines (line 401 in GoogleMaps.body.php and line 43 in SpecialGoogleMapsKML.php).
- This worked great for me, removing all the PHP warnings. I don't actually know enough about PHP to know what the "&" characters were for, but it appears to work properly without them. Jangell 08:33, 23 February 2008 (UTC)
- Fixed in 0.9.1. --71.202.99.103 23:10, 27 February 2008 (UTC)
Search box doesn't seem to work
[edit]In addition to the previous point, the search box doesn't seem to work. When I enter something, it searches for a couple of seconds, but then produces no results. Hensa 15:37, 10 May 2007 (UTC)
- Can you give a specific test case? --Emiller 22:41, 26 February 2008 (UTC)
Distance
[edit]Great extension ! Thank you for the hard work. Sure, there is a lot of new functions to be added but first I have some problem with distance : Here is a simple exemple (the whole erratic behaviour is more complicated).
A path of four points (three vectors of visualy same lenth) and two right angle. The distance calculated for each the two first vectors is twice as long as the third. Apparently the third one is the correct one. Is this a bug of google function ?
- Will be fixed in 0.9.0. --Emiller 08:27, 21 February 2008 (UTC)
How do I change the pixel size of the paths?
[edit]I would like them to be quite a bit thinner, not so wide and transparent. --192.203.201.3 18:53, 6 February 2007 (UTC)
- Right now the only way to do this is to modify the "initialize" function of EditorsPath in EditorsMap.js. Change "6" to a more acceptable value. --Emiller 03:20, 27 February 2007 (UTC)
- Version 0.9.0 lets you customize the appearance of paths. --Emiller 22:49, 26 February 2008 (UTC)
Use mouse's wheel
[edit]It would be useful if when the mouse is over the map, the wheel was use to zoom in and out. Can we do that? --Jfbeaumont 17:06, 2 March 2007 (UTC)
- I bet that's possible: http://adomas.org/javascript-mouse-wheel/. --Emiller 19:14, 3 March 2007 (UTC)
- Check out Version 0.8. --Emiller 10:00, 6 August 2007 (UTC)
- How can I disable mouse wheel zoom in version 0.8? Most of the time I'm just trying to scroll down the page and instead the map starts zooming. --Ryancyoder 18:33, 27 August 2007 (UTC)
- Mouse wheel zoom is disabled by default in 0.9.0. Enable it with scrollwheel="zoom". --Emiller 08:38, 21 February 2008 (UTC)
- How can I disable mouse wheel zoom in version 0.8? Most of the time I'm just trying to scroll down the page and instead the map starts zooming. --Ryancyoder 18:33, 27 August 2007 (UTC)
- Check out Version 0.8. --Emiller 10:00, 6 August 2007 (UTC)
Creating Points
[edit]I was looking around the site here and couldn't find a way to make a point on the map without going into the "edit page". I'm looking for a way for someone to just goto the displayed map, click on a location, and make a point there. Is there any way this is possible? Stygarfield 15:30, 2 June 2007 (UTC)
- Nope! --Emiller 08:33, 21 February 2008 (UTC)
Marker info from an external file
[edit]Any ideas on how to include the marker information (location, etc.) in an external file. I want to generate status information from several locations on the fly and then change their icons to reflect the status. Suggestions? Jspahn 26 July 2007
- As of 0.9.0, you can now include KML, which may give you what you're looking for. --Emiller 08:40, 21 February 2008 (UTC)
Search by Zip Code
[edit]Is there anyway to implement zip codes into these maps? I really want for articles on my site to have maps with markers on them, and then have people be able to search for things close to them by zipcode. is that possible? 75.111.46.8 22:12, 3 March 2007 (UTC)
- Yes. Just type a ZIP code into the search box on the Editor's Map. --Emiller 08:43, 21 February 2008 (UTC)
Tabbed info balloons
[edit]This extension has just been installed at the Great Lakes Wiki ... I have been hacking around trying to understand the features. It's TRES nifty. I think maybe I'm doing something wrong with tabbed info balloons, can someone point me to a wiki/page/map that uses them so I can see if it's me interpreting the syntax wrong? Here is the code I put in on the article GreatLakesWiki:Thornapple River
<googlemap lat="42.890555" lon="-85.475349" width="600" height="600" overview="yes"> (A) 42.953125, -85.484061 /Dam\ The [[wikipedia:Ada Township, Michigan|Ada]] dam /Bridge\ The [[wikipedia:Ada Covered Bridge|]] (C) 42.910297, -85.49921, The [[wikipedia:Cascade Township, Michigan|Cascade]] dam (L) 42.883512, -85.475693, [[Wikipedia:Caledonia Township, Kent County, Michigan|Caledonia]] dam </googlemap>
The marker (A) which should have two tabs is not clickable, that is, the pointer does not change to a finger when you mouse over it, so no balloon comes up. A previous version (in the history) without tabs worked OK. Markers C and L work fine... do I need a comma after the coords? the helps showed it without comma... I think maybe the helps are not quite right, because when I put a comma in, it does change to a finger, but I see text with /dam\ in the balloon and no second tab... if I put nothing after the comma it changes to non fingered (only a drag grab hand) So I'm confused. :) ++Lar: t/c 04:33, 30 November 2007 (UTC)
- Tabs should be on new lines. I've tried to clarify the docs. --Emiller 08:41, 21 February 2008 (UTC)
Error:addLoadEvent is not defined
[edit]We have been using the Google Maps Extension 0.7.4 without problems for a while. I recently upgraded to MediaWiki 1.8.2 and installed the Semantic MediaWiki extension. Now in Firefox we are getting the error "Error:AddLoadEvent is not defined. And of course no map is drawn. Here is an example page http://www.archiplanet.org/wiki/109--115_Wood_Street
Here is a page showing the wiki tags we are using, the HTML source of a broken map page and the HTML source of that page back when it worked. It looks like the first couple sets of script tags are missing including the one where it calls Google Maps. I tried putting the map code on a page that doesn't use Semantic MediaWiki and the error still occured. I tried turning off SMW and the error still occured.
I have fixed it for now by commenting out both instances of "$wgGoogleMapsDidInsertEssentialJs = true;" in GoogleMaps.php. This causes it to load the initial script stuff for every map on the page, rather than only once as is intended, but for some reason it was not loading at all for me. It seems to work with multiple instances of that code in the browsers I have tested (Safari and Firefox).
- The same is the case with SpamBlackList extension for mediawiki. Example on http://www.skipper2skipper.com. If blacklist extension is enabled, the GoogleMap javascript is not included in the page and no map is displayed. I have also disabled caching by commenting out $wgGoogleMapsDidInsertEssentialJs = true; (there are 2 instances) and all seems to be well. I guess it will need to be addressed at some stage as it does affect a few extensions, but the above fix should work in the short term. --Skipper 18:05, 6 January 2007 (UTC)
- Possibly fixed in 0.8. Please let me know. --Emiller 22:48, 26 February 2008 (UTC)
IMPLEMENTED features
[edit]New Google API Terrain update?
[edit]HI,
Thanks for a great extension!
Are there any plans to update this extension to support the new 'terrain' option that is in the latest API?
Google haven't enabled it by default, but it can been easily enabled it seems. See http://googlemapsapi.blogspot.com/2007/12/v294-terrain-and-new-maptypecontrol-to.html
It's probably really simple to do, and I'll have a look at the code myself tomorrow to see if I can figure it out.
Ideally, I'd like to keep the hybrid button as well, but just add the terrain button...
Thanks
- You got it. Check out version 0.9. --Emiller 22:27, 26 February 2008 (UTC)
Wishes in next version by user
[edit]- I really hope I can load kml files someday..
- I found There is a way to load xml files[1], but it's too hard to edit code to load kml files.
- Today's the day! Check out version 0.9.0. --Emiller 22:30, 26 February 2008 (UTC)
- I found There is a way to load xml files[1], but it's too hard to edit code to load kml files.
KML
[edit]- I would really like to be able to load kml files, as they can contain so much more information just ready to go. It look likes the more recent GM API will also allow kml network links as well - so maps can be dynamic. I just want to specify a URL that links to the file and that file be loaded using code like so:
// get the kml File var kmlFile = new GGeoXml("http://www.xyz/kml/my.kml", function() { if (kmlFile.loadedCorrectly()) { // cancel the "Loading" message document.getElementById("loadingMsg").innerHTML = ''; } }); map.addOverlay(kmlFile);
Better still; do it as an array of files, so mashups of multiple kml files can be shown. The loading message could be left out - otherwise the message would have to sit on the map somewhere. In the past I have used an animated gif that rotated around as the "loading msg".
Background info for readers: kml files can be made using Google Earth or Google Maps My maps. Also lots of GPS software can produce them.
- KML import/export will be in 0.9.0. --Emiller 08:32, 21 February 2008 (UTC)
kml / georss import
[edit]I have tried to add kml / georss import. It looks like it is working. Is this a right way or am I forgetting something?
--- GoogleMaps.body.php.org 2007-08-06 10:56:07.000000000 +0200 +++ GoogleMaps.body.php 2008-02-18 11:05:04.000000000 +0100 @@ -417,6 +417,12 @@ if( $o['icon']Â != 'http://www.google.com/mapfiles/marker.png' ) { $output .= " GME_DEFAULT_ICON = new GIcon(G_DEFAULT_ICON, '".addslashes($o['icon'])."');"; } + if( $o['rss1']Â != '' ) { + $output .= " geoXml1 = new GGeoXml( '".$o['rss1']."'); map.addOverlay(geoXml1);"; + } + if( $o['rss2']Â != '' ) { + $output .= " geoXml2 = new GGeoXml( '".$o['rss2']."'); map.addOverlay(geoXml2);"; + } // parse the content of the tag $lines = preg_split( "/[\r\n]+/", $pContent ); @@ -730,6 +736,8 @@ 'lon' => -73.205112, 'overview' => 'no', 'precision' => 6, + 'rss1' => '', + 'rss2' => '', 'scale' => 'no', 'selector' => 'yes', 'stroke' => 6,
--62.45.179.83 11:16, 19 February 2008 (UTC)
- KML import has been added to 0.9.0. --Emiller 22:27, 26 February 2008 (UTC)
Mouseover
[edit]I have a lot of pins on some pages e.g. Museums in Berlin. To work out which is which, it would be good if just moving the mouse over the pin caused the info window to pop up. Is there an easy way to do that? Kimbooth 09:16, 3 March 2007 (UTC)
- I'll have something like this in the next big version. --Emiller 19:18, 3 March 2007 (UTC)
What we will have in the next big version? What will be the new features? Lleoliveirabr 23:02, 3 March 2007 (UTC)
- Bump. Did something like this ever come about and was just edited out? --204.52.215.14 21:18, 29 February 2008 (UTC)
- Mouseover titles are available since 0.9.2. --Emiller 00:28, 9 April 2008 (UTC)
- Bump. Did something like this ever come about and was just edited out? --204.52.215.14 21:18, 29 February 2008 (UTC)
Embedding Video
[edit]Is there any way I can embed video? I already installed videoflash but it doesn't look like <videoflash> works in the google map.
- Other extensions will not work inside the google map. Not sure if this is fixable, but I'll check. --Emiller 09:36, 28 February 2008 (UTC)
- Try embedding video with Version 0.9.3. It should work now. --Emiller 00:30, 9 April 2008 (UTC)
Performance issue
[edit]Very cool extension, works for me but... with this extension installed the time it takes for the "edit" page to load jumped significantly to a few seconds. (from sub second load time) This is fine for an experiment but not for a production site, since 99.9% of page edits won't be for maps, users shouldn't have to pay this overhead in usability expense for a mapping feature.
I believe the added load time is probably due to the "fetching" of remote images and script files from google.com. A fix that would work for me is to only fetch the remote files and scripts when a user really wants to make a map (clicks on the "make a map" link). (and/or cache these images and scripts locally) Otherwise get nothing from google and spare everyone the wait. --Maxelrod 17:58, 13 April 2007 (UTC)
- I really have to agree with Maxelrod on this - very cool extension and I'd love to use it, but the slow down on each page edit is too much especially on an active wiki. I second the idea of fetching remote files only when the button/link is clicked on. --Chrys 19:17, 2 December 2007 (UTC)
- I agree too. The extension will be fit for production sites by version 1.0. (Before you ask, 1.0 will be ready when it's ready.) --Emiller 22:45, 26 February 2008 (UTC)
- As of Version 0.9.2, remote files are only fetched after the button is clicked. --Emiller 00:33, 9 April 2008 (UTC)
Some options in Editor's Map not reflected in code
[edit]Hi - First, I think the extension is great. However, the three options on the bottom row of the Editor Map options do not result in any change in the code. For example, when I select 'no' for the satellite/map selector, those buttons still show on the map. Hensa 15:27, 10 May 2007 (UTC)
Sorry, I should say that an example of the map in action is here. Also, I am using Firefox 2 with XP. Hensa 15:33, 10 May 2007 (UTC)
- I noticed this also. Until there's a fix, you can manually put the syntax tags in. For example,
<googlemap lat="32.734774" lon="-117.150285" zoom="17" controls="large" type="map" selector="no" scale="yes" overview="yes">
- Fixed in 0.8.0. --Emiller 10:02, 6 August 2007 (UTC)
Change Map Type in Editor
[edit]Is it possible to set the Map Type of the Editor Map to Terrain? I'm working with some elevation based stuff and to have the terrain defaulted (or even selectable for that matter) would be very helpful. --204.52.215.14 20:29, 26 February 2008 (UTC)
- Yes. This is available as of 0.9.0. You may need to do a "hard refresh" to get the new JavaScript file in your browser. (Shift-F5 on most computers). --Emiller 22:40, 26 February 2008 (UTC)
- Thanks a bunch, that solved it.--67.85.243.235 18:46, 27 February 2008 (UTC)
Error: Undefined variable: wgGoogleMapsTemplateVariables in ./extensions/GoogleMaps/GoogleMaps.php on line 228
[edit]It seems like this variable is used before it's ever defined. Line 228:
if ($wgGoogleMapsTemplateVariables) { # experimental, see MW bug #2257
Or am I missing something? SDDR 02:54, 29 April 2007 (UTC)
- Fixed in 0.8 or thereabouts. --Emiller 22:42, 26 February 2008 (UTC)
Call-time pass-by-reference has been deprecated
[edit]just started up a new install of MW 1.11 and threw the GM 0.9 extension in. i get a warning now of:
Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /home/server/account/site/extensions/GoogleMaps/SpecialGoogleMapsKML.php on line 43
and...
Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /home/server/account/site/extensions/GoogleMaps/GoogleMaps.body.php on line 401
"Temporary solution:
Just go ahead and remove the leading "&" sign on the parameters in the function calls at the stated lines (line 401 in GoogleMaps.body.php and line 43 in SpecialGoogleMapsKML.php)."
the fix listed above and in an above post works to get rid of errors but i don't know if it fixes the problem.
I don't want to create a custom php.ini setup to set allow_call_time_pass_reference to true, because of my host's setup.
Is GM 0.9 compatible with MW 1.11 and php 5+?
Any help would be appreciated.
bye for now... --oktiv 19:58, 26 February 2008 (UTC)
- Thanks for the bug report. A fix will be in 0.9.1. --Emiller 22:26, 26 February 2008 (UTC)
EditorsMap.js and Mediawiki 1.10.1
[edit]I recently upgraded to 1.10.1 and 0.8.0 and now the map editor no longer works. The Google Maps are rendered correctly, just the map editor no longer works.
Firebug throws me a javascript error: this.toggle_link has no properties or emap has no properties in EditorsMap.js. --24.22.120.135 04:06, 9 August 2007 (UTC)
- I'm seeing this issue too. Firefox 2.0.0.6, MediaWiki 1.10.1, Google Maps Extension 0.8.0. I can't currently corroborate the javascript error (FireBug not installed), but I can tell you that the "make a map" link does not show under the formatting buttons in article edit mode. But extension-related markup is getting parsed correctly during rendering. --216.152.98.1 18:53, 13 September 2007 (UTC)
- Wait, nevermind. It is because I am an idiot. The make a map works for me just fine. I didn't realize the UI had changed. The button on the formatting toolbar exists on my deployment and the map editor works absolutely fine. Sorry for the false alarm. --216.152.98.1 20:02, 13 September 2007 (UTC)
- Same problem here. MW 1.11.1 and GM extension 0.9.0. "this.toggle_link has no properties[..]" --BigSmoke 13:41, 22 February 2008 (UTC)
- Solved the problem. After noticing that this.toggle_link doesn't occur anywhere in EditorsMap.js, I did a diff an found that an old version of the js file was being served from cache. I opened the js file in FF and did a proper reload to refresh the cache. Now, everything's working all dandy and fine. --BigSmoke 13:57, 22 February 2008 (UTC)
- Starting with 0.9.1, the JS will automatically reload with new versions of the extension. --Emiller 23:36, 26 February 2008 (UTC)
- Solved the problem. After noticing that this.toggle_link doesn't occur anywhere in EditorsMap.js, I did a diff an found that an old version of the js file was being served from cache. I opened the js file in FF and did a proper reload to refresh the cache. Now, everything's working all dandy and fine. --BigSmoke 13:57, 22 February 2008 (UTC)
"Invalid Character" in IE 7.0
[edit]I just installed the Extension (on Mediawiki 1.10.0) and everything went smoothly - except the map does not appear in the page after editing. The map editor works great. I copy and paste the <googlemap> code in and hit preview (or save). The resulting page shows an IE error (yellow hazard triangle in the status bar with the text "Done, but with errors on page". If you click the status bar to show the error it shows the message "Error: Invalid character" (with line number and character number). The character referenced seems to be in the Javascript block generated by the Map extension right near where it says
href="\"http
I notice if I take out the whole <a ... > tag (about using a compatibile web broser) save the page to my pc, then load this saved page in IE, the map comes up fine. Anyone know what this might be? The symptoms seem similar to an error referenced above (Editor works, but no visible map after preview/save) but different error messages (and causes?). Any help would be greatly appreciated. Graham 70.18.28.113 00:33, 12 August 2007 (UTC)
- Should be fixed in 0.9.1 --Emiller 23:32, 26 February 2008 (UTC)
KML export problem
[edit]Using Mediawiki 1.11.1 Installed extension ver 0.9.1 All worked a treat excpet for KML export. All polylines had the first coordinate repeated at the end of the line, so all the lines became enclosed spaces. ie somehow the first co-ord was duplicated at the end unnecessarily. Also markers are labelled as Point 1, Point 2, etc as opposed to showing the Title of the marker as seen in the Title bubble on the map.
OK thought ver 0.9.2 may contain a fix for the lines. Now clicking on a link to start a KML export this gets displayed:
Warning: SpecialPage::require_once(/home/bbug/public_html/wiki/includes/SpecialGoogleMapsKML.php) [function.SpecialPage-require-once]: failed to open stream: No such file or directory in /home/bbug/public_html/wiki/includes/SpecialPage.php on line 646
Fatal error: SpecialPage::require_once() [function.require]: Failed opening required '/home/bbug/public_html/wiki/includes/SpecialGoogleMapsKML.php' (include_path='/home/bbug/public_html/wiki:/home/bbug/public_html/wiki/includes:/home/bbug/public_html/wiki/languages:.:/usr/lib/php:/usr/local/lib/php') in /home/bbug/public_html/wiki/includes/SpecialPage.php on line 646
Figured SpecialGoogleMapsKML.php needed to be in the include directory - so put a copy in there. Fixed above error msg but know get 500 error - page cannot be displayed.
Keep up the good work.
- Thanks for the bug reports. 0.9.3 should fix the polyline problem, the point labelling problem, and the export errors. Please try it out and let me know. --Emiller 00:37, 9 April 2008 (UTC)