Extension talk:Maps/LQT Archive 1

Multiple Points
Hi, I was using a different version for google maps on my Wiki, but it timed out when showing more than 100 points and didn’t have an easy solution, so I tried switching to this one with the hope it will solve the issue.

The thing is I started adding points and everything went perfect, very quick, until you add one more point (less that 100) and then the map just desapear…

You can see what I mean here:

If you edit this page you will see there is a Maps query, and if you delete some points of the query you will see the result on the map, but when adding more it disappears…

Any clue what’s going on here? Any way of solving it?

Thanks! Guillermo (guillermo (at) wikiarquitectura (dot) com)

--81.37.246.243 13:39, 23 November 2009 (UTC)

No download link
Where is the code? The download location isn't mentioned. --Ryan lane 03:14, 16 July 2009 (UTC)

Found it in the announcement email; added it to the page. --Ryan lane 03:20, 16 July 2009 (UTC)

I do now see the documentation says not released. Heh. Oh well, too late ;).

Ok. Removed again. --Ryan lane 03:23, 16 July 2009 (UTC)

Multiple markers
Is it possible to show more than one display_point on a map without using the query functions of Semantic Maps? I see a display_points function is in the New Proposals section.

In an attempt to get multiple markers on a map, I installed Semantic Forms, but in trying example code with queries, I get no output on the wiki (and the wiki debug output doesn't show anything obvious). Perhaps I have the precedence wrong in LocalSettings.php, in which case here is the relevant snippet of that file:

# for SemanticMediaWiki include_once("$IP/extensions/SemanticMediaWiki/includes/SMW_Settings.php"); enableSemantics('tig.colorist.org'); # according to the Extension:Semantic Forms page, it goes here: include_once('extensions/SemanticForms/includes/SF_Settings.php'); require_once( "$IP/extensions/Maps/Maps.php" ); # Semantic Maps require_once( "$IP/extensions/SemanticMaps/SemanticMaps.php" );

Thank you for this extension, it will replace both GoogleMaps and the googlemap WikiWidget that I've been using.

--Robling 06:11, 25 July 2009 (UTC)

It is currently not possible to have multiple points on one map in Maps (hence the proposal for those new parser functions). For Semantic Maps to show up multiple queried coordinates onto one map, you do not need to have Semantic Forms. SF will simply make it considerably easier to insert coordinates, but is in no way required.

Both the multiple point parser functions and custom base layers for OpenLayers are apparently in high demand, and since the former should be available before the later, this will move up on my to-do list (possible for the 0.3 releases).

To solve your problem of no markers getting displayed on your map, I suggest you post your ask query here, which is probably the source of your problem.

--Jeroen De Dauw 15:12, 25 July 2009 (UTC)

Thank you for the prompt reply. The ask query is copied from the Semantic Maps examples page:

--Robling 16:47, 25 July 2009 (UTC)

Well, if the map doesn't show anything, it means their are either no results, or the results do not contain coordinate data. Make sure you have items in the Locations category with a 'Has coordinates' property of type 'geographical coordinate'. In a while I'll modify my demo wiki a little to make the query stuff more clear.

--Jeroen De Dauw 20:47, 25 July 2009 (UTC)

Where can I find out more about how the Locations category should be set up? I'm sheepishly afraid I missed that step in setting up Semantic Maps. Thanks in advance.

--Robling 22:48, 25 July 2009 (UTC)

Note that the category doesn't need to be named like that. It's just regular SMW stuff. If you have problems with this, you can have a look at the SMW manual. Try some stuff out with demo values and a table as result format. Once you can do that, you shouldn't have any problems doing the same with Semantic Maps.

--Jeroen De Dauw 11:15, 26 July 2009 (UTC)

Thanks Jeroen.

--Robling 14:50, 27 July 2009 (UTC)

cURL rather than URL in GoogleMaps API call
Maps not working for me. I get an error saying that URL file access is not allowed on my server. I investigated and the advice seems to be that file URL access is disabled by my hosting company for very good security reasons. I have been told that cURL should be used instead and this is a very simple change. Could this be done to Maps_GoogleGeocoder.php? Otherwise a lot of people will not be able to use this extension. http://www.timshowers.com/2008/08/php-geocoding-tutorial-with-the-google-maps-api-part-one/

Thanks! Mitchelln 13:40, 5 August 2009 (UTC)

Hey,

Thanks for the suggestion. You have a valid point. This will be resolved in the geocoders in version 0.3.

Cheers Jeroen De Dauw 19:36, 5 August 2009 (UTC)

Hey,

This issue has been resolved in the now published 0.3 release.

Cheers Jeroen De Dauw 22:00, 16 August 2009 (UTC)

Fantastic. I now have working maps :) Thanks a lot! Mitchelln 9:40, 18 August 2009 (UTC)

Google Flash API ?
Hi Jeroen

I recently came across the documentation pages for the Google Flash API. Some of the demos were impressive.

http://code.google.com/apis/maps/documentation/flash/

Is this something you are planning on incorporating eventually ?

- Laurent Alquier

Hey Laurent,

Thanks for the suggestion. Yahoo! Maps also has a flash API btw. Currently this stuff has low priority though, but it might get implemented in the distant future.

Cheers

-- Jeroen De Dauw 11:39, 12 September 2009 (UTC)

UK Postcodes consistently out on map.
Hi, I'm seeing a problem I also saw on the old version of this extension. UK Postcodes return a point that is consistantly about 0.5 miles out from the real location. However, if I type the postcode directly into google maps it shows correctly. Example: service=googlemaps The Postcode is for an address on Boundary Row, but it shows up on a nearby street called The Cut. The offset always seems to be about the same - to the left by about 0.5 miles. Any ideas? Also, I notice you get a different result depending on whether the postcode is SE1 8HP rather than SE18HP. A postcode parser problem?
 * 1) display_address:
 * coordinates=
 * zoom=15
 * width=650
 * height=500
 * autozoom=off

Hey,

The geocoding and parsing of those postal codes is done by the used geocoding service. Maps does not do any work on that part, and therefore can not really fix the problem.

Cheers

-- Jeroen De Dauw 11:40, 12 September 2009 (UTC) But it is right if I use GoogleMaps directly! The fact that the marker is consistently out by the same direction/distance seems to indicate some error introduced by the extension. As it is this extension is useless with UK postcodes :( How is the field passed to the geocoder? Have a go with the examples I gave above to see the problem. Try the postcode direct and then via the extension. You will see the error. Mitchelln 15:50, 19 October 2009 (GMT)

No result at all
Hi, I installed Maps and Semantic Maps but I don't get any result at all. With display_point with openlayers I get a grey area but that's the only sign that something is happening. I think I did everything that should be done: - Copy files to extension maps - Added 'includeonce' things in the right order - GoogleMapsKey after that

Or did I mis something? --AdSvS 14:38, 5 September 2009 (UTC)

Hey,

What version of Maps/SM are you using? Can you provide a link to your wiki? It's a little hard to determine your problem with so little info.

Cheers

--Jeroen De Dauw 21:05, 5 September 2009 (UTC)

The site is www.denhout.eu. I'm in the process of migrating from Semantic Google Maps, so you'll see some of both. I tried the Moscow example from your site and that didn't work. So it can't be that I had some bad parameter values or something like that. BTW: have a look at your recent changes. --AdSvS 09:20, 6 September 2009 (UTC)

Hey,

Can you also provide a link to a page where it is going wrong?

Cheers

--Jeroen De Dauw 10:42, 7 September 2009 (UTC)

Hi Jeroen, I created a user Jeroen, pw: Jeroen2009. On the user page I copied the Moscow example and as you can see nothing is happening. It should work also on 'Houts Archief' pages, of which you can choose one from the mainpage.

Thanks! --AdSvS 17:44, 7 September 2009 (UTC)

My results with version 0.4 (first try) was just a grey Map area. I'm trying to use OpenLayers only solution (without Google key and semantic extensions).

LocalSettings.php includes: require_once( "$IP/extensions/Maps/Maps.php" ); ... $egMapsDefaultGeoService = 'geonames';

Firebug errors: initOLSettings is not defined initOLSettings(200, 100); \n

and initOpenLayer is not defined initOpenLayer('open_layer_1', 24.93...341667, 60.1755556, , , '')], 500)\r\n

Solved: I was trying to require_once( "$IP/extensions/Maps/Maps.php" ) in LocalSettings.php before $wgScriptPath was set up!

Files missing?
Hey,

Just noticed you simply appear to be missing some JS files. I suggest you delete the extensions/maps directory(and maybe the one of SM to) and re-upload the extension.

--Jeroen De Dauw 17:44, 9 September 2009 (UTC)


 * I think the problem is actually that your $wgScriptPath setting in LocalSettings.php is incorrect - it should be "", not "/wiki". Yaron Koren 19:10, 12 September 2009 (UTC)

Hi,

I re-uploaded Maps and SM and upgraded SMW to 1.4.3 and I checked the $wgScriptPath setting in LocalSettings.php. But still no result.

Although indeed some js files were missing. What else could it be? --AdSvS 20:10, 11 October 2009 (UTC)

Hey,

I don't think any files are missing. It sounds like you are having the same problem as discussed here though. In any case, try using the latest version of Maps and SM (the last commit on SVN trunk, versioned 0.3.5 a3). This version uses relative paths for all references, instead of absolute ones.

Cheers

-- Jeroen De Dauw 21:23, 11 October 2009 (UTC)

Openlayers more general integration
Hello!

I'm interested in an openlayers object integrated into mediawiki pages but accessing our own map servers (this is an archaeological project creating site descriptions in a mediawiki system).

It would be nice to be able to include dynamic maps in mediawiki showing maps, layers (vector and raster) FROM OUR OWN servers (Geoserver).

I've read the Maps extension documentation and it seems that it mainly support google, yahoo and other map providers and geocoding and basic display. This is fine - but I need to access our own servers. Is it possible or targeted at all?

thanks in advance

Robert Kuszinger

Hey,

Maps indeed does not support the use of your own data sources ATM. This functionality is on the to-do list though. It's also true that Maps only supports basic display (markers) ATM. Adding new features to Maps that enable more complex display are also a to-do, but much less urgent.

If this is a high priority for you, and you are willing to (let others) do work on this functionality, be sure to contact me about it, so efforts can be coordinated.

Cheers

-- Jeroen De Dauw 16:53, 16 September 2009 (UTC)

If this is not or will not be supported other way, look at the file /extensions/Maps/OpenLayers/OpenLayerFunctions.js

I copied the following lines case 'openlayers' : case 'open-layers' : if (!usedOLWMS){ newLayer = new OpenLayers.Layer.WMS( 'OpenLayers WMS', 'http://labs.metacarta.com/wms/vmap0', {layers: 'basic', 'sphericalMercator':true} ); usedOLWMS = true; } break;

and created own modified case (add also var usedGSOLWMS):

case 'geoserver_osm' :

if (!usedGSOLWMS){ newLayer = new OpenLayers.Layer.WMS( 'Geoserver OSM WMS', 'http://10.0.0.46:8080/geoserver/wms', {layers: 'osm_suomi:planet_osm_line', format: 'image/png', transparent: 'true'}, {'isBaseLayer': false} ); usedGSOLWMS = true; } break;

In the WMS request EPSG:900913 is used as default (not the best solution in my case, but this way I got an own overlay top of osm map). --JK

Hey,

That's correct. You can indeed easily do it that way. If you do though, please send over the code so it can be added to the extension so everyone can use it :)

Cheers

-- Jeroen De Dauw 20:25, 18 November 2009 (UTC)

Some public OGC Web Services to try :)

I guess most of them support EPSG:4326 but not EPSG:900913. Is there an easy and correct way to use other projections than EPSG:900913 or EPSG:4326 so that markers will be geocoded, placed and calculated correctly with Maps extension? I think OL can can do that easily with proj4js, see http://trac.openlayers.org/wiki/Documentation/Dev/proj4js

-- JK

Default parameter 'address=' required?
Hi, I installed version 0.3.4 of Maps and SemanticMaps on my wiki to replace SemanticGoogleMaps.

While it works ok, I found that it doesn't display any maps if some of the 'default parameters' (like address= or coordinates=) aren't explicitely given. This happens on my wiki as well as with the examples on the wiki.bn2vs.com/wiki/Maps or on the sandbox there.

So

is working while

doesn't display any map

Especially the openlayer examples on wiki.bn2vs.com are all missing the 'address=' parameter and therefore not displaying at all but simply showing an empty gray square.

Optimale 11:47, 17 September 2009 (UTC)

Hey,

You are right, that's not working, and it should be. It's a bug introduced in the latest release, 0.3.4, and has already been put onto the to-do list for the next release. I've fixed it already, since it was a minor issue, but haven't committed it yet since I'm having some problems with my SVN client. Hope to get it committed to SVN by this weekend.

Until then I suggest you do use the address= parameter. There's nothing wrong about that, and only typing a few extra chars.

Cheers

-- Jeroen De Dauw 21:54, 17 September 2009 (UTC)

Hey,

The bug fix has been commited to svn trunk.

Cheers

-- Jeroen De Dauw 15:46, 20 September 2009 (UTC)

HTML or Wikitext in labels
Hi, how can I use HTML or Wikitext for e.g. links in labels of points? I want something like the following:

But whenever characters like the apostrophe (') or the equals sign (=) is used, the display stops working. I'd like to have even more complex HTML or wikitext as label text, though. How can this be achieved?

Hey,

I'm aware of this problem. Quite a lot of characters can't be used in the parameter values sadly enough. (I'll probably add a list to the docs when I update them for the next version.) This seems to be a limitation of wikitext, non specific to Maps, but definitely more obvious in case of the title and label parameters.

I'm open to suggestions on how to solve this issue, cause ATM I don't see any non-hacky way to get around them.

Cheers

-- Jeroen De Dauw 16:58, 3 October 2009 (UTC)


 * If you added a template feature, the label itself could be built into the template, as well as custom display of the other results.
 * -- Slithytove2 08:11, 15 January 2010 (UTC)

Mandatory configuration parameters for relocated extension directory
If somebody uses the Short-URL feature for MediaWiki and/or has relocated the extension directory, then one has to supply access to the CSS and JS files from a couple of SMW extensions and the Maps extension, otherwise they won't work. I created a new directory called "mw-extensions" in my root and placed symlinks to all the affected extensions.

Here's what I had to add to my LocalSettings.php to make it all work again: $smwgScriptPath   = '/mw-extensions/SemanticMediaWiki'; $sfgScriptPath    = '/mw-extensions/SemanticForms'; $smgScriptPath    = '/mw-extensions/SemanticMaps'; $smgIncludePath   = $smgScriptPath; $egMapsScriptPath = '/mw-extensions/Maps'; $egMapsIncludePath = $egMapsScriptPath;

If you don't do this, then you'll get JavaScript errors for calls to addLoadEvent and/or initializeGoogleMap when trying to use the Maps extension.

Hey,

Are you suggesting a setting for the extensions dir should be created, or is already present and should be used in the mentioned extensions?

Cheers

-- Jeroen De Dauw 17:05, 3 October 2009 (UTC)


 * The functionality is already there, it's just documented nowhere. In case of the Maps extension, one has to set $egMapsScriptPath and $egMapsIncludePath to some URL that can be reached on the web server. In case of Semantic Maps, it's $smgScriptPath and $smgIncludePath. A little strange, maybe, is that there are two variables, while for the other SMW extensions there is typically only one. What's the difference between ScriptPath and IncludePath?

Hey,

You can change it that way, but it's not ideal. If you change your extensions directory (why would you want to do this actually?), you should only edit one variable, and not one for every extension.

The $egMapsIncludePath contains the full path, versus the relative one of $egMapsScriptPath. $egMapsIncludePath is indeed redundant though. Thanks for noticing.

Cheers

-- Jeroen De Dauw 10:34, 4 October 2009 (UTC)


 * Not my decision, it's the default when one installs MediaWiki in Debian or Ubuntu through their package repositories. The mediawiki files are in /var/lib, the extension directory as well in its own directory, the web-visible files are in /usr/share with symlinks to /var/lib and the actual MediaWiki configuration and extension directory that is being used is in /etc. They tried to abstract the MediaWiki software and extensions by this and make extension loading more modular, too. It's a nice attempt, but it breaks a lot of things, and I am not too happy with it.

I've removed this redundancy. It won't be present any more in next release.

Cheers

-- Jeroen De Dauw 11:03, 4 October 2009 (UTC)

Small maps
Hi, I see that you're busily working on the extensions. There is one more thing that I want to report: At the moment it is not possible to display maps with a width of less than about 280 pixels, because the copyright message that is being displayed below and the navigation controls on the upper left edge will reach out of the map frame. Would it be possible to add support so that maps can be displayed that are only about 100 or 150 pixels wide?

Hey,

I don't think so. It would be illogical if you could remove the copyright, and if the API held into account small maps, you wouldn't have a problem in the first place. Which mapping service are you talking about anyway? Google Maps? If so, maybe v3 of their API will fix this. It's been in beta for quite a while, and as soon as it goes stable, I'll put it into Maps.

Cheers

-- Jeroen De Dauw

The obsolete Google Maps extension had an option to only use small controls. That helped a bunch. I resize the copyright message with inline CSS (Not remove, resize! So that it won't break my tables)

-- Skerit 22:46, 18 October 2009 (UTC)

The problem isn't that there's a copyright message, the problem is that the footer includes a link to the Google Maps/Earth Terms of Service which is non-breaking with the copyright line. If the link can be removed somehow, or the footer divided into two lines so that the map doesn't need to be as wide to span the entire message, I'd be glad to know about this possibility.

Hey,

What extension are you referring to? Google Maps (this one isn't obsolete) or Semantic Google Maps? In either case I can have a look at how those handled small maps, and most likely implement the same solution.

Cheers

-- Jeroen De Dauw

Hello Jeroen, you can try http://194.19.110.207 - This is a wiki I have installed from scratch, and still the same issue.

Hey,

Are you Skerit? Or are you the same person that started the topic about queries not working on the talk page of SM? Or both? Please provide your name when posting, so I know who I'm replying to.

In this instance I can not accurately determine what your trying to say since I don't know which other posts belong to you.

Cheers

-- Jeroen De Dauw

Templates
Hi, when I try to use a template tag as the coordinate it doesn't show the map or even No coordinates provided for the map. as I would expect. --Jhoogy 03:52, 24 October 2009 (UTC)

Regarding UK Postcodes consistently out on map (above!)
Hopefully this is very simple. It looks like the extension isn't either passing the last character of the search string to the geocoder or is not handling the space character properly. This also explains why I get different results with the extension depending on whether I put the space between the postcode sections or not (SE1 8HP vs SE18HP), whereas GoogleMaps doesn't. I suspected the string was getting mangled somehow. The effect can easily be seen with the given examples if you compare them in Googlemaps and the Maps call:

So hopefully this can easily be fixed now please. Postcodes is the primary way people in the UK search for or display locations. If it doesn't work then they cannot use it. Thanks! --mitchelln 15:20, 29th October 2009 (GMT)

Hey,

Does ,UK give you the output you want or not (as plain text, not nested in a map)?

Also, you are using display_address with a coordinates parameter. You should either use display_point for this, or (recommended) remove the coordinates= and geocode function.

Cheers

-- Jeroen De Dauw

Thanks for replying. Actually it is a Semantic Property - ,UK}}. This returns okay in plain text as SE1 8HP,UK on the page. SE1 8HP,UK gives the right point when entered into GoogleMaps direct. But results in the wrong point when used in the Maps extension.

I tried display_point. Same result. Point is not in the right place on the map. I've also tried display_address: service=googlemaps }} But I get the same result. The point is not in the right place. Even tried hard coding it to address=SE1 8HP,UK. It is still in the wrong place. Should be Boundary Row, but it's half a mile out. Same result as my original usage in fact. As I say, put SE1 8HP,UK into GoogleMaps and it shows the right place. It's not just this example either, all postcodes I've tried with this extension are not showing the right place. This is a real show stopper for using it in the UK
 * 1) display_address:
 * address=,UK
 * zoom=12
 * width=650
 * height=500
 * autozoom=off

This isn't just restricted to UK postcodes either. US zip codes (e.g. CO 80111) and French postal codes do not work either.

Thanks for your help with this. Hopefully we can get to the bottom of it! --mitchelln 11:40, 4th November 2009 (GMT)

Hey,

Can you give me an example UK postcode, a link to maps.google.com with a marker where it should be, and also one to the same location, but with the markers (manually put) off? That'll enable me to do some testing myself, since ATM I simply can't determine if it's off or not.

Cheers

-- Jeroen De Dauw

Multiple Point Map Form
Does anyone know of any site that has a form that accepts multiple points on a map?

It's quite straight forward to manually use the display points parser but much more user friendly to do it with a form. Although, I can't quite get a form to do it...been working on it at scratchpad referata here.

kpf 10/30/2009

Hey,

The functionality you are describing is not supported by Maps or Semantic Maps.

In what way would you want to use such a form? Only SM supports mapping forms, but you placed this on the talk page of Maps. So do you want to use it in a semantic way or not?

Cheers

-- Jeroen De Dauw 16:49, 1 November 2009 (UTC)

Hi Jeroen,

What I'm trying to do is use the parser functions and  in conjunction with a semantic form so it is more user friendly for people to enter points. Rather than having someone manually enter the following:

I've done this with a single point but what if someone wanted to enter another point on the same map  that's what I'm trying to get a form to accept. If you can do it with it seems you should be able to do it with, the question is how... The answer might be an additional field parameter, Multiple points, which will provide a 'Save Point' button inside the form. If you look at the example here, when you enter the data in the form the point doesn't hold that data (except for coordinates) until you hit save page. When you hit save page and you're at the page the point holds Coordinates, Title, Description and marker information. I would imagine it would be a button just like the 'look up coordinates' button that you get with the field parameter input type=map. Or why not just get rid of altogether and just have  where when you use input type=map you automatically get the buttons 'Save Point', 'Remove Point'...along with 'look up coordinates'. If someone wanted to enter one point they could but would also have the option to enter more points.

The and  parser functions are part of the Maps ext, right? That's why I placed the question here. I could have also placed it (and maybe should have) in semantic forms ext talk. It seems semantic maps is more for query of existing points already entered. I'm working on the stage where the user enters the points that get queried later.

kpf 11/02/2009

Hey,

The display_point(s) parser functions are indeed part of Maps. The form input for maps are part of Semantic Maps.

What you are saying makes sense, but from a technical standpoint there are a few things to consider here. My main concern is that the form inputs are hooks for Semantic Forms, while the new functionality you are describing is for Maps. In other words, you'd need 3 semantic extensions (SMW, SM & SF) to be able to use it in non semantic context (aka display_point(s)).

Much better would be to have a form thinghy available when you only have Maps itself installed. Yaron is doing some work in that direction, so before I start to have a serious look at this, I'd like to see how that turns out.

Cheers

-- Jeroen De Dauw 17:08, 2 November 2009 (UTC)

Cool. I may look into a way to do it also but...I'm not the best programmer in the world and don't have the intricate knowledge of the code like you Yaron and the others who wrote it so I may be more spinning my wheels than anything...

On the surface it seems pretty simple but maybe not as simple as it seems once you dig a little deeper.

kpf 11/02/2009

Hey,

As far as I can see ATM, no mayor changes would be needed to the extension's code. Basically, it would just be making some modifications to the relevant form inputs, which would mainly be HTML and JS.

Have a look at these files for the relevant code (assuming you want to do this for Google Maps):
 * SM_GoogleMapsFormInput.php
 * SM_GoogleMapsFunctions.js

Good luck!

Cheers

-- Jeroen De Dauw 22:29, 2 November 2009 (UTC)

Trouble With display_points
Hi, I just installed the latest Maps and Semantic Maps, I've set up my yahoo API key, and I'm trying some examples from the documentation:

The Last map, with just one point, shows fine, but the first two, with two points each, do not. What I get on those is a blank map, with the direction arrows in the upper left, map/sat/hyb buttons in the upper right, and a non-clickable orange label baloon in the upper left.

I've set my default map and geocode service to yahoo as well: LocalSettings.php: require_once( "$IP/extensions/Maps/Maps.php" ); require_once( "$IP/extensions/SemanticMaps/SemanticMaps.php" ); $egGoogleMapsKey = ''; $egYahooMapsKey = '3HA79SLV34F9Zd7PHy9YYbo5pe0MvMfj8ruPS_873fCCdLH2TU7MZrjmAsWnxH61'; $egMapsDefaultService = 'yahoomaps'; $egMapsDefaultServices = array('pf' => 'yahoomaps', 'qp' => 'yahoomaps', 'fi' => 'yahoomaps'); $egMapsDefaultGeoService = 'yahoo';

Any guidance here would be greatly appreciated, thanks for all your hard work!

Don Undeen

don.undeen_at_metmuseum.org

11/19/2009

Could someone just confirm that the above examples work for them?

thanks!

11/20/2009

Hey,

Apologies for the late reply, I somehow missed your edits.

From the date of your post, I assume you posted this when using Maps version 0.4.2? I just tried out your code with 0.5, and it seems to be working fine. See here.

Cheers

-- Jeroen De Dauw 11:55, 21 December 2009 (UTC)

Maps broken in IE6
Hi Jeroen

I doubt you can do much about that, but I have to report that Maps and Semantic Maps 0.4.2 are broken in IE6. Unfortunately, we are still using this browser in many places.

Line 799: Object doesn't support this property or method.

Earlier versions used to work. I am not sure at which point it started to break down.

There used to be a similar problem with the map part of the Exhibit result format but a solution was found. Maybe that can help you track down this one.

Regards - Laurent Alquier

Hey,

Has this problem been resolved yet?

Cheers

-- Jeroen De Dauw 11:57, 21 December 2009 (UTC)

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)

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