Extension talk:Maps/LQT Archive 1

Archive

To keep the length of this page reasonable, pre-0.5 topics have been put here. If you have an issue with an older version, or want to continue a moved discussion, please do it on this page - the archive will not be checked.

See also


 * Semantic Maps discussion page for discussions related to the functionality Semantic Maps adds to Maps.

Links no longer allowed for display_point(s) marker labels in Maps 0.5
In version 0.4.2 of Maps, I was able to use wiki links (for example: Extension:Maps ) in the marker labels for #display_point(s). As of version 0.5, I don't think doing so is working anymore, and I just confirmed this on the demo wiki (see here). I see that the issue regarding links has come up before, so perhaps there isn't an easy fix. Just noting this here since I don't see anything about it in the documentation.--MiamiVolts 06:28, 24 December 2009 (UTC)

Hey,

This is a bug - the functionality should have been working.

The issue is that the html doesn't get escaped correctly, and this JS string is outputted.

"Rome"

This is easy to fix though. I'll make the commit tomorrow.

Cheers

-- Jeroen De Dauw 23:22, 28 December 2009 (UTC)

Proposal for retrieving address string entered by user when input type=googlemaps
Discussion moved to here.

Maps Extension Not Working
Hello:

I've been trying to get the maps extension working on my wiki. I'm using MediaWiki 1.15.1 and Maps 0.5.1. I have a Google Maps key, which I added to Local Settings.php, after the include statement for the extension. I've also explicitly set the default mapping service to Google Maps.

When I add the code:

to a page, instead of a map displaying, I see a list of checkboxes with the following options:

Photos Videos Wikipedia Webcams

Does anyone have any idea what's happening here?

Thanks,

Patricia (patricia (at) prwatch.org)

Hey,

I've put your wiki code on my wiki, and as you can see here, it's working without any problems. It sounds like your map is not showing up cause it has some wrong inclusion path. Check your page source. There should be some html including GoogleMapFunctions.js. I suspect that if you go to this path, you'll get an error saying it doesn't exist. If so, you probably have your $wgScriptPath variable wrongly configured.

Some not on your wiki code though:

Display_address has been deprecated for a while now, although apparently I didn't remove it from the code yet (which I should have done actually). Use display_point(s) instead.

You can even omit the address= part, like this:

Cheers!

-- Jeroen De Dauw 21:49, 30 December 2009 (UTC)

Hi Jeroen:

I've checked the page source and found the following line: 

The $wgScriptPath for our wiki is not set to the default path so that's why the script is not being found. We do not have an actual or virtual subdirectory called "wiki'. Is there a way to fix this?

Hey,

"The $wgScriptPath for our wiki is not set to the default path"

By that I'm assuming you have set it to something other then the default. Or do you mean you did not set it at all?

Either way, you simply need to assign the correct value to $wgScriptPath, which reflects the directory structured you are using.

Cheers

-- Jeroen De Dauw 01:14, 31 December 2009 (UTC)

Hi Jeroen:

I guess I didn't explain that very well.

On our wiki $wgScriptPath is set to "/swtest" and not "/wiki". So, I can't figure out why the path to GoogleMapFunctions.js is showing as "/wiki/extensions/Maps/GoogleMaps/GoogleMapFunctions.js" in the page source. In other words, I don't know where "/wiki" is coming from.

Just out of curiosity, I changed line 38 in Maps.php from: $egMapsScriptPath = $wgScriptPath. '/extensions/Maps'; to: $egMapsScriptPath = '/swtest/extensions/Maps'; and now the page source is showing as "/swtest/extensions/Maps/GoogleMaps/GoogleMapFunctions.js" and the maps are displaying.

So, I don't know why the correct value is not being passed from Maps.php unless the path is hard-coded.

Thanks again for your help and the great maps extension!

Patricia

Hey,

You need to set $wgScriptPath in LocalSettings before you include Maps. I guess you have it after the inclusion :)

Cheers

-- Jeroen De Dauw 14:42, 31 December 2009 (UTC)

Hi Jeroen:

That fixed the problem. I had indeed put the "require_once" line for the Maps extension before $wgScriptPath. Once I moved the line after $wgScriptPath, everything worked like a charm.

Thanks again for all of your help.

I hope you have a happy and prosperous New Year!

~Patricia

Javascript loading race condition breaks Maps 0.5.1 in Firefox 3.5.x when using Google Maps
I have run in to a problem using Maps 0.5.1 wherein using Google Maps and doing something simple like causes the resulting html page to hang in Firefox 3.5.x on both linux and windows. The page works correctly in Konqueror and Epiphany on linux, and works correctly in IE on windows. These are vanilla installs of Firefox in all cases, with no extra addins installed. I have only tried using Google Maps, and have not determined if this issue affects any of the other supported mapping services.

The details are below. After digging in to what is happening I believe that Maps is suffering from a known race condition in Firefox between loading javascript from the server and rendering html in the browser. References to this race condition problem are given below, as well as a link to a solution that essentially implements "lazy loading" of the javascript using ajax instead of loading the javascript by just hitting a URL in a section.

I have a template that is used to format some simple results on an SMW page. At one point the template has the following function call in one row/column of a wikitable:  When the resulting page is sent to browser it hangs, and the message "Read maps.gstatic.com" is in the status bar. This hang is 100% reproducible, and it never times out. The same page works in other browsers as described above, and it works in Firefox if I remove the #display_point call.

In the Firefox error console, I noted the following error when the page hangs: Error: _mF is not defined Source File: http://maps.gstatic.com/intl/en_us/mapfiles/193c/maps2.api/main.js Line: 3

In looking for information regarding this error I found the following thread: http://groups.google.com/group/google-maps-api/msg/5104d9bb8658e1bd. This discussion concerns a known race condition in loading javascript and loading html in Firefox. In reviewing the html the browser is attempting to render and the point at which the hang occurs, I believe it is this issue that breaks Maps in Firefox 3.5.x.

In the same thread a solution was implemented and shown to work as described here: http://www.google.com/url?sa=D&q=http://groups.google.com/group/Google-Maps-API/browse_thread/thread/8863f57e0904a221/3f1577e7abed928b&usg=AFQjCNEnlTAA1jhHBOk1JYJMgLjz9h2NTg.

I propose that the referenced solution be implemented in Maps for the Google Maps service, using ajax to load the Google Maps API javascript after the html is all loaded into the browser. At least for me, this is now a showstopper bug preventing use of Maps/SM (actually using MW at all, because I need SMW and Maps/SM for what I'm doing in my application).

I will start digging into the Maps code myself to see if I can implement the referenced "lazy loading" approach using ajax. However, if someone who is already familiar with the Maps code could make a pass at it that would be highly appreciated, and would certainly fix the problem much more quickly than waiting for me to ramp up on the Maps code sufficiently to make these changes myself. Also, my guess is that it might be better to implement this solution in a general manner that applies to all mapping services, whereas I will likely start out by just doing it for Google Maps to confirm that it resolves the hang symptom.

Thanks!

-Al

HTML / Wiki Links in Display Marker?
Hello Jeroen:

Just wondering if this has been fixed -- Extension_talk:Maps. I'm using MediaWiki 1.15.1 and Maps 0.5.1 and I haven't been able to get wiki or HTML links working in marker labels. It would be great to have this feature.

Thanks,

Patricia (patricia at prwatch.org)

Hey,

This has been fixed, but after 0.5.1 was released. The code will be part of 0.5.2, which does not have a fixed release date yet. You can get the latest code from SVN trunk though.

Cheers

-- Jeroen De Dauw 20:30, 7 January 2010 (UTC)

How to get multiple marker images in one map
Hi Jeroen,

This should be a very easy answer for you, but I can't seem to figure it out. I have a map with multiple locations. I want to add different colored markers to different points. Tried it here: http://www.snowboardwiki.nl/wiki_source/index.php?title=Locaties_in_Nederland Still, it doesn't seem to work. The thing I missed in this article: Where must I save the marker.png icons for the extension to work?

Thanks in advance. Len.

Hey,

See point specific data for more info about setting the marker icon.

Cheers

-- Jeroen De Dauw 01:24, 14 January 2010 (UTC)

Dear Jeroen, I've read that part of the article before I asked my question, but I couldn't find any information about where those icons are to be saved. Are they standard on the google maps server? Or do they have to be in a public_html map? Or do I have to upload them to mediawiki (already tried this, didn't work, but maybe I did something wrong). Hope you could help me with it. "and will display a pop-up with it's own title, it's own text, and will have it's own marker (an image with the name green-marker.png)."

Thanks! Len.

Hey,

The image file needs to be on your wiki server. I'm currently patching up the (really out of date) examples on my wiki, and will link you one demonstrating the marker icon usage as soon as I got one.

Cheers

-- Jeroen De Dauw 16:23, 16 January 2010 (UTC)

Thanks! Really looking forward to it. I'll add that info, as soon as I got it, to the text on this extension page. Len.

Hey,

Have a look at these examples to see how you can set markers. Also see the third one here on how to set the icon for all markers. You need to upload the icon via your wiki. If it's uploaded to File:Green_marker.png, you simply have to put Green_marker.png as value.

Cheers

-- Jeroen De Dauw 03:25, 19 January 2010 (UTC)

Turning markers on and off with check boxes
Hi Jeroen. Is it possible with the Maps extension to get this kind of output? http://www.geocodezip.com/v2_MarkerCheckBoxes.asp

It would be very helpful for my site, but I'm a bit of a noob on wiki-things, so maybe you can answer me on this one. Would be great. Thanks in advance, Len.

Hey,

Maps does not support such functionality. I can develop it though, if you are willing to fund it.

Cheers

-- Jeroen De Dauw 15:32, 12 January 2010 (UTC)

only Osm mapnik or mapnik by default ?
hi Jeroen

I have a question. on this page http://wikikit.homelinux.org/ccmgy/index.php/Carte_de_la_Ccmgy, i should like to obtain OSMmapnik layer by default instead of OSMarender. On this wiki i use the Maps 0.4.2. is it any issue ?

Thanks for your help Jeffdelonge 11:15, 12 January 2010 (UTC)

Hey,

The first layer will always be loaded as default. Simply specify the OSM layers separately, so you can choose the order. See how to define layers for more info.

A simple example: layers=osm-mapnik, osmarender

Also, I encourage you to upgrade to the latest version :)

Cheers

-- Jeroen De Dauw 15:37, 12 January 2010 (UTC)


 * thanks for your help but i had already tested this and it dosnt work and i dont know why. I also just wait for your next release  because of the pb about wikitext in popup
 * thank a lot --Jeffdelonge 22:33, 13 January 2010 (UTC)

Maps /w OpenLayers to make custom Video Game maps?
I'm running a Wiki dedicated to a new video game, Star Trek Online, and am trying to get a map on the site using Maps, Semantic Maps and OpenLayers.

Is this possible using this extension? I don't see any way to load a custom map using the settings in the Usage Docs here. The Openlayers site however specifically states that it can be used for this type of project.

Thanks

Hey,

You can indeed do this with OpenLayers. Maps (and SM) do not have support for this though. It is however the most requested feature to be added, and is on the to-do list for the next big release. The biggest issue with such functionality is probably deciding what the wikitext should look like.

I'm not really putting any effort in the next big release though ATM (and so is no one else). If you however can fund development of images-as-layers functionality, let me know.

Cheers

-- Jeroen De Dauw 15:58, 16 January 2010 (UTC)

Install note for 0.5.3
When I just upgraded from 0.5.1 to 0.5.3, none of my Google maps were displaying. Then, I checked through the new files and discovered that the 'googlemaps' service had been changed to be called 'googlemaps2'. So, in my LocalSettings.php file, where I was setting $egMapsAvailableServices and $egMapsAvailableGeoServices, I had to switch to use 'googlemaps2' in the arrays to Google maps to display again. I didn't see anything about this in the install/readme notes, so posting a heads-up here.--MiamiVolts 04:07, 5 February 2010 (UTC)

Hey,

You should indeed change googlemaps to googlemaps2 in your LocalSettings file when you are setting $egMapsAvailableServices.

Cheers

-- Jeroen De Dauw 17:15, 17 February 2010 (UTC)

Javscript problem in IE 8
I'm having serious problems with the google map display. In Firefox, everything is fine, but in IE8 errors are displayed.

The problematic page is the main page: http://www.verwaltungskooperation.at/index.php?title=Plattform_Verwaltungskooperation in the current version, I replaced the googlemap with a yahoomap, because then only the exclamation mark in IE (left bottom corner) is shown, but the page loads. When I use googlemap, the site cannot be loaded at all or the left menu is missing.

Here is a testpage with the googlemap that is causing the problems http://www.verwaltungskooperation.at/index.php?title=Test strangely, at first load it only shows the error, but reloading the page results in a message, the IE can't load the page.

The error is: Message: Function expected row: 955 column: 3 Code: 0 URI: http://www.verwaltungskooperation.at/skins/common/wikibits.js?207

So it must be some sort of incompatiblity with Maps and the MediwWiki skins (if I change to another than monobook, the error remains because wikibits.js is for all skins.

If I remove the map display altogether, no errors are showed on the rest of the page. It only happens with maps that display mutliple points. A single point on a map is no problem: http://www.verwaltungskooperation.at/index.php?title=Test:GoogleMaps

- Bernhard

Hey,

I replied on the mailing list - the problem should be solved after you upgrade to a recent version of Maps/SM.

Cheers

-- Jeroen De Dauw 17:15, 17 February 2010 (UTC)

Javascript error with Google Maps (0.5.3)
Hey Jeroen,

I have uncovered a javascript bug with the implementation of Google Maps.

onloadFuncts[i] is not a function http://foo.org/w/skins/common/wikibits.js (Line 955)

This occurs whenever a Google Map is displayed. This is being caused by the call to

addOnloadHook( initializeGoogleMap(...) );

(For Google Maps, this affects files GoogleMaps/Maps_GoogleMapsDispMap.php and GoogleMaps/Maps_GoogleMapsDispPoint.php) This is not the correct way to call addOnloadHook, because it is expecting a function, and you are passing whatever initializeGoogleMap returns. Instead you should be calling it like so:

addOnloadHook(function {initializeGoogleMap(...);});

This will prevent this error.

Hey,

Thanks a lot for reporting this, I did not know the current usage was wrong :)

Cheers

-- Jeroen De Dauw 20:01, 26 February 2010 (UTC)

Version 0.5.4 test
hello Jeroen

as on http://wiki.bn2vs.com/User:Jeffdelonge i just try 0.5.4 today and i have some issues.

the good new is that the choice of the layers works fine. The bad news are the issues below. in my wiki http://wikikit.homelinux.org/ccmgy/index.php/Carte_de_la_Ccmgy this syntax works :  Gy, Haute-Saône, France~Gy~La page de Gy;  but this one is broken  Gy, Haute-Saône, France~Gy~La page de Gy;  Citey has a pop-up without link and it's displayed correctly, other villages havent links and pop-up blank. Gy ask marker-blue.png and no marker is displayed.
 * there is a problem with Google API activation key
 * wikisyntax links are lost again in pop-up.
 * I dont understand how to get different label icons

could you have a look on this page.

thanks for all your job.--Jeffdelonge 11:18, 4 March 2010 (UTC)

Hey,


 * API key: Are you sure you entered a valid one in LocalSettings, AFTER the inclusion of Maps?
 * sure and i have the same pb on your own wiki http://wiki.bn2vs.com/User:Jeffdelonge (box asking for a new google API key).


 * Marker icons: I can see the blue markers so suppose you got it fixed? For displaying different icons, see point specific data, or the examples.
 * no i just replace the red icon by a blue named marker.png in /extensions/Maps/OpenLayers/OpenLayers/img/ that's not a soluce. in this directory i find 4 icons : marker.png, marker-blue.png, marker-gold.png, marker-green.png; on the map, i never got any alternative icon, only marker.png. do you have an exemple working with these OpenStreetMap icons ?


 * Wiki text in pop-ups: O no, not again >_> I'll have a look at this for the next release. Also, I can confirm that there are a few things wrong with how the text is displayed in the pop-ups when using templates. I have to investigate this further though - hope to have time for this next week.
 * thanks Jeffdelonge 09:40, 5 March 2010 (UTC)

Cheers

-- Jeroen De Dauw 17:46, 4 March 2010 (UTC)

Note that you can put new lines between locations without any problems:

{{#display_points: New York~NYC; Berlin; London~London~Capital of the UK; ...

This will make your page a lot more readable and easier to maintain.

Cheers

-- Jeroen De Dauw 17:55, 4 March 2010 (UTC)

Hey,

Apparently I simply forgot to add some code for the new layer definition stuff, which is causing the problem with Google maps in OpenLayers. Ill try to fix this soon, and add it to the to-do list right away.

I still can't replicate the issue with the markers though. I've successfully added a green marker on the map you put on my wiki... Are you using some alternate directory structure on your wiki?


 * I don't think so, can you give me in what folder is stored your Green marker.png ?--Jeffdelonge 08:02, 6 March 2010 (UTC)

Cheers

-- Jeroen De Dauw 16:52, 5 March 2010 (UTC)

Hey,

I have no idea - I just uploaded with the Upload file functionality build into MediaWiki, which is what you also should do - dumping the file in some dir won't work.

The issue with Google Maps in OpenLayers is quite simple actually, although I don't see a good solution for it. The layers are defined before you define your Google Maps key, hence you'll end up having a request without a key. The easiest way to remedy this is to copy $egMapsOLLayerDependencies from Maps_Settings.php to your LocalSettings file, which should solve the problem. I'll keep looking for a better solution to this problem for next release.

Can you please put your messages in sequence? If you put them between mine, there is a good chance I'll miss them when the change does not appear on my watchlist (which does happen frequently).

Cheers

-- Jeroen De Dauw 15:42, 6 March 2010 (UTC)

ok, thanks for your responses, that's right for markers, i havent see aniwhere it was so easy. For the others issues, i will wait for next release. thanks a lot for your work, this extension is great --Jeffdelonge 20:19, 6 March 2010 (UTC)

Upgrade from 0.5.2
I was trying to upgrade from 0.5.2 to 0.5.4, but I got error messages. Are there additional procedures required to upgrade other than just changing the files?

130.65.128.169 21:47, 4 March 2010 (UTC)

Hey,

Did you also upgrade validator? If so, please provide me with either the error messages and a link to your wiki's version page, or and a place where I can see the errors.

Cheers

-- 193.190.172.173 00:01, 5 March 2010 (UTC)

Everything was upgraded and I got this:

Warning: include_once(/home/.eases//transitunlimited.org/extensions/SemanticMaps$IP/extensions/SemanticMaps/GoogleMaps/SM_GoogleMaps.php) [function.include-once]: failed to open stream: No such file or directory in /home/.eases//transitunlimited.org/LocalSettings.php on line 169

Warning: include_once [function.include]: Failed opening '/home/.eases//transitunlimited.org/extensions/SemanticMaps$IP/extensions/SemanticMaps/GoogleMaps/SM_GoogleMaps.php' for inclusion (include_path='/home/.eases//transitunlimited.org:/home/.eases//transitunlimited.org/includes:/home/.eases//transitunlimited.org/languages:.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.eases//transitunlimited.org/LocalSettings.php on line 169

I have gone back to the 0.5.3 for now. http://www.transitunlimited.org/Special:Version

67.170.217.247 07:52, 5 March 2010 (UTC)

Hey,

I know what's causing this, and will investigate how this can be fixed best. In the meanwhile you can manually resolve the issue by changing a line of code in Maps, and on in SM.

Go to extensions/maps/Maps.php, line ~38: replace it by $egMapsScriptPath = "$wgScriptPath/extensions/Maps";

Same procedure for Semantic Maps in file extensions/SemanticMaps/SemanticMaps.php

Cheers

-- Jeroen De Dauw 17:00, 5 March 2010 (UTC)

Hey,

I can't see anything wrong with the 0.5.4 code actually. Are you using some custom value for $wgExtensionAssetsPath? In any case, it'd be usefull if you could tell me which value it has at the previously indicated lines.

Cheers

-- Jeroen De Dauw 17:09, 5 March 2010 (UTC)

Thanks, your new line works, but after that, I had to change one line on localsettings.php to change 'googlemaps' to 'googlemaps2'. in $egMapsAvailableServices. Otherwise the new extension won't work. 67.170.217.247 08:48, 6 March 2010 (UTC)

Do you know why some of the maps created by Semantic Maps with Compound queries work http://www.transitunlimited.org/San_Diego_Trolley_Blue_Line and those don't" http://www.transitunlimited.org/Los_Angeles_Metro_Rail_Red_Line All the maps work before under 0.5.2.

67.170.217.247 09:14, 6 March 2010 (UTC)

Hey,

The map not showing up has nothing to do with SQC, but rather some escaping issue introduced by a security fix in the last version of Semantic Maps. Will have a look at this soon. Can you put SM specific topics on the SM talk page? That makes it easier for me to track.

Cheers

-- Jeroen De Dauw 15:37, 6 March 2010 (UTC)

GMaps not defined
Hi Jeroen,

installed 5.4 (Maps and Validator). It now gives me an error (FireFox Error console): Error: GMaps is not defined

http://www.vflashdesign.nl/mediawiki-1.15.1/extensions/Maps/GoogleMaps/GoogleMapFunctions.min.js?207-0.5.4

Any help?

Kind regards, --Jos 12:06, 8 March 2010 (UTC)

Hey,

That's odd. Can you provide a link to the page the error is occurring on?

Cheers

-- Jeroen De Dauw 21:48, 8 March 2010 (UTC)

Of Course: http://www.vflashdesign.nl/mediawiki-1.15.1/index.php?title=Lochem

My provider is running php 5.3.1 (cgi-fcgi), it gives a lot of problems in other mediawiki extensions too.

But this might be a js problem.

--Jos 23:06, 8 March 2010 (UTC)

Googlemaps languages code != getCode for Hebrew
googlemaps supports several languages, used with parameter "hl" as in &hl=de for German. the maps extension uses the getCode API to pass this parameter. the problem is that the language codes used by googlemaps are not 1 to 1 with what getCode returns. for instance, for Hebrew, getCode returns "he" and googlemaps expects "iw". see google language spreadsheet suggest: create a "getGoogleLanguageCode" that will read getCode into "$code", compare $code" "he", if so return "iw", otherwise return $code. there might be other countries where what googlemaps expects differ from what getCode returned, so this function should be expanded as needed.